File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed
Expand file tree Collapse file tree 1 file changed +7
-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+ # These functions are used to perform matrix inversion using caching to reduce
2+ # load
33
4- # # Write a short comment describing this function
4+ # This function will create a special list that contains methods to set a matrix
5+ # and cache its inverse
56
67makeCacheMatrix <- function (x = matrix ()) {
78 i <- NULL
@@ -18,7 +19,8 @@ makeCacheMatrix <- function(x = matrix()) {
1819}
1920
2021
21- # # Write a short comment describing this function
22+ # This function takes in a cachedMatrix and returns its invers. It only
23+ # calculates the inverse if it isn't cahced already
2224
2325cacheSolve <- function (x , ... ) {
2426 i <- x $ getInverse()
@@ -27,7 +29,7 @@ cacheSolve <- function(x, ...) {
2729 return (i )
2830 }
2931 data <- x $ get()
30- i <- solve(data )
32+ i <- solve(data , ... )
3133 x $ setInverse(i )
3234 i
3335}
You can’t perform that action at this time.
0 commit comments