Skip to content

Commit ae27938

Browse files
committed
add comments
1 parent 8ca744f commit ae27938

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

cachematrix.R

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
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 to
2+
## caching the inverse of a matrix rather than compute it repeatedly
3+
## These functions cache the inverse of a matrix.
34

4-
## Write a short comment describing this function
5+
## This function creates a special "matrix" object that can cache its inverse.
56

67
makeCacheMatrix <- function(x = matrix()) {
78
i <- NULL
@@ -18,7 +19,9 @@ makeCacheMatrix <- function(x = matrix()) {
1819
}
1920

2021

21-
## Write a short comment describing this function
22+
## This function computes the inverse of the special "matrix" returned by makeCacheMatrix above.
23+
## If the inverse has already been calculated (and the matrix has not changed),
24+
## then the cacheSolve should retrieve the inverse from the cache.
2225

2326
cacheSolve <- function(x, ...) {
2427
## Return a matrix that is the inverse of 'x'

0 commit comments

Comments
 (0)