Next: sort() Up: MacAnova Help File Previous: sinh()   Contents

# solve()

Usage:
 ```solve(A [,singok:T] [,quiet:T]), square REAL matrix A solve(A, B [,singok:T] [,quiet:T]), square REAL matrix A, REAL matrix B, with nrows(B) = nrows(A). ```

Keywords: linear algebra
```solve(a) computes the inverse of the square matrix a.

solve(a,b) computes the solution x to the linear equation a x = b, where
a is square and b is a REAL vector or matrix with the same number of
rows as a.  solve(a,b) is mathematically, but not computationally, the
same as solve(a) %*% b.

For either usage, if a is singular, an informative message is printed
and the operation aborts.

MISSING values are not allowed in a or b.

Expression a %\% b is equivalent to solve(a, b).

solve(a, singok:T) and solve(a, b, singok:T) does the same, except when
a is singular, no message is printed and NULL is returned.  This allows,
for example, a macro to test whether a matrix is singular and take
corrective action.

Occasionally, "overflow" occurs during the computation.  Any values in
the result that are too large to be represented are replaced by MISSING
and a WARNING message is printed.  You can suppress the message by
including 'quiet:T' as an argument.  If you do, you should use
anymissing() to check the result for the presence of MISSING elements.

If a has labels, the row and column labels of solve(a) are the column
and row labels of a, respectively.  If b is compatible, the row and
column labels of solve(a,b) are the column labels of a and b
respectively.  If b does not have labels, the column labels of
solve(a,b) are rep("a", ncols(b).  See topic 'labels'.

See also topics rsolve(), swp(), qr(), 'matrices'.
```

Gary Oehlert 2003-01-15