G4ErrorSymMatrix.hh File Reference

#include <vector>
#include "G4ErrorSymMatrix.icc"

Go to the source code of this file.

Data Structures

class  G4ErrorSymMatrix
class  G4ErrorSymMatrix::G4ErrorSymMatrix_row
class  G4ErrorSymMatrix::G4ErrorSymMatrix_row_const

Functions

std::ostream & operator<< (std::ostream &s, const G4ErrorSymMatrix &q)
G4ErrorMatrix operator * (const G4ErrorMatrix &m1, const G4ErrorSymMatrix &m2)
G4ErrorMatrix operator * (const G4ErrorSymMatrix &m1, const G4ErrorMatrix &m2)
G4ErrorMatrix operator * (const G4ErrorSymMatrix &m1, const G4ErrorSymMatrix &m2)
G4ErrorSymMatrix operator * (G4double t, const G4ErrorSymMatrix &s1)
G4ErrorSymMatrix operator * (const G4ErrorSymMatrix &s1, G4double t)
G4ErrorSymMatrix operator/ (const G4ErrorSymMatrix &m1, G4double t)
G4ErrorMatrix operator+ (const G4ErrorMatrix &m1, const G4ErrorSymMatrix &s2)
G4ErrorMatrix operator+ (const G4ErrorSymMatrix &s1, const G4ErrorMatrix &m2)
G4ErrorSymMatrix operator+ (const G4ErrorSymMatrix &s1, const G4ErrorSymMatrix &s2)
G4ErrorMatrix operator- (const G4ErrorMatrix &m1, const G4ErrorSymMatrix &s2)
G4ErrorMatrix operator- (const G4ErrorSymMatrix &m1, const G4ErrorMatrix &m2)
G4ErrorSymMatrix operator- (const G4ErrorSymMatrix &s1, const G4ErrorSymMatrix &s2)
G4ErrorSymMatrix dsum (const G4ErrorSymMatrix &s1, const G4ErrorSymMatrix &s2)
G4double condition (const G4ErrorSymMatrix &m)
void diag_step (G4ErrorSymMatrix *t, G4int begin, G4int end)
void diag_step (G4ErrorSymMatrix *t, G4ErrorMatrix *u, G4int begin, G4int end)
G4ErrorMatrix diagonalize (G4ErrorSymMatrix *s)
void house_with_update2 (G4ErrorSymMatrix *a, G4ErrorMatrix *v, G4int row=1, G4int col=1)
void tridiagonal (G4ErrorSymMatrix *a, G4ErrorMatrix *hsm)
G4ErrorMatrix tridiagonal (G4ErrorSymMatrix *a)


Function Documentation

G4double condition ( const G4ErrorSymMatrix m  ) 

void diag_step ( G4ErrorSymMatrix t,
G4ErrorMatrix u,
G4int  begin,
G4int  end 
)

void diag_step ( G4ErrorSymMatrix t,
G4int  begin,
G4int  end 
)

G4ErrorMatrix diagonalize ( G4ErrorSymMatrix s  ) 

G4ErrorSymMatrix dsum ( const G4ErrorSymMatrix s1,
const G4ErrorSymMatrix s2 
)

Definition at line 183 of file G4ErrorSymMatrix.cc.

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

00185 {
00186   G4ErrorSymMatrix mret(mat1.num_row() + mat2.num_row(), 0);
00187   mret.sub(1,mat1);
00188   mret.sub(mat1.num_row()+1,mat2);
00189   return mret;
00190 }

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

G4ErrorSymMatrix operator * ( const G4ErrorSymMatrix s1,
G4double  t 
)

Definition at line 273 of file G4ErrorSymMatrix.cc.

00274 {
00275   G4ErrorSymMatrix mret(mat1);
00276   mret *= t;
00277   return mret;
00278 }

G4ErrorSymMatrix operator * ( G4double  t,
const G4ErrorSymMatrix s1 
)

Definition at line 280 of file G4ErrorSymMatrix.cc.

00281 {
00282   G4ErrorSymMatrix mret(mat1);
00283   mret *= t;
00284   return mret;
00285 }

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

Definition at line 354 of file G4ErrorSymMatrix.cc.

