Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Macros | Functions
G4ErrorMatrix.cc File Reference
#include "globals.hh"
#include <cmath>
#include <iostream>
#include "G4ErrorMatrix.hh"
#include "G4ErrorSymMatrix.hh"

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   2
 
#define A03   3
 
#define A04   4
 
#define A05   5
 
#define A10   6
 
#define A11   7
 
#define A12   8
 
#define A13   9
 
#define A14   10
 
#define A15   11
 
#define A20   12
 
#define A21   13
 
#define A22   14
 
#define A23   15
 
#define A24   16
 
#define A25   17
 
#define A30   18
 
#define A31   19
 
#define A32   20
 
#define A33   21
 
#define A34   22
 
#define A35   23
 
#define A40   24
 
#define A41   25
 
#define A42   26
 
#define A43   27
 
#define A44   28
 
#define A45   29
 
#define A50   30
 
#define A51   31
 
#define A52   32
 
#define A53   33
 
#define A54   34
 
#define A55   35
 
#define M00   0
 
#define M01   1
 
#define M02   2
 
#define M03   3
 
#define M04   4
 
#define M10   5
 
#define M11   6
 
#define M12   7
 
#define M13   8
 
#define M14   9
 
#define M20   10
 
#define M21   11
 
#define M22   12
 
#define M23   13
 
#define M24   14
 
#define M30   15
 
#define M31   16
 
#define M32   17
 
#define M33   18
 
#define M34   19
 
#define M40   20
 
#define M41   21
 
#define M42   22
 
#define M43   23
 
#define M44   24
 
#define F00   0
 
#define F01   1
 
#define F02   2
 
#define F03   3
 
#define F10   4
 
#define F11   5
 
#define F12   6
 
#define F13   7
 
#define F20   8
 
#define F21   9
 
#define F22   10
 
#define F23   11
 
#define F30   12
 
#define F31   13
 
#define F32   14
 
#define F33   15
 

Functions

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

Macro Definition Documentation

#define A00   0

Definition at line 817 of file G4ErrorMatrix.cc.

Referenced by G4ErrorMatrix::invertHaywood6().

#define A01   1

Definition at line 818 of file G4ErrorMatrix.cc.

Referenced by G4ErrorMatrix::invertHaywood6().

#define A02   2

Definition at line 819 of file G4ErrorMatrix.cc.

Referenced by G4ErrorMatrix::invertHaywood6().

#define A03   3

Definition at line 820 of file G4ErrorMatrix.cc.

Referenced by G4ErrorMatrix::invertHaywood6().

#define A04   4

Definition at line 821 of file G4ErrorMatrix.cc.

Referenced by G4ErrorMatrix::invertHaywood6().

#define A05   5

Definition at line 822 of file G4ErrorMatrix.cc.

Referenced by G4ErrorMatrix::invertHaywood6().

#define A10   6

Definition at line 824 of file G4ErrorMatrix.cc.

Referenced by G4ErrorMatrix::invertHaywood6(), G4Bessel::pI0(), and G4Bessel::pI1().

#define A11   7

Definition at line 825 of file G4ErrorMatrix.cc.

Referenced by G4ErrorMatrix::invertHaywood6(), G4Bessel::pI0(), and G4Bessel::pI1().

#define A12   8

Definition at line 826 of file G4ErrorMatrix.cc.

Referenced by G4ErrorMatrix::invertHaywood6().

#define A13   9
#define A14   10

Definition at line 828 of file G4ErrorMatrix.cc.

Referenced by G4ErrorMatrix::invertHaywood6().

#define A15   11

Definition at line 829 of file G4ErrorMatrix.cc.

Referenced by G4ErrorMatrix::invertHaywood6().

#define A20   12

Definition at line 831 of file G4ErrorMatrix.cc.

Referenced by G4ErrorMatrix::invertHaywood6().

#define A21   13

Definition at line 832 of file G4ErrorMatrix.cc.

Referenced by G4ErrorMatrix::invertHaywood6().

