Geant4 9.6.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4ErrorMatrix.hh File Reference
#include <vector>
#include "G4ErrorMatrix.icc"

Go to the source code of this file.

Classes

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

◆ G4ErrorMatrixConstIter

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

Definition at line 44 of file G4ErrorMatrix.hh.

◆ G4ErrorMatrixIter

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

Definition at line 43 of file G4ErrorMatrix.hh.

Function Documentation

◆ back_solve()

void back_solve ( const G4ErrorMatrix R,
G4ErrorMatrix b 
)

◆ col_givens()

void col_givens ( G4ErrorMatrix A,
G4double  c,
G4double  s,
G4int  k1,
G4int  k2,
G4int  row_min = 1,
G4int  row_max = 0 
)

◆ col_house() [1/2]

void col_house ( G4ErrorMatrix a,
const G4ErrorMatrix v,
G4double  vnormsq,
G4int  row,
G4int  col,
G4int  row_start,
G4int  col_start 
)

◆ col_house() [2/2]

void col_house ( G4ErrorMatrix a,
const G4ErrorMatrix v,
G4int  row,
G4int  col,
G4int  row_start,
G4int  col_start 
)

◆ dsum()

G4ErrorMatrix dsum ( const G4ErrorMatrix mat1,
const G4ErrorMatrix mat2 
)

Definition at line 201 of file G4ErrorMatrix.cc.

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_col() const
virtual G4int num_row() const

◆ givens()

void givens ( G4double  a,
G4double  b,
G4double c,
G4double s 
)

◆ house_with_update() [1/2]

void house_with_update ( G4ErrorMatrix a,
G4ErrorMatrix v,
G4int  row = 1,
G4int  col = 1 
)

◆ house_with_update() [2/2]

void house_with_update ( G4ErrorMatrix a,
G4int  row = 1,
G4int  col = 1 
)

◆ operator*() [1/3]

G4ErrorMatrix operator* ( const G4ErrorMatrix m1,
const G4ErrorMatrix m2 
)

Definition at line 272 of file G4ErrorMatrix.cc.

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)
std::vector< G4double >::iterator G4ErrorMatrixIter
std::vector< G4double >::const_iterator G4ErrorMatrixConstIter
double G4double
Definition: G4Types.hh:64
int G4int
Definition: G4Types.hh:66

◆ operator*() [2/3]

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}

◆ operator*() [3/3]

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}

◆ operator+()

G4ErrorMatrix operator+ ( const G4ErrorMatrix m1,
const G4ErrorMatrix m2 
)

Definition at line 225 of file G4ErrorMatrix.cc.

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)

◆ operator-()

G4ErrorMatrix operator- ( const G4ErrorMatrix m1,
const G4ErrorMatrix m2 
)

Definition at line 237 of file G4ErrorMatrix.cc.

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}

◆ operator/()

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}

◆ operator<<()

std::ostream & operator<< ( std::ostream &  s,
const G4ErrorMatrix q 
)

Definition at line 350 of file G4ErrorMatrix.cc.

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}
#define G4endl
Definition: G4ios.hh:52

◆ qr_decomp() [1/2]

G4ErrorMatrix qr_decomp ( G4ErrorMatrix A)

◆ qr_decomp() [2/2]

void qr_decomp ( G4ErrorMatrix A,
G4ErrorMatrix hsm 
)

◆ qr_inverse() [1/2]

G4ErrorMatrix qr_inverse ( const G4ErrorMatrix A)

◆ qr_inverse() [2/2]

G4ErrorMatrix qr_inverse ( G4ErrorMatrix A)

◆ qr_solve() [1/2]

G4ErrorMatrix qr_solve ( const G4ErrorMatrix A,
const G4ErrorMatrix b 
)

◆ qr_solve() [2/2]

G4ErrorMatrix qr_solve ( G4ErrorMatrix A,
const G4ErrorMatrix b 
)

◆ row_givens()

void row_givens ( G4ErrorMatrix A,
G4double  c,
G4double  s,
G4int  k1,
G4int  k2,
G4int  col_min = 1,
G4int  col_max = 0 
)

◆ row_house() [1/2]

void row_house ( G4ErrorMatrix a,
const G4ErrorMatrix v,
G4double  vnormsq,
G4int  row,
G4int  col,
G4int  row_start,
G4int  col_start 
)

◆ row_house() [2/2]

void row_house ( G4ErrorMatrix a,
const G4ErrorMatrix v,
G4int  row,
G4int  col,
G4int  row_start,
G4int  col_start 
)