Geant4 10.7.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4ErrorMatrix.hh File Reference
#include <vector>
#include "G4Types.hh"
#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 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 200 of file G4ErrorMatrix.cc.

201{
202 G4ErrorMatrix mret(mat1.num_row() + mat2.num_row(),
203 mat1.num_col() + mat2.num_col(), 0);
204 mret.sub(1,1,mat1);
205 mret.sub(mat1.num_row()+1,mat1.num_col()+1,mat2);
206 return mret;
207}
virtual G4int num_col() const
virtual G4int num_row() const

◆ 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 271 of file G4ErrorMatrix.cc.

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

◆ operator*() [2/3]

G4ErrorMatrix operator* ( const G4ErrorMatrix m1,
G4double  t 
)

Definition at line 257 of file G4ErrorMatrix.cc.

258{
259 G4ErrorMatrix mret(mat1);
260 mret *= t;
261 return mret;
262}

◆ operator*() [3/3]

G4ErrorMatrix operator* ( G4double  t,
const G4ErrorMatrix m1 
)

Definition at line 264 of file G4ErrorMatrix.cc.

265{
266 G4ErrorMatrix mret(mat1);
267 mret *= t;
268 return mret;
269}

◆ operator+()

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

Definition at line 224 of file G4ErrorMatrix.cc.

225{
226 G4ErrorMatrix mret(mat1.nrow, mat1.ncol);
227 CHK_DIM_2(mat1.num_row(),mat2.num_row(), mat1.num_col(),mat2.num_col(),+);
228 SIMPLE_TOP(+)
229 return mret;
230}
#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 236 of file G4ErrorMatrix.cc.

237{
238 G4ErrorMatrix mret(mat1.num_row(), mat1.num_col());
239 CHK_DIM_2(mat1.num_row(),mat2.num_row(),
240 mat1.num_col(),mat2.num_col(),-);
241 SIMPLE_TOP(-)
242 return mret;
243}

◆ operator/()

G4ErrorMatrix operator/ ( const G4ErrorMatrix m1,
G4double  t 
)

Definition at line 250 of file G4ErrorMatrix.cc.

251{
252 G4ErrorMatrix mret(mat1);
253 mret /= t;
254 return mret;
255}

◆ operator<<()

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

Definition at line 349 of file G4ErrorMatrix.cc.

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

◆ 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 
)