-
Notifications
You must be signed in to change notification settings - Fork 144k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update cachematrix.R #3
Closed
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gscottwagner
added a commit
to gscottwagner/ProgrammingAssignment2
that referenced
this pull request
May 22, 2014
This is good because now I am done with the homework and will enjoy a beer.
KEisenhart
added a commit
to KEisenhart/ProgrammingAssignment2
that referenced
this pull request
Jul 17, 2014
odefield
added a commit
to odefield/ProgrammingAssignment2
that referenced
this pull request
Aug 21, 2014
A pair of functions that cache the inverse of a matrix: makeCacheMatrix cacheSolve Added more comments to bring clarity to the program Should be run in the command line/terminal this way: rdpeng#1. pass a square matrix to makeCacheMatrix (example: A=matrix(c(1,2,3,4), nrow=2, ncol=2) rdpeng#2 cache the inverse with cacheSolve(A) rdpeng#3 access the cached inverse with cacheSolve(A)
christelc
added a commit
to christelc/ProgrammingAssignment2
that referenced
this pull request
Oct 25, 2014
MathieuRasa
added a commit
to MathieuRasa/ProgrammingAssignment2
that referenced
this pull request
Oct 26, 2014
rafafukai
added a commit
to rafafukai/ProgrammingAssignment2
that referenced
this pull request
Nov 23, 2014
ahacme
added a commit
to ahacme/ProgrammingAssignment2
that referenced
this pull request
Nov 23, 2014
pursh2002
referenced
this pull request
in pursh2002/ProgrammingAssignment2
Dec 16, 2014
jnewkirk00
added a commit
to jnewkirk00/ProgrammingAssignment2
that referenced
this pull request
Jan 22, 2015
This is the first draft for programming assignment rdpeng#3.
microprocessorguy
added a commit
to microprocessorguy/ProgrammingAssignment2
that referenced
this pull request
Jan 25, 2015
borispetukhov
added a commit
to borispetukhov/ProgrammingAssignment2
that referenced
this pull request
Feb 22, 2015
antonf-ekb
added a commit
to antonf-ekb/ProgrammingAssignment2
that referenced
this pull request
Feb 22, 2015
gemispence
added a commit
to gemispence/ProgrammingAssignment2
that referenced
this pull request
May 23, 2015
Cache Matrix
squirrelandr
added a commit
to squirrelandr/ProgrammingAssignment2
that referenced
this pull request
Jun 21, 2015
russellding
referenced
this pull request
in russellding/ProgrammingAssignment2
Jul 25, 2015
dkutzman
added a commit
to dkutzman/ProgrammingAssignment2
that referenced
this pull request
Jul 27, 2015
Edited sample functions to complete assignment rdpeng#3: makeCacheMatrix() and cacheSolve() defined.
cschooley
added a commit
to cschooley/ProgrammingAssignment2
that referenced
this pull request
Aug 20, 2015
dr-projectsinfo
added a commit
to dr-projectsinfo/ProgrammingAssignment2
that referenced
this pull request
Sep 22, 2015
013b5b79
pushed a commit
to 013b5b79/ProgrammingAssignment2
that referenced
this pull request
Oct 13, 2015
Edit rdpeng#3
sharthee
pushed a commit
to sharthee/ProgrammingAssignment2
that referenced
this pull request
Oct 23, 2015
Fixed minor typos
squirrelandr
added a commit
to squirrelandr/ProgrammingAssignment2
that referenced
this pull request
Oct 23, 2015
This reverts commit 20cca16.
dsummersl
added a commit
to dsummersl/ProgrammingAssignment2
that referenced
this pull request
Nov 18, 2015
gniapou
added a commit
to gniapou/ProgrammingAssignment2
that referenced
this pull request
Jan 23, 2016
cachematrix_AL
Ccappa
added a commit
to Ccappa/ProgrammingAssignment2
that referenced
this pull request
Feb 3, 2016
Updates for Programming Assignment rdpeng#3
janekdb
added a commit
to janekdb/ProgrammingAssignment2
that referenced
this pull request
Feb 23, 2016
amoechsin
added a commit
to amoechsin/ProgrammingAssignment2
that referenced
this pull request
Mar 26, 2016
fnets
added a commit
to fnets/ProgrammingAssignment2
that referenced
this pull request
Apr 17, 2016
This is my submitted solution to the invert matrix/store matrix in cache assignment.
izie
added a commit
to izie/ProgrammingAssignment2
that referenced
this pull request
Jul 4, 2016
Coursera Assignment rdpeng#3
oattie
added a commit
to oattie/ProgrammingAssignment2
that referenced
this pull request
Jul 30, 2016
Committed rdpeng#3
oattie
added a commit
to oattie/ProgrammingAssignment2
that referenced
this pull request
Jul 30, 2016
terrebonne
added a commit
to terrebonne/ProgrammingAssignment2
that referenced
this pull request
Aug 9, 2016
…s inverse. #1. set value of the matrix rdpeng#2. get value of the matrix rdpeng#3. set value of the inverse rdpeng#4. get value of the inversemakeCacheMatrix <- function(x = matrix()) { j <- NULL set <- function(y) { x <<- y j <<- NULL } get <- function() x setinverse <- function(solve) j <<- solve getinverse <- function() j list(set = set, get = get, setinverse = setinverse, getinverse = getinverse) } ## `cacheSolve` function computes the inverse of the "matrix" returned by `makeCacheMatrix` above. #If the inverse has already been calculated (and the matrix has not changed), then`cacheSolve` should retrieve the inverse from the cache. ## when giving: Error in x$getinverse : $ operator is invalid for atomic vectors cachesolve <- function(x, ...) { i<- x$getinverse() if(!is.null(j)) { message("getting cached data") return(j) } data <- x$get() j<- solve(data, ...) x$setinverse(j) j } ## makeCacheMatrix function creates a "matrix" object that caches its inverse. #1. set value of the matrix rdpeng#2. get value of the matrix rdpeng#3. set value of the inverse rdpeng#4. get value of the inversemakeCacheMatrix <- function(x = matrix()) { j <- NULL set <- function(y) { x <<- y j <<- NULL } get <- function() x setinverse <- function(solve) j <<- solve getinverse <- function() j list(set = set, get = get, setinverse = setinverse, getinverse = getinverse) } ## `cacheSolve` function computes the inverse of the "matrix" returned by `makeCacheMatrix` above. #If the inverse has already been calculated (and the matrix has not changed), then`cacheSolve` should retrieve the inverse from the cache. ## when giving: Error in x$getinverse : $ operator is invalid for atomic vectors cachesolve <- function(x, ...) { i<- x$getinverse() if(!is.null(j)) { message("getting cached data") return(j) } data <- x$get() j<- solve(data, ...) x$setinverse(j) j }
JohannesCoursera
added a commit
to JohannesCoursera/ProgrammingAssignment2
that referenced
this pull request
Jan 1, 2017
DsiturbedAdd
pushed a commit
to DsiturbedAdd/ProgrammingAssignment2
that referenced
this pull request
Feb 8, 2017
sideshow31
pushed a commit
to sideshow31/ProgrammingAssignment2
that referenced
this pull request
Apr 4, 2017
sideshow31
pushed a commit
to sideshow31/ProgrammingAssignment2
that referenced
this pull request
Apr 4, 2017
mksarnala
referenced
this pull request
in mksarnala/ProgrammingAssignment2
May 15, 2017
arsubram
added a commit
to arsubram/ProgrammingAssignment2
that referenced
this pull request
May 21, 2017
Test criteria: 1) matrixObj <- makeCacheMatrix(matrix(1:4, 2, 2)) 2) matrixObj$getInverse() ## Returns NULL since matrix has not been solved yet 3) cacheSolve(matrixObj) ## Solves and returns matrix object 4) cacheSolve(matrixObj) rdpeng#3 Retruns matrix object from cache 5) matrixObj <- makeCacheMatrix(matrix(1:9, 3, 3)) 6) cacheSolve(matrixObj) ## Returns message: Matrix is singular and cannot be inversed and stops
cbirole
added a commit
to cbirole/ProgrammingAssignment2
that referenced
this pull request
Feb 27, 2018
makeCacheMatrix <- function(x = matrix()) { inv <- NULL set <- function(y) { rdpeng#2 x <<- y inv <<- NULL } get <- function() x rdpeng#1 setinverse <- function(inverse) inv <<- inverse rdpeng#3 getinverse <- function() inv rdpeng#4 list(set=set, get=get, setinverse=setinverse,getinverse=getinverse) } #This function returns the inverse of matrix, #it checks if the inverse has already been returned first. If so, it gets the result. #if not, it retrieve the matrix from cache cacheSolve <- function(x, ...) { ## Return a matrix that is the inverse of 'x' inv <- x$getinverse{ ##Chitra's comment- Unexpected '{' if(!is.null(inv)){ message('getting cached data') return (inv) } #Chitra's comment- If I run this code in R - I get an error stating object 'inv' not found data <- x$get() #Chitra's comment- $ operator is unexpected here inv <- solve(data) #Chitra's comment- R is not able to coerce type 'closure' to vector type 'any' x$setinverse(inv) #Chitra's comment- $ is unexpected inv #Chitra's comment- Object 'inv' not found } #Chitra's comment- unexpected '}' }
Closed
megmcginn
added a commit
to megmcginn/ProgrammingAssignment2
that referenced
this pull request
Oct 14, 2019
programming assignment - cacheMatrix
JoanCamiloMina
added a commit
to JoanCamiloMina/ProgrammingAssignment2
that referenced
this pull request
Aug 27, 2020
Using Cache to store the calculation of the inverse of a matrix, using the concept of a constructive function that generates a list of function to access a set through cache the inverse of the matrix
kenyasmiles
referenced
this pull request
in kenyasmiles/ProgrammingAssignment2
Oct 13, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.