solve.Matrix(a, b, tol=0, transpose=F, tune, workspace)
"Matrix"
.
transpose=T
The number of rows of
b
must equal the
number of rows of
a
, while if
transpose=F
the number of rows of
b
must
equal the number of columns of
a
.
tol
is negative, no
condition estimation is done. Otherwise, the reciprocal one norm condition
estimate is computed and the solve or inverse computation is done only if
the condition estimate is greater than
tol
. By default
tol = 0
.
a
is to be used in the solve or inverse
operation. The default is to use the untransposed matrix.
NB
,
NBMIN
, and
NX
as described in
.laenv
.
Matrix"
.
If
a
is square, it is the solution
x
to the system of
equations a %*% x = scale.b * b if
b
is present and otherwise the inverse
of
a
.
If
a
is not square, it is the the minimum l-2 norm solution to the system
of equations if
b
is present and otherwise the pseudo-inverse of
a
.
Attributes include a copy of the call to
solve
,
the optimal workspace for the underlying software,
and the one norm reciprocal condition estimate if
tol
is nonnegative.
Based on the functions dgecon, dgetrf, dgetri, zgecon, zgetrf, zgetri, dtrcon, dgeqpf, dormqr, dorgqr, ztrcon, zgeqpf, zunmqr, and zungqr from LAPACK (Anderson et al. 1994).
Anderson, E., et al. (1994). LAPACK User's Guide, 2nd edition, SIAM, Philadelphia.
m <- sample(1:9,1); n <- sample(1:9,1) a <- Matrix( rnorm(m*n), nrow = m, ncol = n) b <- rnorm(m) t(a) %*% (a%*% solve(a,b) - b) # residual of normal equations (solve(a) %*% b) - solve(a,b)