rdpeng/ProgrammingAssignment2 — pull request #288 by PGirdhar (2014-07-24 21:28:32+00:00)
Title: Update cachematrix.R

Assignment 2

makeCacheMatrix <- function(x=matrix())
{
m <- NULL
set <- function(y)
{
x <<- y
m <<- NULL
}

get <- function() x
setinverse <- function(solve) m <<- solve
getinverse <- function() m
list(set = set, get = get, setinverse = setinverse, getinverse = getinverse)
}

cacheSolve <- function(x, ...) {
m <- x$getinverse()
if(!is.null(m)) {
message("getting cached data")
return(m)
}
data <- x$get()
m <- solve(data, ...)
x$setinverse(m)
m

}