Geant4 11.2.2
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 220 of file G4ErrorMatrix.cc.

221{
222 G4ErrorMatrix mret(mat1.num_row() + mat2.num_row(),
223 mat1.num_col() + mat2.num_col(), 0);
224 mret.sub(1, 1, mat1);
225 mret.sub(mat1.num_row() + 1, mat1.num_col() + 1, mat2);
226 return mret;
227}
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 291 of file G4ErrorMatrix.cc.

292{
293 // initialize matrix to 0.0
294 G4ErrorMatrix mret(mat1.nrow, mat2.ncol, 0);
295 CHK_DIM_1(mat1.ncol, mat2.nrow, *);
296
297 G4int m1cols = mat1.ncol;
298 G4int m2cols = mat2.ncol;
299
300 for(G4int i = 0; i < mat1.nrow; i++)
301 {
302 for(G4int j = 0; j < m1cols; j++)
303 {
304 G4double temp = mat1.m[i * m1cols + j];
305 G4ErrorMatrixIter pt = mret.m.begin() + i * m2cols;
306
307 // Loop over k (the column index in matrix mat2)
308 G4ErrorMatrixConstIter pb = mat2.m.begin() + m2cols * j;
309 const G4ErrorMatrixConstIter pblast = pb + m2cols;
310 while(pb < pblast) // Loop checking, 06.08.2015, G.Cosmo
311 {
312 (*pt) += temp * (*pb);
313 pb++;
314 pt++;
315 }
316 }
317 }
318 return mret;
319}
#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 277 of file G4ErrorMatrix.cc.

278{
279 G4ErrorMatrix mret(mat1);
280 mret *= t;
281 return mret;
282}

◆ operator*() [3/3]

G4ErrorMatrix operator* ( G4double t,
const G4ErrorMatrix & m1 )

Definition at line 284 of file G4ErrorMatrix.cc.

285{
286 G4ErrorMatrix mret(mat1);
287 mret *= t;
288 return mret;
289}

◆ operator+()

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

Definition at line 245 of file G4ErrorMatrix.cc.

246{
247 G4ErrorMatrix mret(mat1.nrow, mat1.ncol);
248 CHK_DIM_2(mat1.num_row(), mat2.num_row(), mat1.num_col(), mat2.num_col(), +);
249 SIMPLE_TOP(+)
250 return mret;
251}
#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 257 of file G4ErrorMatrix.cc.

258{
259 G4ErrorMatrix mret(mat1.num_row(), mat1.num_col());
260 CHK_DIM_2(mat1.num_row(), mat2.num_row(), mat1.num_col(), mat2.num_col(), -);
261 SIMPLE_TOP(-)
262 return mret;
263}

◆ operator/()

G4ErrorMatrix operator/ ( const G4ErrorMatrix & m1,
G4double t )

Definition at line 270 of file G4ErrorMatrix.cc.

271{
272 G4ErrorMatrix mret(mat1);
273 mret /= t;
274 return mret;
275}

◆ operator<<()

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

Definition at line 371 of file G4ErrorMatrix.cc.

372{
373 os << "\n";
374
375 // Fixed format needs 3 extra characters for field,
376 // while scientific needs 7
377
378 std::size_t width;
379 if(os.flags() & std::ios::fixed)
380 {
381 width = os.precision() + 3;
382 }
383 else
384 {
385 width = os.precision() + 7;
386 }
387 for(G4int irow = 1; irow <= q.num_row(); ++irow)
388 {
389 for(G4int icol = 1; icol <= q.num_col(); ++icol)
390 {
391 os.width(width);
392 os << q(irow, icol) << " ";
393 }
394 os << G4endl;
395 }
396 return os;
397}
#define G4endl
Definition G4ios.hh:67

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