File tree Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Expand file tree Collapse file tree 1 file changed +10
-5
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
+ # # Provides two functions to create a special matrix object and another to perform work upon that
2
+ # # special matrix object in order to cache its inverse
3
3
4
- # # Write a short comment describing this function
4
+ # # Creates a clojure object containing the supplied matrix, has internal variables for managing state of the
5
+ # # current matrix
6
+ # # Note that changes to the matrix will reset the cached value, this handles changes to the matrix
5
7
6
8
makeCacheMatrix <- function (our_matrix = matrix ()) {
7
9
computed_inverse <- NULL
@@ -21,10 +23,13 @@ makeCacheMatrix <- function(our_matrix = matrix()) {
21
23
}
22
24
23
25
24
- # # Write a short comment describing this function
26
+ # # Takes the object returned from a makeCacheMatrix call and allows you to return either a cached inverse
27
+ # # or to compute one if we haven't calculated it yet
28
+ # # There is an important change here which is not to pass additional parameters to the solve function as its other
29
+ # # paramters could modify output (see cacheSolve(t,b=M) as an example)
25
30
26
31
cacheSolve <- function (x , ... ) {
27
- # # Return a matrix that is the inverse of 'x'
32
+ # # Return a matrix that is the inverse of 'x'
28
33
inverse <- x $ getInverse()
29
34
if (! is.null(inverse )) {
30
35
message(" getting cached data" )
You can’t perform that action at this time.
0 commit comments