We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 76da95f commit 8088fdaCopy full SHA for 8088fda
cachematrix.R
@@ -5,14 +5,24 @@
5
## that can cache its inverse.
6
7
makeCacheMatrix <- function(x = matrix()) {
8
+ ## Store inverse of x as part of object
9
inverse_x <- NULL
10
+
11
+ ## setter function for setting intital matrix
12
set <- function(y) {
13
x <<- y
14
+ ## New matrix means inverse must be recalculated
15
inverse_x <<- NULL
16
}
17
+ ## getter function for getting intial matrix
18
get <- function() x
19
20
+ ## setter function for getting matrix inverse
21
setinverse <- function(inverse) inverse_x <<- inverse
22
23
+ ## getter function for getting matrix inverse
24
getinverse <- function() inverse_x
25
26
list(set = set, get = get,
27
setinverse = setinverse,
28
getinverse = getinverse)
0 commit comments