Geant4  10.03.p02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4ErrorSymMatrix.cc File Reference
#include "globals.hh"
#include <iostream>
#include <cmath>
#include "G4ErrorSymMatrix.hh"
#include "G4ErrorMatrix.hh"
Include dependency graph for G4ErrorSymMatrix.cc:

Go to the source code of this file.

Macros

#define SIMPLE_UOP(OPER)
 
#define SIMPLE_BOP(OPER)
 
#define SIMPLE_TOP(OPER)
 
#define CHK_DIM_2(r1, r2, c1, c2, fun)
 
#define CHK_DIM_1(c1, r2, fun)
 
#define A00   0
 
#define A01   1
 
#define A02   3
 
#define A03   6
 
#define A04   10
 
#define A05   15
 
#define A10   1
 
#define A11   2
 
#define A12   4
 
#define A13   7
 
#define A14   11
 
#define A15   16
 
#define A20   3
 
#define A21   4
 
#define A22   5
 
#define A23   8
 
#define A24   12
 
#define A25   17
 
#define A30   6
 
#define A31   7
 
#define A32   8
 
#define A33   9
 
#define A34   13
 
#define A35   18
 
#define A40   10
 
#define A41   11
 
#define A42   12
 
#define A43   13
 
#define A44   14
 
#define A45   19
 
#define A50   15
 
#define A51   16
 
#define A52   17
 
#define A53   18
 
#define A54   19
 
#define A55   20
 

Functions

G4ErrorSymMatrix dsum (const G4ErrorSymMatrix &mat1, const G4ErrorSymMatrix &mat2)
 
G4ErrorMatrix operator+ (const G4ErrorMatrix &mat1, const G4ErrorSymMatrix &mat2)
 
G4ErrorMatrix operator+ (const G4ErrorSymMatrix &mat1, const G4ErrorMatrix &mat2)
 
G4ErrorSymMatrix operator+ (const G4ErrorSymMatrix &mat1, const G4ErrorSymMatrix &mat2)
 
G4ErrorMatrix operator- (const G4ErrorMatrix &mat1, const G4ErrorSymMatrix &mat2)
 
G4ErrorMatrix operator- (const G4ErrorSymMatrix &mat1, const G4ErrorMatrix &mat2)
 
G4ErrorSymMatrix operator- (const G4ErrorSymMatrix &mat1, const G4ErrorSymMatrix &mat2)
 
G4ErrorSymMatrix operator/ (const G4ErrorSymMatrix &mat1, G4double t)
 
G4ErrorSymMatrix operator* (const G4ErrorSymMatrix &mat1, G4double t)
 
G4ErrorSymMatrix operator* (G4double t, const G4ErrorSymMatrix &mat1)
 
G4ErrorMatrix operator* (const G4ErrorMatrix &mat1, const G4ErrorSymMatrix &mat2)
 
G4ErrorMatrix operator* (const G4ErrorSymMatrix &mat1, const G4ErrorMatrix &mat2)
 
G4ErrorMatrix operator* (const G4ErrorSymMatrix &mat1, const G4ErrorSymMatrix &mat2)
 
std::ostream & operator<< (std::ostream &os, const G4ErrorSymMatrix &q)
 

Macro Definition Documentation

#define A00   0

Definition at line 1259 of file G4ErrorSymMatrix.cc.

#define A01   1

Definition at line 1260 of file G4ErrorSymMatrix.cc.

#define A02   3

Definition at line 1261 of file G4ErrorSymMatrix.cc.

#define A03   6

Definition at line 1262 of file G4ErrorSymMatrix.cc.

#define A04   10

Definition at line 1263 of file G4ErrorSymMatrix.cc.

#define A05   15

Definition at line 1264 of file G4ErrorSymMatrix.cc.

#define A10   1

Definition at line 1266 of file G4ErrorSymMatrix.cc.

#define A11   2

Definition at line 1267 of file G4ErrorSymMatrix.cc.

#define A12   4

Definition at line 1268 of file G4ErrorSymMatrix.cc.

#define A13   7

Definition at line 1269 of file G4ErrorSymMatrix.cc.

#define A14   11

Definition at line 1270 of file G4ErrorSymMatrix.cc.

#define A15   16

Definition at line 1271 of file G4ErrorSymMatrix.cc.

#define A20   3

Definition at line 1273 of file G4ErrorSymMatrix.cc.

#define A21   4

Definition at line 1274 of file G4ErrorSymMatrix.cc.

#define A22   5

Definition at line 1275 of file G4ErrorSymMatrix.cc.

#define A23   8

Definition at line 1276 of file G4ErrorSymMatrix.cc.

#define A24   12

Definition at line 1277 of file G4ErrorSymMatrix.cc.

#define A25   17

Definition at line 1278 of file G4ErrorSymMatrix.cc.

#define A30   6

Definition at line 1280 of file G4ErrorSymMatrix.cc.

#define A31   7

Definition at line 1281 of file G4ErrorSymMatrix.cc.

#define A32   8

Definition at line 1282 of file G4ErrorSymMatrix.cc.

#define A33   9

Definition at line 1283 of file G4ErrorSymMatrix.cc.

#define A34   13

Definition at line 1284 of file G4ErrorSymMatrix.cc.

#define A35   18

Definition at line 1285 of file G4ErrorSymMatrix.cc.

#define A40   10

Definition at line 1287 of file G4ErrorSymMatrix.cc.

#define A41   11

Definition at line 1288 of file G4ErrorSymMatrix.cc.

#define A42   12

Definition at line 1289 of file G4ErrorSymMatrix.cc.

#define A43   13

Definition at line 1290 of file G4ErrorSymMatrix.cc.

#define A44   14

Definition at line 1291 of file G4ErrorSymMatrix.cc.

#define A45   19

Definition at line 1292 of file G4ErrorSymMatrix.cc.

#define A50   15

Definition at line 1294 of file G4ErrorSymMatrix.cc.

#define A51   16

Definition at line 1295 of file G4ErrorSymMatrix.cc.

#define A52   17

Definition at line 1296 of file G4ErrorSymMatrix.cc.

#define A53   18

Definition at line 1297 of file G4ErrorSymMatrix.cc.

#define A54   19

Definition at line 1298 of file G4ErrorSymMatrix.cc.

#define A55   20

Definition at line 1299 of file G4ErrorSymMatrix.cc.

