#include <EvtMatrix.hh>
template<class T>
class EvtMatrix< T >
Definition at line 22 of file bak-BesEvtGen-00-04-08/src/EvtGen/EvtGenBase/EvtMatrix.hh.
◆ EvtMatrix() [1/2]
◆ ~EvtMatrix() [1/2]
◆ EvtMatrix() [2/2]
◆ ~EvtMatrix() [2/2]
◆ det() [1/2]
◆ det() [2/2]
◆ dump() [1/2]
Definition at line 81 of file bak-BesEvtGen-00-04-08/src/EvtGen/EvtGenBase/EvtMatrix.hh.
82{
83 std::ostringstream str;
84
85 for ( int row = 0; row < _range; row++ )
86 {
87 str << "|";
88 for ( int col = 0; col < _range; col++ )
89 str << "\t" << _mat[ row ][ col ];
90 str << "\t|" << std::endl;
91 }
92
93 return str.str();
94}
◆ dump() [2/2]
◆ inverse() [1/2]
Definition at line 140 of file bak-BesEvtGen-00-04-08/src/EvtGen/EvtGenBase/EvtMatrix.hh.
141{
144
146 {
147 std::cerr << "This matrix has a null determinant and cannot be inverted. Returning zero matrix." << std::endl;
148 for ( int row = 0; row < _range; row++ )
149 for ( int col = 0; col < _range; col++ )
150 (*inv)( row, col ) = 0.;
151 return inv;
152 }
153
154 T determinant =
det();
155
156 for ( int row = 0; row < _range; row++ )
157 for ( int col = 0; col < _range; col++ )
158 {
160 inv->_mat[col][row] = std::pow( -1., row + col ) * minor->
det() / determinant;
161 delete minor;
162 }
163
164 return inv;
165}
◆ inverse() [2/2]
◆ min() [1/2]
Definition at line 121 of file bak-BesEvtGen-00-04-08/src/EvtGen/EvtGenBase/EvtMatrix.hh.
122{
125
126 int minIndex = 0;
127
128 for ( int r = 0; r < _range; r++ )
129 for ( int c = 0; c < _range; c++ )
130 if ( ( r != row ) && ( c != col ) )
131 {
132 (*minor)( minIndex / ( _range - 1 ), minIndex % ( _range - 1 ) ) = _mat[ r ][ c ];
133 minIndex++;
134 }
135
136 return minor;
137}
◆ min() [2/2]
◆ operator()() [1/2]
template<class T >
T & EvtMatrix< T >::operator() |
( |
int |
row, |
|
|
int |
col |
|
) |
| |
|
inline |
◆ operator()() [2/2]
template<class T >
T & EvtMatrix< T >::operator() |
( |
int |
row, |
|
|
int |
col |
|
) |
| |
|
inline |
◆ operator[]() [1/2]
◆ operator[]() [2/2]
◆ setRange() [1/2]
Definition at line 45 of file bak-BesEvtGen-00-04-08/src/EvtGen/EvtGenBase/EvtMatrix.hh.
46{
47
48
49 if ( _range != range )
50 {
51 if ( _range )
52 {
53 for ( int row = 0; row < _range; row++ )
54 delete[] _mat[ row ];
55 delete[] _mat;
56 }
57
58 _mat = new T*[ range ];
59 for ( int row = 0; row < range; row++ )
60 _mat[ row ] = new T[ range ];
61
62
63 _range = range;
64 }
65
66
67 for ( int row = 0; row < _range; row++ )
68 for ( int col = 0; col < _range; col++ )
69 _mat[ row ][ col ] = 0.;
70}
Referenced by EvtMatrix< T >::inverse(), EvtMatrix< T >::min(), and operator*().
◆ setRange() [2/2]
◆ operator* [1/2]
template<class T >
template<class M >
◆ operator* [2/2]
template<class T >
template<class M >
The documentation for this class was generated from the following files: