14 using namespace RBD_LIBRARIES;
30 cout <<
"\nThis tests the exception system, so you will get\n" <<
31 "a long list of error messages\n\n";
32 cout <<
"\nPrint a real number (may help lost memory test): " 33 << 3.14159265 <<
"\n";
48 cout <<
"-----------------------------------------\n\n";
49 Matrix A(2,3), B(4,5); A = 1; B = 2;
50 cout <<
"Incompatible dimensions\n";
54 cout <<
"-----------------------------------------\n\n";
56 cout <<
"Bad index\n";
58 Try {
Real f = A(3,3); cout << f << endl; }
60 cout <<
"-----------------------------------------\n\n";
62 cout <<
"Illegal conversion\n";
66 cout <<
"-----------------------------------------\n\n";
68 cout <<
"Invert non-square matrix - 1\n";
72 cout <<
"-----------------------------------------\n\n";
74 cout <<
"Invert non-square matrix - 2\n";
78 cout <<
"-----------------------------------------\n\n";
80 cout <<
"Non 1x1 matrix to scalar\n";
82 Try {
Real f = A.as_scalar(); cout << f << endl; }
84 cout <<
"-----------------------------------------\n\n";
86 cout <<
"Matrix to vector\n";
90 cout <<
"-----------------------------------------\n\n";
92 cout <<
"Invert singular matrix\n";
94 Try {
Matrix X(2,2); X<<1<<2<<2<<4; X = X.
i(); }
96 cout <<
"-----------------------------------------\n\n";
98 cout <<
"SubMatrix error\n";
102 cout <<
"-----------------------------------------\n\n";
104 cout <<
"SubMatrix error\n";
108 cout <<
"-----------------------------------------\n\n";
110 cout <<
"Cholesky error\n";
118 cout <<
"-----------------------------------------\n\n";
120 cout <<
"Inequality error\n";
124 Matrix A(10,10), B(10,10); A = 10; B = 20;
128 cout <<
"-----------------------------------------\n\n";
130 cout <<
"Maximum of empty matrix\n";
138 cout <<
"-----------------------------------------\n\n";
140 cout <<
"Incorrectly ReSizing band matrix\n";
148 cout <<
"-----------------------------------------\n\n";
150 cout <<
"Incorrectly resizing symmetric band matrix\n";
158 cout <<
"-----------------------------------------\n\n";
160 cout <<
"ReSize CroutMatrix\n";
164 Matrix A(3,3); A = 0; A(1,1) = A(2,2) = A(3,3) = 1;
169 cout <<
"-----------------------------------------\n\n";
171 cout <<
"Manipulate CroutMatrix\n";
175 Matrix A(3,3); A = 0; A(1,1) = A(2,2) = A(3,3) = 1;
180 cout <<
"-----------------------------------------\n\n";
182 cout <<
"Manipulate BandLUMatrix\n";
191 cout <<
"-----------------------------------------\n\n";
195 CatchAll { cout <<
"\nException generated in test program\n\n"; }
198 cout <<
"\nEnd test\n";
200 cout <<
"\n(The following memory checks are probably not valid with all\n";
201 cout <<
"compilers - see documentation)\n";
202 cout <<
"\nChecking for lost memory (large block): " 203 << (
unsigned long)s1 <<
" " << (
unsigned long)s2 <<
" ";
204 if (s1 != s2) cout <<
" - see section 2.8\n";
else cout <<
" - ok\n";
206 cout <<
"\nChecking for lost memory (small block): " 207 << (
unsigned long)s3 <<
" " << (
unsigned long)s4 <<
" ";
208 if (s3 != s4) cout <<
" - see section 2.8\n\n";
else cout <<
" - ok\n\n";
void resize(int, int, int)
resize UpperBandMatrix
Upper triangular band matrix.
void resize(int, int, int)
void ReSize(int m, int b)
The usual rectangular matrix.
ReturnMatrix Cholesky(const SymmetricMatrix &S)
LU decomposition of a band matrix.
static const char * what()
GetSubMatrix Row(int f) const
void ReName(const char *)
GetSubMatrix Rows(int f, int l) const
Real maximum_absolute_value(const BaseMatrix &B)