#define CHK_DIM_1 (   c1,
  r2,
  fun 
)
Value:
if (c1!=r2) { \
G4ErrorMatrix::error("Range error in Matrix function " #fun "(2)."); \
}
static void error(const char *s)
tuple c1
Definition: plottest35.py:14

Definition at line 64 of file G4ErrorSymMatrix.cc.

#define CHK_DIM_2 (   r1,
  r2,
  c1,
  c2,
  fun 
)
Value:
if (r1!=r2 || c1!=c2) { \
G4ErrorMatrix::error("Range error in Matrix function " #fun "(1)."); \
}
static c2_factory< G4double > c2
static void error(const char *s)
tuple c1
Definition: plottest35.py:14

Definition at line 59 of file G4ErrorSymMatrix.cc.

#define SIMPLE_BOP (   OPER)
Value:
G4ErrorMatrixConstIter b=mat2.m.begin(); \
G4ErrorMatrixConstIter e=m.begin()+num_size(); \
for(;a<e; a++, b++) (*a) OPER (*b);
uch e
Definition: csz_inflate.cc:248
std::vector< ExP01TrackerHit * > a
Definition: ExP01Classes.hh:33
std::vector< G4double >::const_iterator G4ErrorMatrixConstIter
tuple b
Definition: test.py:12
static constexpr double m
Definition: G4SIunits.hh:129
std::vector< G4double >::iterator G4ErrorMatrixIter
for(G4int i1=0;i1< theStableOnes.GetNumberOfIsotopes(static_cast< G4int >(anE->GetZ()));i1++)

Definition at line 46 of file G4ErrorSymMatrix.cc.

#define SIMPLE_TOP (   OPER)
Value:
G4ErrorMatrixConstIter a=mat1.m.begin(); \
G4ErrorMatrixConstIter b=mat2.m.begin(); \
G4ErrorMatrixIter t=mret.m.begin(); \
G4ErrorMatrixConstIter e=mat1.m.begin()+mat1.num_size(); \
for( ;a<e; a++, b++, t++) (*t) = (*a) OPER (*b);
uch e
Definition: csz_inflate.cc:248
std::vector< ExP01TrackerHit * > a
Definition: ExP01Classes.hh:33
std::vector< G4double >::const_iterator G4ErrorMatrixConstIter
tuple b
Definition: test.py:12
std::vector< G4double >::iterator G4ErrorMatrixIter
struct huft * t
Definition: csz_inflate.cc:252
for(G4int i1=0;i1< theStableOnes.GetNumberOfIsotopes(static_cast< G4int >(anE->GetZ()));i1++)

Definition at line 52 of file G4ErrorSymMatrix.cc.

#define SIMPLE_UOP (   OPER)
Value:
G4ErrorMatrixIter e=m.begin()+num_size(); \
for(;a<e; a++) (*a) OPER t;
uch e
Definition: csz_inflate.cc:248
std::vector< ExP01TrackerHit * > a
Definition: ExP01Classes.hh:33
static constexpr double m
Definition: G4SIunits.hh:129
std::vector< G4double >::iterator G4ErrorMatrixIter
struct huft * t
Definition: csz_inflate.cc:252
for(G4int i1=0;i1< theStableOnes.GetNumberOfIsotopes(static_cast< G4int >(anE->GetZ()));i1++)

Definition at line 41 of file G4ErrorSymMatrix.cc.

Function Documentation

G4ErrorSymMatrix dsum ( const G4ErrorSymMatrix mat1,
const G4ErrorSymMatrix mat2 
)

Definition at line 183 of file G4ErrorSymMatrix.cc.

185 {
186  G4ErrorSymMatrix mret(mat1.num_row() + mat2.num_row(), 0);
187  mret.sub(1,mat1);
188  mret.sub(mat1.num_row()+1,mat2);
189  return mret;
190 }
G4ErrorSymMatrix sub(G4int min_row, G4int max_row) const
G4int num_row() const

Here is the call graph for this function:

G4ErrorSymMatrix operator* ( const G4ErrorSymMatrix mat1,
G4double  t 
)

Definition at line 273 of file G4ErrorSymMatrix.cc.

274 {
275  G4ErrorSymMatrix mret(mat1);
276  mret *= t;
277  return mret;
278 }
struct huft * t
Definition: csz_inflate.cc:252
G4ErrorSymMatrix operator* ( G4double  t,
const G4ErrorSymMatrix mat1 
)

Definition at line 280 of file G4ErrorSymMatrix.cc.

281 {
282  G4ErrorSymMatrix mret(mat1);
283  mret *= t;
284  return mret;
285 }
struct huft * t
Definition: csz_inflate.cc:252
G4ErrorMatrix operator* ( const G4ErrorMatrix mat1,
const G4ErrorSymMatrix mat2 
)

Definition at line 287 of file G4ErrorSymMatrix.cc.

288 {
289  G4ErrorMatrix mret(mat1.num_row(),mat2.num_col());
290  CHK_DIM_1(mat1.num_col(),mat2.num_row(),*);
291  G4ErrorMatrixConstIter mit1, mit2, sp,snp; //mit2=0
292  G4double temp;
293  G4ErrorMatrixIter mir=mret.m.begin();
294  for(mit1=mat1.m.begin();
295  mit1<mat1.m.begin()+mat1.num_row()*mat1.num_col();
296  mit1 = mit2)
297  {
298  snp=mat2.m.begin();
299  for(int step=1;step<=mat2.num_row();++step)
300  {
301  mit2=mit1;
302  sp=snp;
303  snp+=step;
304  temp=0;
305  while(sp<snp) // Loop checking, 06.08.2015, G.Cosmo
306  { temp+=*(sp++)*(*(mit2++)); }
307  if( step<mat2.num_row() ) { // only if we aren't on the last row
308  sp+=step-1;
309  for(int stept=step+1;stept<=mat2.num_row();stept++)
310  {
311  temp+=*sp*(*(mit2++));
312  if(stept<mat2.num_row()) sp+=stept;
313  }
314  } // if(step
315  *(mir++)=temp;
316  } // for(step
317  } // for(mit1
318  return mret;
319 }
virtual G4int num_row() const
virtual G4int num_col() const
G4int num_col() const
std::vector< G4double >::const_iterator G4ErrorMatrixConstIter
G4int num_row() const
#define CHK_DIM_1(c1, r2, fun)
std::vector< G4double >::iterator G4ErrorMatrixIter
double G4double
Definition: G4Types.hh:76

Here is the call graph for this function:

G4ErrorMatrix operator* ( const G4ErrorSymMatrix mat1,
const G4ErrorMatrix mat2 
)

Definition at line 321 of file G4ErrorSymMatrix.cc.

322 {
323  G4ErrorMatrix mret(mat1.num_row(),mat2.num_col());
324  CHK_DIM_1(mat1.num_col(),mat2.num_row(),*);
325  G4int step,stept;
326  G4ErrorMatrixConstIter mit1,mit2,sp,snp;
327  G4double temp;
328  G4ErrorMatrixIter mir=mret.m.begin();
329  for(step=1,snp=mat1.m.begin();step<=mat1.num_row();snp+=step++)
330  {
331  for(mit1=mat2.m.begin();mit1<mat2.m.begin()+mat2.num_col();mit1++)
332  {
333  mit2=mit1;
334  sp=snp;
335  temp=0;
336  while(sp<snp+step) // Loop checking, 06.08.2015, G.Cosmo
337  {
338  temp+=*mit2*(*(sp++));
339  mit2+=mat2.num_col();
340  }
341  sp+=step-1;
342  for(stept=step+1;stept<=mat1.num_row();stept++)
343  {
344  temp+=*mit2*(*sp);
345  mit2+=mat2.num_col();
346  sp+=stept;
347  }
348  *(mir++)=temp;
349  }
350  }
351  return mret;
352 }
virtual G4int num_row() const
virtual G4int num_col() const
G4int num_col() const
int G4int
Definition: G4Types.hh:78
std::vector< G4double >::const_iterator G4ErrorMatrixConstIter
G4int num_row() const
#define CHK_DIM_1(c1, r2, fun)
std::vector< G4double >::iterator G4ErrorMatrixIter
double G4double
Definition: G4Types.hh:76

Here is the call graph for this function:

G4ErrorMatrix operator* ( const G4ErrorSymMatrix mat1,
const G4ErrorSymMatrix mat2 
)

Definition at line 354 of file G4ErrorSymMatrix.cc.

355 {
356  G4ErrorMatrix mret(mat1.num_row(),mat1.num_row());
357  CHK_DIM_1(mat1.num_col(),mat2.num_row(),*);
358  G4int step1,stept1,step2,stept2;
359  G4ErrorMatrixConstIter snp1,sp1,snp2,sp2;
360  G4double temp;
361  G4ErrorMatrixIter mr = mret.m.begin();
362  for(step1=1,snp1=mat1.m.begin();step1<=mat1.num_row();snp1+=step1++)
363  {
364  for(step2=1,snp2=mat2.m.begin();step2<=mat2.num_row();)
365  {
366  sp1=snp1;
367  sp2=snp2;
368  snp2+=step2;
369  temp=0;
370  if(step1<step2)
371  {
372  while(sp1<snp1+step1) // Loop checking, 06.08.2015, G.Cosmo
373  { temp+=(*(sp1++))*(*(sp2++)); }
374  sp1+=step1-1;
375  for(stept1=step1+1;stept1!=step2+1;sp1+=stept1++)
376  { temp+=(*sp1)*(*(sp2++)); }
377  sp2+=step2-1;
378  for(stept2=++step2;stept2<=mat2.num_row();sp1+=stept1++,sp2+=stept2++)
379  { temp+=(*sp1)*(*sp2); }
380  }
381  else
382  {
383  while(sp2<snp2) // Loop checking, 06.08.2015, G.Cosmo
384  { temp+=(*(sp1++))*(*(sp2++)); }
385  sp2+=step2-1;
386  for(stept2=++step2;stept2!=step1+1;sp2+=stept2++)
387  { temp+=(*(sp1++))*(*sp2); }
388  sp1+=step1-1;
389  for(stept1=step1+1;stept1<=mat1.num_row();sp1+=stept1++,sp2+=stept2++)
390  { temp+=(*sp1)*(*sp2); }
391  }
392  *(mr++)=temp;
393  }
394  }
395  return mret;
396 }
G4int num_col() const
int G4int
Definition: G4Types.hh:78
std::vector< G4double >::const_iterator G4ErrorMatrixConstIter
G4int num_row() const
#define CHK_DIM_1(c1, r2, fun)
std::vector< G4double >::iterator G4ErrorMatrixIter
double G4double
Definition: G4Types.hh:76

Here is the call graph for this function:

G4ErrorMatrix operator+ ( const G4ErrorMatrix mat1,
const G4ErrorSymMatrix mat2 
)

Definition at line 207 of file G4ErrorSymMatrix.cc.

208 {
209  G4ErrorMatrix mret(mat1);
210  CHK_DIM_2(mat1.num_row(),mat2.num_row(), mat1.num_col(),mat2.num_col(),+);
211  mret += mat2;
212  return mret;
213 }
virtual G4int num_row() const
virtual G4int num_col() const
G4int num_col() const
G4int num_row() const
#define CHK_DIM_2(r1, r2, c1, c2, fun)

Here is the call graph for this function:

G4ErrorMatrix operator+ ( const G4ErrorSymMatrix mat1,
const G4ErrorMatrix mat2 
)

Definition at line 215 of file G4ErrorSymMatrix.cc.

216 {
217  G4ErrorMatrix mret(mat2);
218  CHK_DIM_2(mat1.num_row(),mat2.num_row(),mat1.num_col(),mat2.num_col(),+);
219  mret += mat1;
220  return mret;
221 }
virtual G4int num_row() const
virtual G4int num_col() const
G4int num_col() const
G4int num_row() const
#define CHK_DIM_2(r1, r2, c1, c2, fun)

Here is the call graph for this function:

G4ErrorSymMatrix operator+ ( const G4ErrorSymMatrix mat1,
const G4ErrorSymMatrix mat2 
)

Definition at line 223 of file G4ErrorSymMatrix.cc.

225 {
226  G4ErrorSymMatrix mret(mat1.nrow);
227  CHK_DIM_1(mat1.nrow, mat2.nrow,+);
228  SIMPLE_TOP(+)
229  return mret;
230 }
#define SIMPLE_TOP(OPER)
#define CHK_DIM_1(c1, r2, fun)
G4ErrorMatrix operator- ( const G4ErrorMatrix mat1,
const G4ErrorSymMatrix mat2 
)

Definition at line 236 of file G4ErrorSymMatrix.cc.

237 {
238  G4ErrorMatrix mret(mat1);
239  CHK_DIM_2(mat1.num_row(),mat2.num_row(),mat1.num_col(),mat2.num_col(),-);
240  mret -= mat2;
241  return mret;
242 }
virtual G4int num_row() const
virtual G4int num_col() const
G4int num_col() const
G4int num_row() const
#define CHK_DIM_2(r1, r2, c1, c2, fun)

Here is the call graph for this function:

G4ErrorMatrix operator- ( const G4ErrorSymMatrix mat1,
const G4ErrorMatrix mat2 
)

Definition at line 244 of file G4ErrorSymMatrix.cc.

245 {
246  G4ErrorMatrix mret(mat1);
247  CHK_DIM_2(mat1.num_row(),mat2.num_row(),mat1.num_col(),mat2.num_col(),-);
248  mret -= mat2;
249  return mret;
250 }
virtual G4int num_row() const
virtual G4int num_col() const
G4int num_col() const
G4int num_row() const
#define CHK_DIM_2(r1, r2, c1, c2, fun)

Here is the call graph for this function:

G4ErrorSymMatrix operator- ( const G4ErrorSymMatrix mat1,
const G4ErrorSymMatrix mat2 
)

Definition at line 252 of file G4ErrorSymMatrix.cc.

254 {
255  G4ErrorSymMatrix mret(mat1.num_row());
256  CHK_DIM_1(mat1.num_row(),mat2.num_row(),-);
257  SIMPLE_TOP(-)
258  return mret;
259 }
#define SIMPLE_TOP(OPER)
G4int num_row() const
#define CHK_DIM_1(c1, r2, fun)

Here is the call graph for this function:

G4ErrorSymMatrix operator/ ( const G4ErrorSymMatrix mat1,
G4double  t 
)

Definition at line 266 of file G4ErrorSymMatrix.cc.

267 {
268  G4ErrorSymMatrix mret(mat1);
269  mret /= t;
270  return mret;
271 }
struct huft * t
Definition: csz_inflate.cc:252
std::ostream& operator<< ( std::ostream &  os,
const G4ErrorSymMatrix q 
)

Definition at line 524 of file G4ErrorSymMatrix.cc.

525 {
526  os << G4endl;
527 
528  // Fixed format needs 3 extra characters for field,
529  // while scientific needs 7
530 
531  G4int width;
532  if(os.flags() & std::ios::fixed)
533  {
534  width = os.precision()+3;
535  }
536  else
537  {
538  width = os.precision()+7;
539  }
540  for(G4int irow = 1; irow<= q.num_row(); irow++)
541  {
542  for(G4int icol = 1; icol <= q.num_col(); icol++)
543  {
544  os.width(width);
545  os << q(irow,icol) << " ";
546  }
547  os << G4endl;
548  }
549  return os;
550 }
G4int num_col() const
#define width
int G4int
Definition: G4Types.hh:78
G4int num_row() const
#define G4endl
Definition: G4ios.hh:61

Here is the call graph for this function: