Example program to test inversion of symmetric matrix.
More...
#include <string>
#include <iostream>
#include <iomanip>
#include "TRandom3.h"
#include "JLang/JException.hh"
#include "JMath/JMatrix3S.hh"
#include "Jeep/JParser.hh"
#include "Jeep/JMessage.hh"
Go to the source code of this file.
|
int | main (int argc, char **argv) |
|
Example program to test inversion of symmetric matrix.
- Author
- mdejong
Definition in file JMatrix3S.cc.
int main |
( |
int |
argc, |
|
|
char ** |
argv |
|
) |
| |
Definition at line 20 of file JMatrix3S.cc.
29 JParser<> zap(
"Example program to test inversion of symmetric matrix.");
36 catch(
const exception &error) {
37 FATAL(error.what() << endl);
45 const Double_t xmin = -1.0;
46 const Double_t xmax = +1.0;
49 JMatrix3D A(gRandom->Uniform(xmin,xmax), 0.0, 0.0,
50 gRandom->Uniform(xmin,xmax), gRandom->Uniform(xmin,xmax), 0.0,
51 gRandom->Uniform(xmin,xmax), gRandom->Uniform(xmin,xmax), gRandom->Uniform(xmin,xmax));
58 DEBUG(
"Matrix A" << endl);
61 NOTICE(
"Determinant A " << A.getDeterminant() << endl);
69 DEBUG(
"Matrix A^-1" << endl);
72 NOTICE(
"Determinant A^-1 = " << B.getDeterminant() << endl);
76 DEBUG(
"Matrix A x A^-1" << endl);
79 NOTICE(
"Determinant (A x A^-1) = " <<
C.getDeterminant() << endl);
80 NOTICE(
"Determinant A x Determinant A^-1 = " << A.getDeterminant() * B.getDeterminant() << endl);
81 NOTICE(
"A x A^-1 = I ? " <<
C.isIdentity(precision) << endl);
83 if (!
C.isIdentity(precision)) {
84 ERROR(
"Matrix A x A^-1 /= I" << endl);
87 JMatrix3D D =
C - JMatrix3D::getIdentity();
89 DEBUG(
"Matrix D = C - I" << endl);
92 ASSERT(
C.isIdentity(precision));
94 catch (
const JException& error) {
Utility class to parse command line options.
#define ASSERT(A)
Assert macro.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
#define DEBUG(A)
Message macros.