#include <G4GDMLReadDefine.hh>
Public Member Functions | |
G4GDMLMatrix () | |
G4GDMLMatrix (size_t rows0, size_t cols0) | |
G4GDMLMatrix (const G4GDMLMatrix &rhs) | |
G4GDMLMatrix & | operator= (const G4GDMLMatrix &rhs) |
~G4GDMLMatrix () | |
void | Set (size_t r, size_t c, G4double a) |
G4double | Get (size_t r, size_t c) const |
size_t | GetRows () const |
size_t | GetCols () const |
Definition at line 47 of file G4GDMLReadDefine.hh.
G4GDMLMatrix::G4GDMLMatrix | ( | ) |
G4GDMLMatrix::G4GDMLMatrix | ( | size_t | rows0, | |
size_t | cols0 | |||
) |
Definition at line 41 of file G4GDMLReadDefine.cc.
References FatalException, and G4Exception().
00042 { 00043 if ((rows0==0) || (cols0==0)) 00044 { 00045 G4Exception("G4GDMLMatrix::G4GDMLMatrix(r,c)", "InvalidSetup", 00046 FatalException, "Zero indeces as arguments!?"); 00047 } 00048 rows = rows0; 00049 cols = cols0; 00050 m = new G4double[rows*cols]; 00051 }
G4GDMLMatrix::G4GDMLMatrix | ( | const G4GDMLMatrix & | rhs | ) |
G4GDMLMatrix::~G4GDMLMatrix | ( | ) |
G4double G4GDMLMatrix::Get | ( | size_t | r, | |
size_t | c | |||
) | const |
Definition at line 103 of file G4GDMLReadDefine.cc.
References FatalException, and G4Exception().
Referenced by G4GDMLReadMaterials::PropertyRead().
00104 { 00105 if (r>=rows || c>=cols) 00106 { 00107 G4Exception("G4GDMLMatrix::get()", "InvalidSetup", 00108 FatalException, "Index out of range!"); 00109 } 00110 return m[cols*r+c]; 00111 }
size_t G4GDMLMatrix::GetCols | ( | ) | const |
Definition at line 118 of file G4GDMLReadDefine.cc.
Referenced by G4GDMLReadMaterials::PropertyRead().
size_t G4GDMLMatrix::GetRows | ( | ) | const |
Definition at line 113 of file G4GDMLReadDefine.cc.
Referenced by G4GDMLReadMaterials::PropertyRead().
G4GDMLMatrix & G4GDMLMatrix::operator= | ( | const G4GDMLMatrix & | rhs | ) |
Definition at line 65 of file G4GDMLReadDefine.cc.
00066 { 00067 // Check assignment to self 00068 // 00069 if (this == &rhs) { return *this; } 00070 00071 // Copy data 00072 // 00073 rows = rhs.rows; 00074 cols = rhs.cols; 00075 if (rhs.m) 00076 { 00077 m = new G4double[rows*cols]; 00078 for (size_t i=0; i<rows*cols; i++) { m[i] = rhs.m[i]; } 00079 } 00080 else 00081 { 00082 m = 0; 00083 } 00084 00085 return *this; 00086 }
void G4GDMLMatrix::Set | ( | size_t | r, | |
size_t | c, | |||
G4double | a | |||
) |
Definition at line 93 of file G4GDMLReadDefine.cc.
References FatalException, and G4Exception().
00094 { 00095 if (r>=rows || c>=cols) 00096 { 00097 G4Exception("G4GDMLMatrix::set()", "InvalidSetup", 00098 FatalException, "Index out of range!"); 00099 } 00100 m[cols*r+c] = a; 00101 }