#include <vector>
#include <string>
#include <fstream>
#include <iostream>
#include "CLHEP/Matrix/GenMatrix.h"
#include "CLHEP/Matrix/Matrix.h"
#include "CLHEP/Matrix/Vector.h"
Go to the source code of this file.
Classes | |
class | matrixSaver |
save (read) HepMatrix to (from) text files More... | |
Functions | |
std::ostream & | operator<< (std::ostream &outputFile, const CLHEP::HepGenMatrix &saveMe) |
std::istream & | operator>> (std::istream &input, CLHEP::HepGenMatrix &matrix) |
std::ostream& operator<< | ( | std::ostream & | outputFile, | |
const CLHEP::HepGenMatrix & | saveMe | |||
) |
std::istream& operator>> | ( | std::istream & | input, | |
CLHEP::HepGenMatrix & | matrix | |||
) |
Definition at line 111 of file matrixSaver.cc.
References parsecf::pyparsing::col(), and row.
00112 { 00113 int numRow = 0 ; 00114 int numCol = 0 ; 00115 00116 //PG read the matrix dimension 00117 input >> numRow ; 00118 input >> numCol ; 00119 00120 //PG check whether the matrices have the right dimension 00121 assert ( numRow == matrix.num_row () ) ; 00122 assert ( numCol == matrix.num_col () ) ; 00123 00124 //PG get the matrix elements from the file 00125 for (int row=0 ; row<numRow ; ++row) 00126 { 00127 for (int col=0 ; col<numCol ; ++col) 00128 { 00129 input >> matrix[row][col] ; 00130 assert (col*row < numRow*numCol) ; 00131 } 00132 } 00133 00134 return input ; 00135 }