From 1d7d2c282083b7279dad19e8bef6ba5961247423 Mon Sep 17 00:00:00 2001 From: arims Date: Thu, 24 Apr 2014 20:27:31 -0500 Subject: [PATCH 1/3] Update cachematrix.R Test --- cachematrix.R | 1 + 1 file changed, 1 insertion(+) diff --git a/cachematrix.R b/cachematrix.R index a50be65aa44..aa333166c24 100644 --- a/cachematrix.R +++ b/cachematrix.R @@ -4,6 +4,7 @@ ## Write a short comment describing this function makeCacheMatrix <- function(x = matrix()) { +test } From eb453fda3bfd175bb12df4c7fae22a9c63e377aa Mon Sep 17 00:00:00 2001 From: arims Date: Thu, 24 Apr 2014 21:43:06 -0500 Subject: [PATCH 2/3] Assignment 2 Makecachematrix & cachesolve functions --- cachematrix.R | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/cachematrix.R b/cachematrix.R index aa333166c24..1f7800118d1 100644 --- a/cachematrix.R +++ b/cachematrix.R @@ -3,14 +3,49 @@ ## Write a short comment describing this function +## This function creates a special "matrix" object that can cache its inverse. + makeCacheMatrix <- function(x = matrix()) { test +m <- NULL + set <- function(y) { + x <<- y + m <<- NULL + } + get <- function() x + setsolve <- function(solve) m <<- solve + getsolve <- function() m + list(set = set, get = get, + setsolve = setsolve, + getsolve = getsolve) + } ## Write a short comment describing this function +## This function computes the inverse of the special "matrix" returned by makeCacheMatrix above cacheSolve <- function(x, ...) { ## Return a matrix that is the inverse of 'x' + + m <- x$getsolve() + if(!is.null(m)) { + message("getting cached matrix") + return(m) + } + data <- x$get() + m <- solve(data, ...) + x$setsolve(m) + m + + + + + + + + + + } From a4b6f3951ffae7ce87452dea247b6fa76a0f6e3c Mon Sep 17 00:00:00 2001 From: arims Date: Thu, 24 Apr 2014 20:49:28 -0500 Subject: [PATCH 3/3] Assignment2 makecachematrix & cachesolve functions --- cachematrix.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cachematrix.R b/cachematrix.R index 1f7800118d1..bd7b49a433b 100644 --- a/cachematrix.R +++ b/cachematrix.R @@ -6,7 +6,7 @@ ## This function creates a special "matrix" object that can cache its inverse. makeCacheMatrix <- function(x = matrix()) { -test + m <- NULL set <- function(y) {