forked from rdpeng/ProgrammingAssignment2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmakeCacheMatrix.rd
64 lines (60 loc) · 1.52 KB
/
makeCacheMatrix.rd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
\name{makeCachematrix}
\alias{makeCacheMatrix}
\title{
makeCacheMatrix
}
\description{
This function creates a cached environment to store a matrix, its inverse, and helper functions for setting/getting, used in conjunction with \code{\link{cacheSolve}}.
}
\usage{
makeCacheMatrix(x = matrix())
}
%- maybe also 'usage' for other objects documented here.
\arguments{
\item{x}{
A matrix to be cached, and later inverted.
}
}
\details{
%% ~~ If necessary, more details than the description above ~~
}
\value{
A set of helper functions for consumption by \code{\link{cacheSolve}}
}
\references{
Via Johns Hopkins on Coursera: \emph{R Programming course} \href{https://class.coursera.org/rprog-035/human_grading/view/courses/975109/assessments/3/submissions}{\strong{#reprog-035}}
}
\author{
Tom Mathews
}
\note{
%% ~~further notes~~
}
%% ~Make other sections like Warning with \section{Warning }{....} ~
\seealso{
\code{\link{cacheSolve}}
}
\examples{
## First, create the matrix cache:
q<-makeCacheMatrix(matrix(c(0,1,2,0),nrow=2))
## Then call the first time, normal executino time
cacheSolve(q)
[,1] [,2]
[1,] 0.0 1
[2,] 0.5 0
>
> # Finally, call a second time.
> # 'getting cached data' should be printed!
> cacheSolve(q)
getting cached data
[,1] [,2]
[1,] 0.0 1
[2,] 0.5 0
}
% Add one or more standard keywords, see file 'KEYWORDS' in the
% R documentation directory.
\keyword{ ~matrix }
\keyword{ ~cacheMatrix }
\keyword{ ~makeCacheMatrix }
\keyword{ ~cacheSolve }
\keyword{ ~cache }% __ONLY ONE__ keyword per line