Skip to content

Commit 4d10b09

Browse files
committed
Added "cacheSolve()" function to comply with assignment requirement
1 parent 5b4b0d2 commit 4d10b09

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

cachematrix.R

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
# 2) This file uses, to the best of my ability, Google's R Style guide
1717
# http://google-styleguide.googlecode.com/svn/trunk/Rguide.xml
1818

19-
MakeCacheMatrix <- function(x=matrix()) {
19+
makeCacheMatrix <- function(x=matrix()) {
2020
# Creates a matrix object that supports inverse matrix calculation and caching
2121
#
2222
# Args:
@@ -104,4 +104,16 @@ MakeCacheMatrix <- function(x=matrix()) {
104104
GetInverse = GetInverse
105105
)
106106

107+
}
108+
109+
cacheSolve <- function(x){
110+
# This function is here to comply with the assignment requirements, it merely wraps around GetInverse() function
111+
#
112+
# Args:
113+
# x: A matrix object created with makeCacheMatrix
114+
#
115+
# Returns:
116+
# the inverse matrix x
117+
118+
x$GetInverse()
107119
}

cachematrix_output.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ e <- c(240,22,59)
1717
f <- c(78,33,39)
1818

1919
# Create our matrix
20-
m1 <- MakeCacheMatrix(rbind(a,b,c))
20+
m1 <- makeCacheMatrix(rbind(a,b,c))
2121
message("Original Matrix")
2222
print(m1$Get())
2323

0 commit comments

Comments
 (0)