#define A22   14

Definition at line 833 of file G4ErrorMatrix.cc.

Referenced by G4ErrorMatrix::invertHaywood6().

#define A23   15
#define A24   16

Definition at line 835 of file G4ErrorMatrix.cc.

Referenced by G4ErrorMatrix::invertHaywood6().

#define A25   17

Definition at line 836 of file G4ErrorMatrix.cc.

Referenced by G4ErrorMatrix::invertHaywood6().

#define A30   18

Definition at line 838 of file G4ErrorMatrix.cc.

Referenced by G4ErrorMatrix::invertHaywood6().

#define A31   19

Definition at line 839 of file G4ErrorMatrix.cc.

Referenced by G4ErrorMatrix::invertHaywood6().

#define A32   20

Definition at line 840 of file G4ErrorMatrix.cc.

Referenced by G4ErrorMatrix::invertHaywood6().

#define A33   21

Definition at line 841 of file G4ErrorMatrix.cc.

Referenced by G4ErrorMatrix::invertHaywood6().

#define A34   22

Definition at line 842 of file G4ErrorMatrix.cc.

Referenced by G4ErrorMatrix::invertHaywood6().

#define A35   23

Definition at line 843 of file G4ErrorMatrix.cc.

Referenced by G4ErrorMatrix::invertHaywood6().

#define A40   24

Definition at line 845 of file G4ErrorMatrix.cc.

Referenced by G4ErrorMatrix::invertHaywood6().

#define A41   25

Definition at line 846 of file G4ErrorMatrix.cc.

Referenced by G4ErrorMatrix::invertHaywood6().

#define A42   26

Definition at line 847 of file G4ErrorMatrix.cc.

Referenced by G4ErrorMatrix::invertHaywood6().

#define A43   27

Definition at line 848 of file G4ErrorMatrix.cc.

Referenced by G4ErrorMatrix::invertHaywood6().

#define A44   28

Definition at line 849 of file G4ErrorMatrix.cc.

Referenced by G4ErrorMatrix::invertHaywood6().

#define A45   29

Definition at line 850 of file G4ErrorMatrix.cc.

Referenced by G4ErrorMatrix::invertHaywood6().

#define A50   30

Definition at line 852 of file G4ErrorMatrix.cc.

Referenced by G4ErrorMatrix::invertHaywood6().

#define A51   31

Definition at line 853 of file G4ErrorMatrix.cc.

Referenced by G4ErrorMatrix::invertHaywood6().

#define A52   32

Definition at line 854 of file G4ErrorMatrix.cc.

Referenced by G4ErrorMatrix::invertHaywood6().

#define A53   33

Definition at line 855 of file G4ErrorMatrix.cc.

Referenced by G4ErrorMatrix::invertHaywood6().

#define A54   34

Definition at line 856 of file G4ErrorMatrix.cc.

Referenced by G4ErrorMatrix::invertHaywood6().

#define A55   35

Definition at line 857 of file G4ErrorMatrix.cc.

Referenced by G4ErrorMatrix::invertHaywood6().

#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 67 of file G4ErrorMatrix.cc.

Referenced by operator*().

#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 void error(const char *s)
tuple c1
Definition: plottest35.py:14

Definition at line 62 of file G4ErrorMatrix.cc.

Referenced by operator+(), G4ErrorMatrix::operator+=(), operator-(), and G4ErrorMatrix::operator-=().

#define F00   0
#define F01   1

Definition at line 890 of file G4ErrorMatrix.cc.

Referenced by G4ErrorMatrix::invertHaywood4().

#define F02   2

Definition at line 891 of file G4ErrorMatrix.cc.

Referenced by G4ErrorMatrix::invertHaywood4().

#define F03   3

Definition at line 892 of file G4ErrorMatrix.cc.

Referenced by G4ErrorMatrix::invertHaywood4().

#define F10   4
#define F11   5

Definition at line 895 of file G4ErrorMatrix.cc.

Referenced by G4ErrorMatrix::invertHaywood4().

#define F12   6
#define F13   7

Definition at line 897 of file G4ErrorMatrix.cc.

Referenced by G4ErrorMatrix::invertHaywood4().

#define F20   8
#define F21   9

Definition at line 900 of file G4ErrorMatrix.cc.

Referenced by G4ErrorMatrix::invertHaywood4().

#define F22   10
#define F23   11

Definition at line 902 of file G4ErrorMatrix.cc.

Referenced by G4ErrorMatrix::invertHaywood4().

#define F30   12

Definition at line 904 of file G4ErrorMatrix.cc.

Referenced by G4ErrorMatrix::invertHaywood4().

#define F31   13

Definition at line 905 of file G4ErrorMatrix.cc.

Referenced by G4ErrorMatrix::invertHaywood4().

#define F32   14
#define F33   15

Definition at line 907 of file G4ErrorMatrix.cc.

Referenced by G4ErrorMatrix::invertHaywood4().

#define M00   0

Definition at line 859 of file G4ErrorMatrix.cc.

Referenced by G4ErrorMatrix::invertHaywood5().

#define M01   1

Definition at line 860 of file G4ErrorMatrix.cc.

Referenced by G4ErrorMatrix::invertHaywood5().

#define M02   2

Definition at line 861 of file G4ErrorMatrix.cc.

Referenced by G4ErrorMatrix::invertHaywood5().

#define M03   3

Definition at line 862 of file G4ErrorMatrix.cc.

Referenced by G4ErrorMatrix::invertHaywood5().

#define M04   4

Definition at line 863 of file G4ErrorMatrix.cc.

Referenced by G4ErrorMatrix::invertHaywood5().

#define M10   5

Definition at line 865 of file G4ErrorMatrix.cc.

Referenced by G4ErrorMatrix::invertHaywood5().

#define M11   6

Definition at line 866 of file G4ErrorMatrix.cc.

Referenced by G4ErrorMatrix::invertHaywood5().

#define M12   7

Definition at line 867 of file G4ErrorMatrix.cc.

Referenced by G4ErrorMatrix::invertHaywood5().

#define M13   8

Definition at line 868 of file G4ErrorMatrix.cc.

Referenced by G4ErrorMatrix::invertHaywood5().

#define M14   9

Definition at line 869 of file G4ErrorMatrix.cc.

Referenced by G4ErrorMatrix::invertHaywood5().

#define M20   10

Definition at line 871 of file G4ErrorMatrix.cc.

Referenced by G4ErrorMatrix::invertHaywood5().

#define M21   11

Definition at line 872 of file G4ErrorMatrix.cc.

Referenced by G4ErrorMatrix::invertHaywood5().

#define M22   12

Definition at line 873 of file G4ErrorMatrix.cc.

Referenced by G4ErrorMatrix::invertHaywood5().

#define M23   13

Definition at line 874 of file G4ErrorMatrix.cc.

Referenced by G4ErrorMatrix::invertHaywood5().

#define M24   14

Definition at line 875 of file G4ErrorMatrix.cc.

Referenced by G4ErrorMatrix::invertHaywood5().

#define M30   15

Definition at line 877 of file G4ErrorMatrix.cc.

Referenced by G4ErrorMatrix::invertHaywood5().

#define M31   16

Definition at line 878 of file G4ErrorMatrix.cc.

Referenced by G4ErrorMatrix::invertHaywood5().

#define M32   17

Definition at line 879 of file G4ErrorMatrix.cc.

Referenced by G4ErrorMatrix::invertHaywood5().

#define M33   18

Definition at line 880 of file G4ErrorMatrix.cc.

Referenced by G4ErrorMatrix::invertHaywood5().

#define M34   19

Definition at line 881 of file G4ErrorMatrix.cc.

Referenced by G4ErrorMatrix::invertHaywood5().

#define M40   20

Definition at line 883 of file G4ErrorMatrix.cc.

Referenced by G4ErrorMatrix::invertHaywood5().

#define M41   21

Definition at line 884 of file G4ErrorMatrix.cc.

Referenced by G4ErrorMatrix::invertHaywood5().

#define M42   22

Definition at line 885 of file G4ErrorMatrix.cc.

Referenced by G4ErrorMatrix::invertHaywood5().

#define M43   23

Definition at line 886 of file G4ErrorMatrix.cc.

Referenced by G4ErrorMatrix::invertHaywood5().

#define M44   24

Definition at line 887 of file G4ErrorMatrix.cc.

Referenced by G4ErrorMatrix::invertHaywood5().

#define SIMPLE_BOP (   OPER)
Value:
G4ErrorMatrixConstIter b=mat2.m.begin(); \
for(;a!=e; a++, b++) (*a) OPER (*b);
std::vector< G4double >::const_iterator G4ErrorMatrixConstIter
std::vector< G4double >::iterator G4ErrorMatrixIter

Definition at line 47 of file G4ErrorMatrix.cc.

Referenced by G4ErrorMatrix::operator+=(), and G4ErrorMatrix::operator-=().

#define SIMPLE_TOP (   OPER)
Value:
G4ErrorMatrixConstIter a=mat1.m.begin(); \
G4ErrorMatrixConstIter b=mat2.m.begin(); \
G4ErrorMatrixIter t=mret.m.begin(); \
G4ErrorMatrixConstIter e=mat1.m.end(); \
for(;a!=e; a++, b++, t++) (*t) = (*a) OPER (*b);
std::vector< G4double >::const_iterator G4ErrorMatrixConstIter
std::vector< G4double >::iterator G4ErrorMatrixIter

Definition at line 53 of file G4ErrorMatrix.cc.

Referenced by operator+(), and operator-().

#define SIMPLE_UOP (   OPER)
Value:
for(;a!=e; a++) (*a) OPER t;
std::vector< G4double >::iterator G4ErrorMatrixIter

Definition at line 42 of file G4ErrorMatrix.cc.

Referenced by G4ErrorMatrix::operator*=(), and G4ErrorMatrix::operator/=().

Function Documentation

G4ErrorMatrix dsum ( const G4ErrorMatrix mat1,
const G4ErrorMatrix mat2 
)

Definition at line 201 of file G4ErrorMatrix.cc.

References G4ErrorMatrix::num_col(), G4ErrorMatrix::num_row(), and G4ErrorMatrix::sub().

Referenced by gadap(), gadap2(), and gadapf().

202 {
203  G4ErrorMatrix mret(mat1.num_row() + mat2.num_row(),
204  mat1.num_col() + mat2.num_col(), 0);
205  mret.sub(1,1,mat1);
206  mret.sub(mat1.num_row()+1,mat1.num_col()+1,mat2);
207  return mret;
208 }
virtual G4int num_row() const
virtual G4int num_col() const
G4ErrorMatrix sub(G4int min_row, G4int max_row, G4int min_col, G4int max_col) const
G4ErrorMatrix operator* ( const G4ErrorMatrix mat1,
G4double  t 
)

Definition at line 258 of file G4ErrorMatrix.cc.

259 {
260  G4ErrorMatrix mret(mat1);
261  mret *= t;
262  return mret;
263 }
G4ErrorMatrix operator* ( G4double  t,
const G4ErrorMatrix mat1 
)

Definition at line 265 of file G4ErrorMatrix.cc.

266 {
267  G4ErrorMatrix mret(mat1);
268  mret *= t;
269  return mret;
270 }
G4ErrorMatrix operator* ( const G4ErrorMatrix mat1,
const G4ErrorMatrix mat2 
)

Definition at line 272 of file G4ErrorMatrix.cc.

References CHK_DIM_1.

273 {
274  // initialize matrix to 0.0
275  G4ErrorMatrix mret(mat1.nrow,mat2.ncol,0);
276  CHK_DIM_1(mat1.ncol,mat2.nrow,*);
277 
278  G4int m1cols = mat1.ncol;
279  G4int m2cols = mat2.ncol;
280 
281  for (G4int i=0; i<mat1.nrow; i++)
282  {
283  for (G4int j=0; j<m1cols; j++)
284  {
285  G4double temp = mat1.m[i*m1cols+j];
286  G4ErrorMatrixIter pt = mret.m.begin() + i*m2cols;
287 
288  // Loop over k (the column index in matrix mat2)
289  G4ErrorMatrixConstIter pb = mat2.m.begin() + m2cols*j;
290  const G4ErrorMatrixConstIter pblast = pb + m2cols;
291  while (pb < pblast)
292  {
293  (*pt) += temp * (*pb);
294  pb++;
295  pt++;
296  }
297  }
298  }
299  return mret;
300 }
#define CHK_DIM_1(c1, r2, fun)
int G4int
Definition: G4Types.hh:78
std::vector< G4double >::const_iterator G4ErrorMatrixConstIter
std::vector< G4double >::iterator G4ErrorMatrixIter
double G4double
Definition: G4Types.hh:76
G4ErrorMatrix operator+ ( const G4ErrorMatrix mat1,
const G4ErrorMatrix mat2 
)

Definition at line 225 of file G4ErrorMatrix.cc.

References CHK_DIM_2, G4ErrorMatrix::num_col(), G4ErrorMatrix::num_row(), and SIMPLE_TOP.

226 {
227  G4ErrorMatrix mret(mat1.nrow, mat1.ncol);
228  CHK_DIM_2(mat1.num_row(),mat2.num_row(), mat1.num_col(),mat2.num_col(),+);
229  SIMPLE_TOP(+)
230  return mret;
231 }
virtual G4int num_row() const
#define CHK_DIM_2(r1, r2, c1, c2, fun)
virtual G4int num_col() const
#define SIMPLE_TOP(OPER)
G4ErrorMatrix operator- ( const G4ErrorMatrix mat1,
const G4ErrorMatrix mat2 
)

Definition at line 237 of file G4ErrorMatrix.cc.

References CHK_DIM_2, G4ErrorMatrix::num_col(), G4ErrorMatrix::num_row(), and SIMPLE_TOP.

238 {
239  G4ErrorMatrix mret(mat1.num_row(), mat1.num_col());
240  CHK_DIM_2(mat1.num_row(),mat2.num_row(),
241  mat1.num_col(),mat2.num_col(),-);
242  SIMPLE_TOP(-)
243  return mret;
244 }
virtual G4int num_row() const
#define CHK_DIM_2(r1, r2, c1, c2, fun)
virtual G4int num_col() const
#define SIMPLE_TOP(OPER)
G4ErrorMatrix operator/ ( const G4ErrorMatrix mat1,
G4double  t 
)

Definition at line 251 of file G4ErrorMatrix.cc.

252 {
253  G4ErrorMatrix mret(mat1);
254  mret /= t;
255  return mret;
256 }
std::ostream& operator<< ( std::ostream &  os,
const G4ErrorMatrix q 
)

Definition at line 350 of file G4ErrorMatrix.cc.

References G4endl, G4ErrorMatrix::num_col(), G4ErrorMatrix::num_row(), and width.

351 {
352  os << "\n";
353 
354  // Fixed format needs 3 extra characters for field,
355  // while scientific needs 7
356 
357  G4int width;
358  if(os.flags() & std::ios::fixed)
359  { width = os.precision()+3; }
360  else
361  { width = os.precision()+7; }
362  for(G4int irow = 1; irow<= q.num_row(); irow++)
363  {
364  for(G4int icol = 1; icol <= q.num_col(); icol++)
365  {
366  os.width(width);
367  os << q(irow,icol) << " ";
368  }
369  os << G4endl;
370  }
371  return os;
372 }
virtual G4int num_row() const
virtual G4int num_col() const
#define width
int G4int
Definition: G4Types.hh:78
#define G4endl
Definition: G4ios.hh:61