6 #include "TMatrixTSym.h"
23 int main(
int argc,
char**argv)
34 JParser<> zap(
"Example program to test inversion of symmetric matrix.");
42 catch(
const exception &error) {
43 FATAL(error.what() << endl);
47 ASSERT(numberOfEvents > 0);
54 for (
int i = 0; i != numberOfEvents; ++i) {
56 if (i%100 == 0) {
STATUS(setw(8) << i <<
'\r');
DEBUG(endl); }
60 TMatrixTSym<double> R(4);
62 R(0,0) = A.
a00; R(0,1) = A.
a01; R(0,2) = A.
a02; R(0,3) = A.
a03;
63 R(1,0) = A.
a10; R(1,1) = A.
a11; R(1,2) = A.
a12; R(1,3) = A.
a13;
64 R(2,0) = A.
a20; R(2,1) = A.
a21; R(2,2) = A.
a22; R(2,3) = A.
a23;
65 R(3,0) = A.
a30; R(3,1) = A.
a31; R(3,2) = A.
a32; R(3,3) = A.
a33;
68 DEBUG(
"Matrix A" << endl);
79 for (
int i = 11; i != 0; --i) {
87 for (
int i = 11; i != 0; --i) {
93 DEBUG(
"Matrix A^-1" << endl);
100 DEBUG(
"Matrix A x A^-1" << endl);
103 DEBUG(
"Determinant (A x A^-1) = " <<
C.getDeterminant() << endl);
105 DEBUG(
"A x A^-1 = I ? " <<
C.isIdentity(precision) << endl);
107 if (!
C.isIdentity(precision)) {
108 ERROR(
"Matrix A x A^-1 /= I" << endl);
113 DEBUG(
"Matrix D = C - I" << endl);
116 ASSERT(
C.isIdentity(precision));
119 FATAL(error << endl);
124 if (numberOfEvents > 0) {
126 const double factor = 1.0;
int main(int argc, char **argv)
General purpose messaging.
#define DEBUG(A)
Message macros.
#define ASSERT(A,...)
Assert macro.
Utility class to parse command line options.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Auxiliary class for CPU timing and usage.
void print(std::ostream &out, const JScale_t scale=milli_t) const
Print timer data.
double getDeterminant() const
Get determinant of matrix.
void invert()
Invert matrix.
Utility class to parse command line options.
static const double C
Physics constants.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).