#include <vector>
#include <sstream>
Go to the source code of this file.
Classes | |
class | EvtMatrix< T > |
Functions | |
template<class T> | |
EvtMatrix< T > * | operator * (const EvtMatrix< T > &left, const EvtMatrix< T > &right) |
EvtMatrix< T >* operator * | ( | const EvtMatrix< T > & | left, | |
const EvtMatrix< T > & | right | |||
) |
Definition at line 169 of file EvtMatrix.hh.
References EvtMatrix< T >::_mat, EvtMatrix< T >::_range, genRecEmupikp::line, and EvtMatrix< T >::setRange().
00170 { 00171 // Chech that the matrices have the correct range. 00172 if ( left._range != right._range ) 00173 { 00174 std::cerr << "These matrices cannot be multiplied." << std::endl; 00175 return new EvtMatrix< T >(); 00176 } 00177 00178 EvtMatrix< T >* mat = new EvtMatrix< T >(); 00179 mat->setRange( left._range ); 00180 00181 // Initialize the elements of the matrix. 00182 for ( int row = 0; row < left._range; row++ ) 00183 for ( int col = 0; col < right._range; col++ ) 00184 (*mat)[ row ][ col ] = 0; 00185 00186 for ( int row = 0; row < left._range; row++ ) 00187 for ( int col = 0; col < right._range; col++ ) 00188 for ( int line = 0; line < right._range; line++ ) 00189 (*mat)[ row ][ col ] += left._mat[ row ][ line ] * right._mat[ line ][ col ]; 00190 00191 return mat; 00192 }