Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Data Structures | Typedefs | Functions
G4ErrorMatrix.hh File Reference
#include <vector>
#include "G4ErrorMatrix.icc"

Go to the source code of this file.

Data Structures

class  G4ErrorMatrix
 
class  G4ErrorMatrix::G4ErrorMatrix_row
 
class  G4ErrorMatrix::G4ErrorMatrix_row_const
 

Typedefs

typedef std::vector< G4double >
::iterator 
G4ErrorMatrixIter
 
typedef std::vector< G4double >
::const_iterator 
G4ErrorMatrixConstIter
 

Functions

G4ErrorMatrix operator* (const G4ErrorMatrix &m1, const G4ErrorMatrix &m2)
 
G4ErrorMatrix operator* (G4double t, const G4ErrorMatrix &m1)
 
G4ErrorMatrix operator* (const G4ErrorMatrix &m1, G4double t)
 
G4ErrorMatrix operator/ (const G4ErrorMatrix &m1, G4double t)
 
G4ErrorMatrix operator+ (const G4ErrorMatrix &m1, const G4ErrorMatrix &m2)
 
G4ErrorMatrix operator- (const G4ErrorMatrix &m1, const G4ErrorMatrix &m2)
 
G4ErrorMatrix dsum (const G4ErrorMatrix &, const G4ErrorMatrix &)
 
std::ostream & operator<< (std::ostream &s, const G4ErrorMatrix &q)
 
G4ErrorMatrix qr_solve (const G4ErrorMatrix &A, const G4ErrorMatrix &b)
 
G4ErrorMatrix qr_solve (G4ErrorMatrix *A, const G4ErrorMatrix &b)
 
G4ErrorMatrix qr_inverse (const G4ErrorMatrix &A)
 
G4ErrorMatrix qr_inverse (G4ErrorMatrix *A)
 
void qr_decomp (G4ErrorMatrix *A, G4ErrorMatrix *hsm)
 
G4ErrorMatrix qr_decomp (G4ErrorMatrix *A)
 
void back_solve (const G4ErrorMatrix &R, G4ErrorMatrix *b)
 
void col_house (G4ErrorMatrix *a, const G4ErrorMatrix &v, G4double vnormsq, G4int row, G4int col, G4int row_start, G4int col_start)
 
void col_house (G4ErrorMatrix *a, const G4ErrorMatrix &v, G4int row, G4int col, G4int row_start, G4int col_start)
 
void col_givens (G4ErrorMatrix *A, G4double c, G4double s, G4int k1, G4int k2, G4int row_min=1, G4int row_max=0)
 
void row_givens (G4ErrorMatrix *A, G4double c, G4double s, G4int k1, G4int k2, G4int col_min=1, G4int col_max=0)
 
void givens (G4double a, G4double b, G4double *c, G4double *s)
 
void house_with_update (G4ErrorMatrix *a, G4int row=1, G4int col=1)
 
void house_with_update (G4ErrorMatrix *a, G4ErrorMatrix *v, G4int row=1, G4int col=1)
 
void row_house (G4ErrorMatrix *a, const G4ErrorMatrix &v, G4double vnormsq, G4int row, G4int col, G4int row_start, G4int col_start)
 
void row_house (G4ErrorMatrix *a, const G4ErrorMatrix &v, G4int row, G4int col, G4int row_start, G4int col_start)
 

Typedef Documentation

typedef std::vector<G4double >::const_iterator G4ErrorMatrixConstIter

Definition at line 44 of file G4ErrorMatrix.hh.

typedef std::vector<G4double >::iterator G4ErrorMatrixIter

Definition at line 41 of file G4ErrorMatrix.hh.

Function Documentation

void back_solve ( const G4ErrorMatrix R,
G4ErrorMatrix b 
)
void col_givens ( G4ErrorMatrix A,
G4double  c,
G4double  s,
G4int  k1,
G4int  k2,
G4int  row_min = 1,
G4int  row_max = 0 
)
void col_house ( G4ErrorMatrix a,
const G4ErrorMatrix v,
G4double  vnormsq,
G4int  row,
G4int  col,
G4int  row_start,
G4int  col_start 
)
void col_house ( G4ErrorMatrix a,
const G4ErrorMatrix v,
G4int  row,
G4int  col,
G4int  row_start,
G4int  col_start 
)
G4ErrorMatrix dsum ( const G4ErrorMatrix ,
const G4ErrorMatrix  
)

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 }
G4ErrorMatrix sub(G4int min_row, G4int max_row, G4int min_col, G4int max_col) const
void givens ( G4double  a,
G4double  b,
G4double c,
G4double s 
)
void house_with_update ( G4ErrorMatrix a,
G4int  row = 1,
G4int  col = 1 
)
void house_with_update ( G4ErrorMatrix a,
G4ErrorMatrix v,
G4int  row = 1,
G4int  col = 1 
)
G4ErrorMatrix operator* ( const G4ErrorMatrix m1,
const G4ErrorMatrix m2 
)

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* ( G4double  t,
const G4ErrorMatrix m1 
)

Definition at line 265 of file G4ErrorMatrix.cc.

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

Definition at line 258 of file G4ErrorMatrix.cc.

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

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 }
#define CHK_DIM_2(r1, r2, c1, c2, fun)
#define SIMPLE_TOP(OPER)
G4ErrorMatrix operator- ( const G4ErrorMatrix m1,
const G4ErrorMatrix m2 
)

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 }
#define CHK_DIM_2(r1, r2, c1, c2, fun)
#define SIMPLE_TOP(OPER)
G4ErrorMatrix operator/ ( const G4ErrorMatrix m1,
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 &  s,
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
void qr_decomp ( G4ErrorMatrix A,
G4ErrorMatrix hsm 
)
G4ErrorMatrix qr_decomp ( G4ErrorMatrix A)
G4ErrorMatrix qr_inverse ( const G4ErrorMatrix A)
G4ErrorMatrix qr_inverse ( G4ErrorMatrix A)
G4ErrorMatrix qr_solve ( const G4ErrorMatrix A,
const G4ErrorMatrix b 
)
G4ErrorMatrix qr_solve ( G4ErrorMatrix A,
const G4ErrorMatrix b 
)
void row_givens ( G4ErrorMatrix A,
G4double  c,
G4double  s,
G4int  k1,
G4int  k2,
G4int  col_min = 1,
G4int  col_max = 0 
)
void row_house ( G4ErrorMatrix a,
const G4ErrorMatrix v,
G4double  vnormsq,
G4int  row,
G4int  col,
G4int  row_start,
G4int  col_start 
)
void row_house ( G4ErrorMatrix a,
const G4ErrorMatrix v,
G4int  row,
G4int  col,
G4int  row_start,
G4int  col_start 
)