4 #include <Base/Math/Matrix3x3.hh>
20 std::ifstream fs( filename.c_str() );
22 BIASERR(
"could not open file "<<filename);
26 const unsigned int nMax=1024;
31 std::istringstream iss;
32 unsigned int pos=0, line=0;
33 std::vector<std::string> pattern;
35 pattern.push_back(
"RC11 =");
36 pattern.push_back(
"RC12 =");
37 pattern.push_back(
"RC13 =");
39 pattern.push_back(
"RC21 =");
40 pattern.push_back(
"RC22 =");
41 pattern.push_back(
"RC23 =");
43 pattern.push_back(
"RC31 =");
44 pattern.push_back(
"RC32 =");
45 pattern.push_back(
"RC33 =");
47 std::vector< bool > found;
48 found.resize( pattern.size(),
false);
49 BIASASSERT(found.size()>8);
50 while (!fs.eof() && (fs)
64 fs.getline(&caLine[0], nMax);
66 for (
unsigned int i=0; i<pattern.size(); i++){
67 pos = (
unsigned int)strLine.find(pattern[i]);
68 if (pos != std::string::npos){
72 strLine.substr(pos+pattern[i].size(), strLine.size()-pos-pattern[i].size())
80 BIASASSERT(found.size()==pattern.size());
82 for (
unsigned int j=0; j<found.size(); j++) foundAll=foundAll&&found[j];
83 if (!foundAll)
return -99;
94 std::ifstream fs( filename.c_str() );
96 BIASERR(
"could not open file "<<filename);
100 const unsigned int nMax=1024;
105 std::istringstream iss;
106 unsigned int pos=0, line=0;
107 std::vector<std::string> pattern;
110 pattern.push_back(
"FC_U =");
111 pattern.push_back(
"SKEW =");
112 pattern.push_back(
"CC_U =");
114 pattern.push_back(
"UNUSED_UNUSED-x82S6jd_UNUSED ");
115 pattern.push_back(
"FC_V =");
116 pattern.push_back(
"CC_V =");
118 std::vector< bool > found;
119 found.resize( pattern.size(),
false);
120 BIASASSERT(found.size()>5);
121 while (!fs.eof() && (fs)
132 fs.getline(&caLine[0], nMax);
134 for (
unsigned int i=0; i<pattern.size(); i++){
136 pos = (
unsigned int)strLine.find(pattern[i]);
137 if (pos != std::string::npos){
141 strLine.substr(pos+pattern[i].size(), strLine.size()-pos-pattern[i].size())
150 BIASASSERT(found.size()==pattern.size());
152 for (
unsigned int j=0; j<found.size(); j++) {
153 if (j!=3) foundAll=foundAll&&found[j];
155 if (!foundAll)
return -99;
161 #endif // __BogIO_hh__
int LoadBogK(const std::string &filename, Matrix3x3< T > &mat)
is a 'fixed size' quadratic matrix of dim.
int LoadBogRC(const std::string &filename, Matrix3x3< T > &mat)
void SetIdentity()
set the elements of this matrix to the identity matrix (possibly overriding the inherited method) ...