00355 {
00356   G4ErrorMatrix mret(mat1.num_row(),mat1.num_row());
00357   CHK_DIM_1(mat1.num_col(),mat2.num_row(),*);
00358   G4int step1,stept1,step2,stept2;
00359   G4ErrorMatrixConstIter snp1,sp1,snp2,sp2;
00360   G4double temp;
00361   G4ErrorMatrixIter mr = mret.m.begin();
00362   for(step1=1,snp1=mat1.m.begin();step1<=mat1.num_row();snp1+=step1++)
00363   {
00364     for(step2=1,snp2=mat2.m.begin();step2<=mat2.num_row();)
00365     {
00366       sp1=snp1;
00367       sp2=snp2;
00368       snp2+=step2;
00369       temp=0;
00370       if(step1<step2)
00371       {
00372         while(sp1<snp1+step1)
00373           { temp+=(*(sp1++))*(*(sp2++)); }
00374         sp1+=step1-1;
00375         for(stept1=step1+1;stept1!=step2+1;sp1+=stept1++)
00376           { temp+=(*sp1)*(*(sp2++)); }
00377         sp2+=step2-1;
00378         for(stept2=++step2;stept2<=mat2.num_row();sp1+=stept1++,sp2+=stept2++)
00379           { temp+=(*sp1)*(*sp2); }
00380       }
00381       else
00382       {
00383         while(sp2<snp2)
00384           { temp+=(*(sp1++))*(*(sp2++)); }
00385         sp2+=step2-1;
00386         for(stept2=++step2;stept2!=step1+1;sp2+=stept2++)
00387           { temp+=(*(sp1++))*(*sp2); }
00388         sp1+=step1-1;
00389         for(stept1=step1+1;stept1<=mat1.num_row();sp1+=stept1++,sp2+=stept2++)
00390           { temp+=(*sp1)*(*sp2); }
00391       }
00392       *(mr++)=temp;
00393     }
00394   }
00395   return mret;
00396 }

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

Definition at line 321 of file G4ErrorSymMatrix.cc.

00322 {
00323   G4ErrorMatrix mret(mat1.num_row(),mat2.num_col());
00324   CHK_DIM_1(mat1.num_col(),mat2.num_row(),*);
00325   G4int step,stept;
00326   G4ErrorMatrixConstIter mit1,mit2,sp,snp;
00327   G4double temp;
00328   G4ErrorMatrixIter mir=mret.m.begin();
00329   for(step=1,snp=mat1.m.begin();step<=mat1.num_row();snp+=step++)
00330   {
00331     for(mit1=mat2.m.begin();mit1<mat2.m.begin()+mat2.num_col();mit1++)
00332     {
00333       mit2=mit1;
00334       sp=snp;
00335       temp=0;
00336       while(sp<snp+step)
00337       {
00338         temp+=*mit2*(*(sp++));
00339         mit2+=mat2.num_col();
00340       }
00341       sp+=step-1;
00342       for(stept=step+1;stept<=mat1.num_row();stept++)
00343       {
00344         temp+=*mit2*(*sp);
00345         mit2+=mat2.num_col();
00346         sp+=stept;
00347       }
00348       *(mir++)=temp;
00349     }
00350   }
00351   return mret;
00352 }

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

Definition at line 287 of file G4ErrorSymMatrix.cc.

00288 {
00289   G4ErrorMatrix mret(mat1.num_row(),mat2.num_col());
00290   CHK_DIM_1(mat1.num_col(),mat2.num_row(),*);
00291   G4ErrorMatrixConstIter mit1, mit2, sp,snp; //mit2=0
00292   G4double temp;
00293   G4ErrorMatrixIter mir=mret.m.begin();
00294   for(mit1=mat1.m.begin();
00295       mit1<mat1.m.begin()+mat1.num_row()*mat1.num_col();
00296       mit1 = mit2)
00297     {
00298       snp=mat2.m.begin();
00299       for(int step=1;step<=mat2.num_row();++step)
00300         {
00301             mit2=mit1;
00302             sp=snp;
00303             snp+=step;
00304             temp=0;
00305             while(sp<snp)
00306             temp+=*(sp++)*(*(mit2++));
00307             if( step<mat2.num_row() ) { // only if we aren't on the last row
00308                 sp+=step-1;
00309                 for(int stept=step+1;stept<=mat2.num_row();stept++)
00310                 {
00311                    temp+=*sp*(*(mit2++));
00312                    if(stept<mat2.num_row()) sp+=stept;
00313                 }
00314             }   // if(step
00315             *(mir++)=temp;
00316         }       // for(step
00317     }   // for(mit1
00318   return mret;
00319 }

