File tree Expand file tree Collapse file tree 1 file changed +18
-6
lines changed Expand file tree Collapse file tree 1 file changed +18
-6
lines changed Original file line number Diff line number Diff line change 1
- # # Put comments here that give an overall description of what your
2
- # # functions do
1
+ # # Matrix inversion is usually a costly computation and there may be some benefit
2
+ # # to caching the inverse of a matrix rather than computing it repeatedly. These
3
+ # # functions implement such behaviour. These functions have been written to satisfy
4
+ # # the requirements of the Week 3 programming exercise.
3
5
4
- # # Write a short comment describing this function
6
+ # # This function creates a special "matrix" object that can cache its inverse.
5
7
6
8
makeCacheMatrix <- function (x = matrix ()) {
7
-
9
+ m <- NULL
10
+ set <- function (y ) {
11
+ x <<- y
12
+ m <<- NULL
13
+ }
14
+ get <- function () x
15
+ setinv <- function (inv ) m <<- inv
16
+ getinv <- function () m
17
+ list (set = set , get = get ,
18
+ setinv = setinv ,
19
+ getinv = getinv )
8
20
}
9
21
10
22
11
- # # Write a short comment describing this function
12
23
13
24
cacheSolve <- function (x , ... ) {
14
- # # Return a matrix that is the inverse of 'x'
25
+ # # Return a matrix that is the inverse of 'x'
26
+
15
27
}
You can’t perform that action at this time.
0 commit comments