Skip to content

Commit dff219a

Browse files
committed
Better commenting
1 parent ca50649 commit dff219a

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

cachematrix.R

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
11
## These functions provide a way to create an inverted matrix, and everytime
22
## thereafter return a cached version of the matrix until another
3-
## matrix is inverted.
3+
## matrix is set.
44

5-
## This function provides access to set and get a cached version of a matrix.
5+
#############################################################################
6+
## makeCacheMatrix: This function provides access to set and get a cached
7+
## version of a matrix.
68

9+
## x | matrix | The matrix to be set
10+
11+
## return list containing different functions used to get/set matrix
12+
#############################################################################
713
makeCacheMatrix <- function(x = matrix()) {
814
im <- NULL
915
set <- function(y) {
@@ -18,11 +24,15 @@ makeCacheMatrix <- function(x = matrix()) {
1824
getsolve = getsolve)
1925
}
2026

21-
22-
## This function returns an inverse of the matrix given to the makeCacheMatrix
27+
#############################################################################
28+
## cacheSolve: This function returns an inverse of the matrix given to the makeCacheMatrix
2329
## function. If the matrix has already been inverted and cached, it will return
2430
## the cached version, otherwise, it will invert and then cache the matrix.
2531

32+
## x | list | The list of functions used to get/set matrix
33+
34+
## return inverted matrix
35+
#############################################################################
2636
cacheSolve <- function(x, ...) {
2737
m <- x$getsolve()
2838
if(!is.null(m)) {

0 commit comments

Comments
 (0)