G4ErrorSymMatrix operator+ ( const G4ErrorSymMatrix s1,
const G4ErrorSymMatrix s2 
)

Definition at line 223 of file G4ErrorSymMatrix.cc.

00225 {
00226   G4ErrorSymMatrix mret(mat1.nrow);
00227   CHK_DIM_1(mat1.nrow, mat2.nrow,+);
00228   SIMPLE_TOP(+)
00229   return mret;
00230 }

G4ErrorMatrix operator+ ( const G4ErrorSymMatrix s1,
const G4ErrorMatrix m2 
)

Definition at line 215 of file G4ErrorSymMatrix.cc.

00216 {
00217   G4ErrorMatrix mret(mat2);
00218   CHK_DIM_2(mat1.num_row(),mat2.num_row(),mat1.num_col(),mat2.num_col(),+);
00219   mret += mat1;
00220   return mret;
00221 }

G4ErrorMatrix operator+ ( const G4ErrorMatrix m1,
const G4ErrorSymMatrix s2 
)

Definition at line 207 of file G4ErrorSymMatrix.cc.

00208 {
00209   G4ErrorMatrix mret(mat1);
00210   CHK_DIM_2(mat1.num_row(),mat2.num_row(), mat1.num_col(),mat2.num_col(),+);
00211   mret += mat2;
00212   return mret;
00213 }

G4ErrorSymMatrix operator- ( const G4ErrorSymMatrix s1,
const G4ErrorSymMatrix s2 
)

Definition at line 252 of file G4ErrorSymMatrix.cc.

00254 {
00255   G4ErrorSymMatrix mret(mat1.num_row());
00256   CHK_DIM_1(mat1.num_row(),mat2.num_row(),-);
00257   SIMPLE_TOP(-)
00258   return mret;
00259 }

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

Definition at line 244 of file G4ErrorSymMatrix.cc.

00245 {
00246   G4ErrorMatrix mret(mat1);
00247   CHK_DIM_2(mat1.num_row(),mat2.num_row(),mat1.num_col(),mat2.num_col(),-);
00248   mret -= mat2;
00249   return mret;
00250 }

G4ErrorMatrix operator- ( const G4ErrorMatrix m1,
const G4ErrorSymMatrix s2 
)

Definition at line 236 of file G4ErrorSymMatrix.cc.

00237 {
00238   G4ErrorMatrix mret(mat1);
00239   CHK_DIM_2(mat1.num_row(),mat2.num_row(),mat1.num_col(),mat2.num_col(),-);
00240   mret -= mat2;
00241   return mret;
00242 }

G4ErrorSymMatrix operator/ ( const G4ErrorSymMatrix m1,
G4double  t 
)

Definition at line 266 of file G4ErrorSymMatrix.cc.

00267 {
00268   G4ErrorSymMatrix mret(mat1);
00269   mret /= t;
00270   return mret;
00271 }

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

Definition at line 524 of file G4ErrorSymMatrix.cc.

00525 {
00526   os << G4endl;
00527 
00528   // Fixed format needs 3 extra characters for field,
00529   // while scientific needs 7
00530 
00531   G4int width;
00532   if(os.flags() & std::ios::fixed)
00533   {
00534     width = os.precision()+3;
00535   }
00536   else
00537   {
00538     width = os.precision()+7;
00539   }
00540   for(G4int irow = 1; irow<= q.num_row(); irow++)
00541   {
00542     for(G4int icol = 1; icol <= q.num_col(); icol++)
00543     {
00544       os.width(width);
00545       os << q(irow,icol) << " ";
00546     }
00547     os << G4endl;
00548   }
00549   return os;
00550 }

G4ErrorMatrix tridiagonal ( G4ErrorSymMatrix a  ) 

void tridiagonal ( G4ErrorSymMatrix a,
G4ErrorMatrix hsm 
)


Generated on Mon May 27 17:50:43 2013 for Geant4 by  doxygen 1.4.7