home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 18
/
aminetcdnumber181997.iso
/
Aminet
/
dev
/
c
/
math_classes.lha
/
math_classes
/
matrix
/
libmatrix
/
mat_inverse.cc
< prev
next >
Encoding:
Amiga
Atari
Commodore
DOS
FM Towns/JPY
Macintosh
Macintosh JP
Macintosh to JP
NeXTSTEP
RISC OS/Acorn
Shift JIS
UTF-8
Wrap
C/C++ Source or Header
|
1996-10-05
|
234 b
|
16 lines
#include "Matrix.h"
Matrix inverse(const Matrix& a)
{
Matrix m(a.rows(),a.cols());
LUmatrix b;
if(a.rows()!=a.cols())
{
error("dimensions do not match");
}
b=LUdecompose(a);
m=LUsolve(b,unity(a.rows()));
return m;
}