File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change
1
+ # Creates a special "matrix" object that can cache its inverse
2
+ # Args:
3
+ # x: a square invertible matrix object
4
+ #
5
+ # Returns:
6
+ # A special "matrix" based on a list object that provides
7
+ # a get/set methods to the original matrix object and a
8
+ # get/set methods to the inversed (and cached) matrix
1
9
makeCacheMatrix <- function (x = matrix ()) {
2
10
inverse <- NULL
3
11
set <- function (y ) {
@@ -12,7 +20,14 @@ makeCacheMatrix <- function(x = matrix()) {
12
20
getinverse = getinverse )
13
21
}
14
22
15
-
23
+ # Checks whether or not whe have a cached inversed matrix.
24
+ # Returns the cached object if found, otherwise computes the inverse matrix using R "solve" method
25
+ #
26
+ # Args:
27
+ # x: a square invertible matrix object
28
+ #
29
+ # Returns:
30
+ # An inverse matrix of x matrix (cached or computed)
16
31
cacheSolve <- function (x , ... ) {
17
32
# # Return a matrix that is the inverse of 'x'
18
33
inverse <- x $ getinverse()
You can’t perform that action at this time.
0 commit comments