23 #include "StGlobals.hh"
25 #define MATRIX_BOUND_CHECK
26 #define WITH_ST_THREEVECTOR
27 #include "StMatrix.hh"
34 #if !defined(ST_NO_NAMESPACES) && !defined(ST_NO_EXCEPTIONS)
35 using std::logic_error;
39 X hold1(X a,
unsigned int r,
unsigned int q)
55 cout <<
"A=" << A << endl;
72 cout <<
"C+=C =>" << C << endl;
77 cout <<
"C=B+A:" << C << endl;
80 cout <<
"B.inverse(ierr)" << B.inverse(ierr) << endl;
84 C = B*B.inverse(ierr);
87 cout <<
"C=B*B.inverse(ierr) == IDENTITY" << endl;
89 cout <<
"oops.." << endl;
91 cout <<
"1st row of C" << endl;
92 cout << C.sub(1,1,1,2) << endl;
99 cout <<
"K=" << K << endl;
102 for(
int ii=1; ii<=3; ii++)
103 for(
int jj=1; jj<=3; jj++)
108 cout <<
"X" << X << endl;
110 cout <<
"Y+X" << (Y+X) << endl;
111 cout <<
"Y*X" << (Y*X) << endl;
113 #ifdef ST_NO_TEMPLATE_DEF_ARGS
119 cout <<
"square each element of K:=" << TT << endl;
121 #ifdef ST_NO_TEMPLATE_DEF_ARGS
126 cout <<
"StThreeVector a= " << a << endl;
127 cout <<
"a*K=" << a*K << endl;
128 cout <<
"K*a=" << K*a << endl;
130 cout <<
"Testing exception handling." << endl;
131 cout <<
"Note that depending on your platform" << endl;
132 cout <<
"the resulting actions might differ." << endl;
134 #ifndef ST_NO_EXCEPTIONS
138 catch(logic_error &e){
139 cout <<
"Caught exception: " << e.what() << endl;
148 cout <<
"TESTING ANTI-SYMMETRIC MATRICES" << endl;
156 cout <<
"A=" << A << endl;
172 cout <<
"C+=C =>" << C << endl;
175 cout <<
"A*B:" << (A*B) << endl;
177 cout <<
"B*A:" << (B*A) << endl;
180 cout <<
"B.inverse(ierr)" << B.inverse(ierr) << endl;
182 cout <<
"C=" << C << endl;
183 cout <<
"1st row of C" << endl;
184 cout << C.sub(1,1,1,3) << endl;
187 #ifdef ST_NO_TEMPLATE_DEF_ARGS
193 cout <<
"square all elements in B:" << B << endl;