6 #include "TMatrixTSym.h" 
   24 int main(
int argc, 
char**argv)
 
   31   size_t    numberOfInversions;
 
   37     JParser<> zap(
"Example program to test inversion of symmetric matrix.");
 
   47   catch(
const exception &error) {
 
   48     FATAL(error.what() << endl);
 
   52   gRandom->SetSeed(seed);
 
   54   const Double_t 
xmin = -1.0;
 
   55   const Double_t 
xmax = +1.0;
 
   59   for (
int i = 0; 
i != 
N; ++
i) {
 
   63     for (
int j = 0; 
j != 
i; ++
j) {
 
   71     DEBUG(
"Matrix A" << endl);
 
   80     for (
size_t i = 2*(numberOfInversions/2) + 1; 
i != 0; --
i) {
 
   86     NOTICE(
"Elapsed time (Jpp)  [us] " << setw(8) << timer.usec_wall << endl);
 
   87     DEBUG(
"Matrix A^-1" << endl);
 
   91       TMatrixTSym<double> 
R(B.size());
 
   93       for (
size_t row = 0; row != B.size(); ++row) {
 
   94         for (
size_t col = 0; col != B.size(); ++col) {
 
   95           R(row, col) = B(row, col);
 
  101       for (
size_t i = 2*(numberOfInversions/2) + 1; 
i != 0; --
i) {
 
  107       NOTICE(
"Elapsed time (ROOT) [us] " << setw(8) << timer.usec_wall << endl);
 
  114     DEBUG(
"Matrix A x A^-1" << endl);
 
  117     NOTICE(
"A x A^-1 = I ? "                     << C.isIdentity(precision)                 << endl);
 
  119     if (!C.isIdentity(precision)) {
 
  120       ERROR(
"Matrix A x A^-1 /= I" << endl);
 
  123     ASSERT(C.isIdentity(precision));
 
  128     for (
int i = 0; 
i != 
N; ++
i) {
 
  134     for (
int i = 0; 
i != 
N; ++
i) {
 
  135       for (
int j = 0; 
j != 
N; ++
j) {
 
  136         Y[
i] += B(
i,
j) * X[
j];
 
  144     for (
int i = 0; 
i != 
N; ++
i) {
 
  146       DEBUG(setw(4) << 
i << 
' ' << 
FIXED(9,5) << X[
i] << 
' ' << 
FIXED(9,5) << Y[
i] << endl);
 
  148       ASSERT(fabs(X[
i] - Y[
i]) <= precision);
 
  152     const double big = 1.0e5;
 
  154     for (
int i = 0; 
i != 
N; ++
i) {
 
  165       NOTICE(
"Elapsed time [us] " << setw(8) << timer.usec_wall << endl);
 
  166       NOTICE(
"Pivot " << setw(2) << 
i << 
'+' << big << 
' ' << (JMatrixNS(A).mul(B).isIdentity(precision) ? 
"okay" : 
"error") << endl);
 
  168       ASSERT(JMatrixNS(A).mul(B).isIdentity(precision));
 
  178       for (
int i = 0; 
i != 
N; ++
i) {
 
  179         for (
int j = 0; 
j != 
N; ++
j) {
 
  180           ASSERT(
A(
i,
j) == 0, 
"Test reset (" << 
i << 
"," << 
j << 
")");
 
  185   catch (
const JException& error) {
 
  186     FATAL(error << endl);
 
Utility class to parse command line options. 
 
int main(int argc, char *argv[])
 
then fatal Wrong number of arguments fi set_variable STRING $argv[1] set_variable DETECTORXY_TXT $WORKDIR $DETECTORXY_TXT tail read X Y CHI2 RMS printf optimum n $X $Y $CHI2 $RMS awk v Y
 
Auxiliary data structure for floating point format specification. 
 
static const double C
Physics constants. 
 
#define ASSERT(A,...)
Assert macro. 
 
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object 
 
General purpose messaging. 
 
then JCookie sh JDataQuality D $DETECTOR_ID R
 
then usage $script< input file >[option[primary[working directory]]] nWhere option can be N
 
Utility class to parse command line options. 
 
no fit printf nominal n $STRING awk v X
 
source $JPP_DIR setenv csh $JPP_DIR &dev null eval JShellParser o a A
 
#define DEBUG(A)
Message macros.