Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

AIDA_Tuple.cpp

Go to the documentation of this file.
00001 #include "AIDA_Tuple.h"
00002 #include "AIDA_Dev/IBackingStore.h"
00003 #include "AIDA_Dev/ITupleVariableDescription.h"
00004 #include "AIDA_Dev/ITupleVariableStatistics.h"
00005 #include "AIDA/IAnnotation.h"
00006 #include "AIDA/IEvaluator.h"
00007 #include "AIDA/IFilter.h"
00008 #include "AIDA/IHistogram1D.h"
00009 #include "AIDA/IHistogram2D.h"
00010 #include "AIDA/IHistogram3D.h"
00011 #include "AIDA/ICloud1D.h"
00012 #include "AIDA/ICloud2D.h"
00013 #include "AIDA/ICloud3D.h"
00014 #include "AIDA/IProfile1D.h"
00015 #include "AIDA/IProfile2D.h"
00016 
00017 #include <cmath>
00018 
00019 // static const std::string titleKey = "Title"; // defined in aida
00020 static const std::string nameKey = "Name";
00021 static const std::string emptyString = "";
00022 
00023 static const std::string g_userLevelClassType = "ITuple";
00024 
00025 static const std::string doubleType = "double";
00026 static const std::string floatType = "float";
00027 static const std::string intType = "int";
00028 static const std::string shortType = "short";
00029 static const std::string longType = "long";
00030 static const std::string charType = "char";
00031 static const std::string boolType = "bool";
00032 static const std::string stringType = "std::string";
00033 static const std::string tupleType = "AIDA::ITuple";
00034 
00035 Anaphe::AIDA_Tuple_native::AIDA_Tuple::AIDA_Tuple():
00036   m_header(),
00037   m_upToDate(false),
00038   m_store(0)
00039 {
00040   AIDA::IAnnotation& annotation = m_header.annotation();
00041   annotation.addItem( titleKey, emptyString, true );
00042   annotation.addItem( nameKey, emptyString, true );
00043 }
00044 
00045 
00046 Anaphe::AIDA_Tuple_native::AIDA_Tuple::~AIDA_Tuple()
00047 {}
00048 
00049 
00050 const std::string&
00051 Anaphe::AIDA_Tuple_native::AIDA_Tuple::name() const
00052 {
00053   return m_header.annotation().value( nameKey );
00054 }
00055 
00056 
00057 bool
00058 Anaphe::AIDA_Tuple_native::AIDA_Tuple::isUpToDate() const
00059 {
00060   return m_upToDate;
00061 }
00062 
00063 
00064 void
00065 Anaphe::AIDA_Tuple_native::AIDA_Tuple::setUpToDate( bool isUpToDate )
00066 {
00067   m_upToDate = isUpToDate;
00068 }
00069 
00070 
00071 bool
00072 Anaphe::AIDA_Tuple_native::AIDA_Tuple::setName( const std::string& newName )
00073 {
00074   AIDA::IAnnotation& annotation = m_header.annotation();
00075   annotation.setValue( nameKey, newName );
00076   return true;
00077 }
00078 
00079 
00080 const std::string&
00081 Anaphe::AIDA_Tuple_native::AIDA_Tuple::userLevelClassType() const
00082 {
00083   return g_userLevelClassType;
00084 }
00085 
00086 
00087 bool
00088 Anaphe::AIDA_Tuple_native::AIDA_Tuple::connectToStore( AIDA::Dev::IBackingStore* store )
00089 {
00090   if (m_store) return false;
00091   m_store = store;
00092   return true;
00093 }
00094 
00095 
00096 AIDA::Dev::IBackingStore*
00097 Anaphe::AIDA_Tuple_native::AIDA_Tuple::store()
00098 {
00099   return m_store;
00100 }
00101 
00102 
00103 const AIDA::Dev::IBackingStore*
00104 Anaphe::AIDA_Tuple_native::AIDA_Tuple::store() const
00105 {
00106   return m_store;
00107 }
00108 
00109 
00110 AIDA::Dev::ITupleHeader&
00111 Anaphe::AIDA_Tuple_native::AIDA_Tuple::header()
00112 {
00113   return m_header;
00114 }
00115 
00116 
00117 const AIDA::Dev::ITupleHeader&
00118 Anaphe::AIDA_Tuple_native::AIDA_Tuple::header() const
00119 {
00120   return m_header;
00121 }
00122 
00123 
00124 void*
00125 Anaphe::AIDA_Tuple_native::AIDA_Tuple::variableAddress( const std::string& variableName )
00126 {
00127   const int index = m_header.variableIndex( variableName );
00128   if ( index < 0 ) return 0;
00129   return m_store->variableAddress( m_header, index );
00130 }
00131 
00132 
00133 const void*
00134 Anaphe::AIDA_Tuple_native::AIDA_Tuple::variableAddress( const std::string& variableName ) const
00135 {
00136   const int index = m_header.variableIndex( variableName );
00137   if ( index < 0 ) return 0;
00138   const AIDA::Dev::IBackingStore* pstore = m_store;
00139   return pstore->variableAddress( m_header, index );
00140 }
00141 
00142 
00143 const std::string&
00144 Anaphe::AIDA_Tuple_native::AIDA_Tuple::title() const
00145 {
00146   return m_header.annotation().value( titleKey );
00147 }
00148 
00149 
00150 bool
00151 Anaphe::AIDA_Tuple_native::AIDA_Tuple::setTitle(const std::string & title)
00152 {
00153   AIDA::IAnnotation& annotation = m_header.annotation();
00154   annotation.setValue( titleKey, title );
00155   return true;
00156 }
00157 
00158 
00159 AIDA::IAnnotation&
00160 Anaphe::AIDA_Tuple_native::AIDA_Tuple::annotation()
00161 {
00162   return m_header.annotation();
00163 }
00164 
00165 
00166 const AIDA::IAnnotation&
00167 Anaphe::AIDA_Tuple_native::AIDA_Tuple::annotation() const
00168 {
00169   return m_header.annotation();
00170 }
00171 
00172 
00173 bool
00174 Anaphe::AIDA_Tuple_native::AIDA_Tuple::fill(int column, double value)
00175 {
00176   if ( column < 0 || column >= m_header.numberOfVariables() ) return false;
00177   const std::string& type = m_header.variableDescription( column )->variableType();
00178   if ( type == doubleType ) return fillChecked( column, value );
00179   else if ( type == floatType ) return fillChecked( column, static_cast<float>( value ) );
00180   else if ( type == intType ) return fillChecked( column, static_cast<int>( std::floor( value + 0.5 ) ) );
00181   else if ( type == longType ) return fillChecked( column, static_cast<long>( std::floor( value + 0.5 ) ) );
00182   else if ( type == shortType ) return fillChecked( column, static_cast<short>( std::floor( value + 0.5 ) ) );
00183   else if ( type == charType ) return fillChecked( column, static_cast<char>( std::floor( value + 0.5 ) ) );
00184   else if ( type == boolType ) return fillChecked( column, ( (value == 0)?false:true) );
00185   else return false;
00186 }
00187 
00188 
00189 bool
00190 Anaphe::AIDA_Tuple_native::AIDA_Tuple::fill(int column, float value)
00191 {
00192   if ( column < 0 || column >= m_header.numberOfVariables() ) return false;
00193   const std::string& type = m_header.variableDescription( column )->variableType();
00194   if ( type == floatType ) return fillChecked( column, value );
00195   else if ( type == doubleType) return fillChecked( column, static_cast<double>( value ) );
00196   else if ( type == intType ) return fillChecked( column, static_cast<int>( std::floor( value + 0.5 ) ) );
00197   else if ( type == longType ) return fillChecked( column, static_cast<long>( std::floor( value + 0.5 ) ) );
00198   else if ( type == shortType ) return fillChecked( column, static_cast<short>( std::floor( value + 0.5 ) ) );
00199   else if ( type == charType ) return fillChecked( column, static_cast<char>( std::floor( value + 0.5 ) ) );
00200   else if ( type == boolType ) return fillChecked( column, ( (value == 0)?false:true) );
00201   else return false;
00202 }
00203 
00204 
00205 bool
00206 Anaphe::AIDA_Tuple_native::AIDA_Tuple::fill(int column, long value)
00207 {
00208   if ( column < 0 || column >= m_header.numberOfVariables() ) return false;
00209   const std::string& type = m_header.variableDescription( column )->variableType();
00210   if ( type == longType ) return fillChecked( column, value );
00211   else if ( type == doubleType) return fillChecked( column, static_cast<double>( value ) );
00212   else if ( type == floatType) return fillChecked( column, static_cast<double>( value ) );
00213   else if ( type == intType ) return fillChecked( column, static_cast<int>( value ) );
00214   else if ( type == shortType ) return fillChecked( column, static_cast<short>( value ) );
00215   else if ( type == charType ) return fillChecked( column, static_cast<char>( value ) );
00216   else if ( type == boolType ) return fillChecked( column, ( (value == 0)?false:true) );
00217   else return false;
00218 }
00219 
00220 
00221 bool
00222 Anaphe::AIDA_Tuple_native::AIDA_Tuple::fill(int column, int value)
00223 {
00224   if ( column < 0 || column >= m_header.numberOfVariables() ) return false;
00225   const std::string& type = m_header.variableDescription( column )->variableType();
00226   if ( type == intType ) return fillChecked( column, value );
00227   else if ( type == doubleType) return fillChecked( column, static_cast<double>( value ) );
00228   else if ( type == floatType) return fillChecked( column, static_cast<double>( value ) );
00229   else if ( type == longType ) return fillChecked( column, static_cast<long>( value ) );
00230   else if ( type == shortType ) return fillChecked( column, static_cast<short>( value ) );
00231   else if ( type == charType ) return fillChecked( column, static_cast<char>( value ) );
00232   else if ( type == boolType ) return fillChecked( column, ( (value == 0)?false:true) );
00233   else return false;
00234 }
00235 
00236 
00237 bool
00238 Anaphe::AIDA_Tuple_native::AIDA_Tuple::fill(int column, short value)
00239 {
00240   if ( column < 0 || column >= m_header.numberOfVariables() ) return false;
00241   const std::string& type = m_header.variableDescription( column )->variableType();
00242   if ( type == shortType ) return fillChecked( column, value );
00243   else if ( type == doubleType) return fillChecked( column, static_cast<double>( value ) );
00244   else if ( type == floatType) return fillChecked( column, static_cast<double>( value ) );
00245   else if ( type == intType ) return fillChecked( column, static_cast<int>( value ) );
00246   else if ( type == longType ) return fillChecked( column, static_cast<long>( value ) );
00247   else if ( type == charType ) return fillChecked( column, static_cast<char>( value ) );
00248   else if ( type == boolType ) return fillChecked( column, ( (value == 0)?false:true) );
00249   else return false;
00250 }
00251 
00252 
00253 bool
00254 Anaphe::AIDA_Tuple_native::AIDA_Tuple::fill(int column, char value)
00255 {
00256   if ( column < 0 || column >= m_header.numberOfVariables() ) return false;
00257   const std::string& type = m_header.variableDescription( column )->variableType();
00258   if ( type == charType ) return fillChecked( column, value );
00259   else if ( type == doubleType) return fillChecked( column, static_cast<double>( value ) );
00260   else if ( type == floatType) return fillChecked( column, static_cast<double>( value ) );
00261   else if ( type == intType ) return fillChecked( column, static_cast<int>( value ) );
00262   else if ( type == longType ) return fillChecked( column, static_cast<long>( value ) );
00263   else if ( type == shortType ) return fillChecked( column, static_cast<short>( value ) );
00264   else if ( type == boolType ) return fillChecked( column, ( (value == 0)?false:true) );
00265   else return false;
00266 }
00267 
00268 
00269 bool
00270 Anaphe::AIDA_Tuple_native::AIDA_Tuple::fill(int column, bool value)
00271 {
00272   if ( column < 0 || column >= m_header.numberOfVariables() ) return false;
00273   const std::string& type = m_header.variableDescription( column )->variableType();
00274   if ( type == boolType ) return fillChecked( column, value );
00275   else if ( type == doubleType) return fillChecked( column, static_cast<double>( ( (value)?1:0) ) );
00276   else if ( type == floatType) return fillChecked( column, static_cast<double>( ( (value)?1:0) ) );
00277   else if ( type == intType ) return fillChecked( column, static_cast<int>( ( (value)?1:0) ) );
00278   else if ( type == longType ) return fillChecked( column, static_cast<long>( ( (value)?1:0) ) );
00279   else if ( type == shortType ) return fillChecked( column, static_cast<short>( ( (value)?1:0) ) );
00280   else if ( type == charType ) return fillChecked( column, static_cast<char>( ( (value)?1:0) ) );
00281   else return false;
00282 }
00283 
00284 
00285 bool
00286 Anaphe::AIDA_Tuple_native::AIDA_Tuple::fill(int column, const std::string& value)
00287 {
00288   if ( column < 0 || column >= m_header.numberOfVariables() ) return false;
00289   const std::string& type = m_header.variableDescription( column )->variableType();
00290   if ( type != stringType ) return false;
00291   void * p = m_store->variableAddress( m_header, column );
00292   if ( !p ) return false;
00293   *( reinterpret_cast<std::string*>( p ) )= value;
00294   m_header.variableDescription(column)->statistics().addEntry( 0 );
00295   m_upToDate = false;
00296   return true;
00297 }
00298 
00299 
00300 bool
00301 Anaphe::AIDA_Tuple_native::AIDA_Tuple::fill(int column, const AIDA::ITupleEntry &)
00302 {
00303   return false; // not yet supported
00304 }
00305 
00306 
00307 bool
00308 Anaphe::AIDA_Tuple_native::AIDA_Tuple::fill(const std::vector<double>& values)
00309 {
00310   bool ok = true;
00311   for ( int i = 0; i < static_cast<int>( values.size() ); ++i ) {
00312     if ( ! fill( i, values[i] ) ) {
00313       ok = false;
00314       break;
00315     }
00316   }
00317   return ok;
00318 }
00319 
00320 
00321 bool
00322 Anaphe::AIDA_Tuple_native::AIDA_Tuple::fill(const std::vector<float>& values)
00323 {
00324   bool ok = true;
00325   for ( int i = 0; i < static_cast<int>( values.size() ); ++i ) {
00326     if ( ! fill( i, values[i] ) ) {
00327       ok = false;
00328       break;
00329     }
00330   }
00331   return ok;
00332 }
00333 
00334  
00335 bool
00336 Anaphe::AIDA_Tuple_native::AIDA_Tuple::addRow()
00337 {
00338   int currentNumberOfRows = m_header.numberOfRows();
00339   m_header.setCurrentRowNumber( currentNumberOfRows );
00340   m_header.setNumberOfRows( currentNumberOfRows + 1 );
00341   // update the statistics first
00342   const int numberOfColumns = m_header.numberOfVariables();
00343   for ( int iColumn = 0; iColumn < numberOfColumns; ++iColumn ) {
00344     const std::string& variableType = m_header.variableDescription( iColumn )->variableType();
00345     void* p =  m_store->variableAddress( m_header, iColumn );
00346     if ( variableType == doubleType ) m_header.variableDescription(iColumn)->statistics().addEntry( *(reinterpret_cast<double*>(p) ) );
00347     else if ( variableType == floatType ) m_header.variableDescription(iColumn)->statistics().addEntry( static_cast<double>( *(reinterpret_cast<float*>(p) ) ) );
00348     else if ( variableType == longType ) m_header.variableDescription(iColumn)->statistics().addEntry( static_cast<double>( *(reinterpret_cast<long*>(p) ) ) );
00349     else if ( variableType == intType ) m_header.variableDescription(iColumn)->statistics().addEntry( static_cast<double>( *(reinterpret_cast<int*>(p) ) ) );
00350     else if ( variableType == shortType ) m_header.variableDescription(iColumn)->statistics().addEntry( static_cast<double>( *(reinterpret_cast<short*>(p) ) ) );
00351     else if ( variableType == charType ) m_header.variableDescription(iColumn)->statistics().addEntry( static_cast<double>( *(reinterpret_cast<char*>(p) ) ) );
00352     else if ( variableType == boolType ) m_header.variableDescription(iColumn)->statistics().addEntry( ( ( *(reinterpret_cast<bool*>(p) ) == true ) ? 1 : 0 ) );
00353     else if ( variableType == stringType ) m_header.variableDescription(iColumn)->statistics().addEntry( 0 );
00354     else if ( variableType == tupleType ) m_header.variableDescription(iColumn)->statistics().addEntry( 0 );
00355   }
00356   if ( ! m_store->writeTupleRow( m_header ) ) {
00357     m_header.setCurrentRowNumber( currentNumberOfRows - 1);
00358     m_header.setNumberOfRows( currentNumberOfRows );
00359     return false;
00360   }
00361   m_upToDate = false;
00362   return true;
00363 }
00364 
00365 
00366 void
00367 Anaphe::AIDA_Tuple_native::AIDA_Tuple::resetRow()
00368 {
00369   const int numberOfColumns = m_header.numberOfVariables();
00370   for ( int iColumn = 0; iColumn < numberOfColumns; ++iColumn ) {
00371     const std::string& variableType = m_header.variableDescription( iColumn )->variableType();
00372     void* p =  m_store->variableAddress( m_header, iColumn );
00373     if ( variableType == doubleType ) *(reinterpret_cast<double*>(p)) = 0;
00374     else if ( variableType == floatType ) *(reinterpret_cast<float*>(p)) = 0;
00375     else if ( variableType == longType ) *(reinterpret_cast<long*>(p)) = 0;
00376     else if ( variableType == intType ) *(reinterpret_cast<int*>(p)) = 0;
00377     else if ( variableType == shortType ) *(reinterpret_cast<short*>(p)) = 0;
00378     else if ( variableType == charType ) *(reinterpret_cast<char*>(p)) = 0;
00379     else if ( variableType == boolType ) *(reinterpret_cast<bool*>(p)) = true;
00380     else if ( variableType == stringType ) *(reinterpret_cast<std::string*>(p)) = "";
00381     else if ( variableType == tupleType ) reinterpret_cast<AIDA::Dev::IDevTuple*>(p)->reset();
00382   }
00383 }
00384 
00385 
00386 void
00387 Anaphe::AIDA_Tuple_native::AIDA_Tuple::reset()
00388 {
00389   const int numberOfColumns = m_header.numberOfVariables();
00390   for ( int iColumn = 0; iColumn < numberOfColumns; ++iColumn ) {
00391     m_header.variableDescription( iColumn )->resetStatistics();
00392   }
00393   m_store->resetTuple( m_header );
00394   m_header.setNumberOfRows( 0 );
00395   m_store->clearBindings( m_header );
00396   m_upToDate = false;
00397   start();
00398 }
00399 
00400 
00401 int
00402 Anaphe::AIDA_Tuple_native::AIDA_Tuple::rows() const
00403 {
00404   return m_header.numberOfRows();
00405 }
00406 
00407 
00408 void
00409 Anaphe::AIDA_Tuple_native::AIDA_Tuple::start()
00410 {
00411   m_header.setCurrentRowNumber( -1 );
00412   // bind all the variables
00413   const int numberOfColumns = m_header.numberOfVariables();
00414   for ( int iColumn = 0; iColumn < numberOfColumns; ++iColumn ) {
00415     m_store->bindVariable( m_header, iColumn );
00416   }
00417 }
00418 
00419 
00420 bool
00421 Anaphe::AIDA_Tuple_native::AIDA_Tuple::skip(int rows)
00422 {
00423   if ( rows < 0 ) return false;
00424   const int nextCurrentRowNumber = rows + m_header.currentRowNumber();
00425   if ( nextCurrentRowNumber < m_header.numberOfRows() ) {
00426     m_header.setCurrentRowNumber( nextCurrentRowNumber );
00427     return m_store->readTupleRow( m_header );
00428   }
00429   else return false;
00430 }
00431 
00432 
00433 bool
00434 Anaphe::AIDA_Tuple_native::AIDA_Tuple::next()
00435 {
00436   const int nextCurrentRowNumber = m_header.currentRowNumber() + 1;
00437   if ( nextCurrentRowNumber < m_header.numberOfRows() ) {
00438     m_header.setCurrentRowNumber( nextCurrentRowNumber );
00439     return m_store->readTupleRow( m_header );
00440   }
00441   else return false;
00442 }
00443 
00444 
00445 bool
00446 Anaphe::AIDA_Tuple_native::AIDA_Tuple::setRow(int rowIndex)
00447 {
00448   if ( rowIndex < -1 || rowIndex >= m_header.numberOfRows() ) return false;
00449   m_header.setCurrentRowNumber( rowIndex );
00450   return m_store->readTupleRow( m_header );
00451 }
00452 
00453 
00454 int
00455 Anaphe::AIDA_Tuple_native::AIDA_Tuple::findColumn(const std::string & name) const
00456 {
00457   return m_header.variableIndex( name );
00458 }
00459 
00460 
00461 double
00462 Anaphe::AIDA_Tuple_native::AIDA_Tuple::getDouble(int column) const
00463 {
00464   return *( getVariable<double>( column ) );
00465 }
00466 
00467 
00468 float
00469 Anaphe::AIDA_Tuple_native::AIDA_Tuple::getFloat(int column) const
00470 {
00471   return *( getVariable<float>( column ) );
00472 }
00473 
00474 
00475 int
00476 Anaphe::AIDA_Tuple_native::AIDA_Tuple::getInt(int column) const
00477 {
00478   return *( getVariable<int>( column ) );
00479 }
00480 
00481 
00482 short
00483 Anaphe::AIDA_Tuple_native::AIDA_Tuple::getShort(int column) const
00484 {
00485   return *( getVariable<short>( column ) );
00486 }
00487 
00488 
00489 long
00490 Anaphe::AIDA_Tuple_native::AIDA_Tuple::getLong(int column) const
00491 {
00492   return *( getVariable<long>( column ) );
00493 }
00494 
00495 
00496 char
00497 Anaphe::AIDA_Tuple_native::AIDA_Tuple::getChar(int column) const
00498 {
00499   return *( getVariable<char>( column ) );
00500 }
00501 
00502 
00503 bool
00504 Anaphe::AIDA_Tuple_native::AIDA_Tuple::getBoolean(int column) const
00505 {
00506   return *( getVariable<bool>( column ) );
00507 }
00508 
00509 
00510 const std::string&
00511 Anaphe::AIDA_Tuple_native::AIDA_Tuple::getString(int column) const
00512 {
00513   return *( getVariable<std::string>( column ) );
00514 }
00515 
00516 
00517 const AIDA::ITupleEntry*
00518 Anaphe::AIDA_Tuple_native::AIDA_Tuple::getObject(int column) const
00519 {
00520   return 0;
00521 }
00522 
00523 
00524 const AIDA::ITuple*
00525 Anaphe::AIDA_Tuple_native::AIDA_Tuple::getTuple(int column) const
00526 {
00527   return static_cast<const AIDA::ITuple*>( getVariable<AIDA::Dev::IDevTuple>( column ) );
00528 }
00529 
00530 
00531 AIDA::ITuple*
00532 Anaphe::AIDA_Tuple_native::AIDA_Tuple::getTuple(int column)
00533 {
00534   return static_cast<AIDA::ITuple*>( getVariable<AIDA::Dev::IDevTuple>( column ) );
00535 }
00536 
00537 
00538 int
00539 Anaphe::AIDA_Tuple_native::AIDA_Tuple::columns() const
00540 {
00541   return m_header.numberOfVariables();
00542 }
00543 
00544 
00545 const std::string&
00546 Anaphe::AIDA_Tuple_native::AIDA_Tuple::columnName(int column) const
00547 {
00548   const AIDA::Dev::ITupleVariableDescription* description = m_header.variableDescription(column);
00549   if ( ! description ) return emptyString;
00550   return description->variableName();
00551 }
00552 
00553 
00554 const std::string&
00555 Anaphe::AIDA_Tuple_native::AIDA_Tuple::columnType(int column) const
00556 {
00557   const AIDA::Dev::ITupleVariableDescription* description = m_header.variableDescription(column);
00558   if ( ! description ) return emptyString;
00559   return description->variableType();
00560 }
00561 
00562 
00563 double
00564 Anaphe::AIDA_Tuple_native::AIDA_Tuple::columnMin(int column) const
00565 {
00566   const AIDA::Dev::ITupleVariableDescription* description = m_header.variableDescription(column);
00567   if ( ! description ) return 0;
00568   return description->statistics().min();
00569 }
00570 
00571 
00572 double
00573 Anaphe::AIDA_Tuple_native::AIDA_Tuple::columnMax(int column) const
00574 {
00575   const AIDA::Dev::ITupleVariableDescription* description = m_header.variableDescription(column);
00576   if ( ! description ) return 0;
00577   return description->statistics().max();
00578 }
00579 
00580 
00581 double
00582 Anaphe::AIDA_Tuple_native::AIDA_Tuple::columnMean(int column) const
00583 {
00584   const AIDA::Dev::ITupleVariableDescription* description = m_header.variableDescription(column);
00585   if ( ! description ) return 0;
00586   return description->statistics().mean();
00587 }
00588 
00589 
00590 double
00591 Anaphe::AIDA_Tuple_native::AIDA_Tuple::columnRms(int column) const
00592 {
00593   const AIDA::Dev::ITupleVariableDescription* description = m_header.variableDescription(column);
00594   if ( ! description ) return 0;
00595   return description->statistics().rms();
00596 }
00597 
00598 
00599 bool
00600 Anaphe::AIDA_Tuple_native::AIDA_Tuple::project( AIDA::IHistogram1D& histogram,
00601                                                 AIDA::IEvaluator& evaluatorX )
00602 {
00603   m_store->clearBindings( m_header );
00604   if ( ! evaluatorX.initialize( *this ) ) return false;
00605   const int numberOfRows = m_header.numberOfRows();
00606   for ( int iRow = 0; iRow < numberOfRows; ++iRow ) {
00607     m_header.setCurrentRowNumber( iRow );
00608     m_store->readTupleRow( m_header );
00609     histogram.fill( evaluatorX.evaluateDouble() );
00610   }
00611   return true;
00612 }
00613 
00614 
00615 bool
00616 Anaphe::AIDA_Tuple_native::AIDA_Tuple::project( AIDA::IHistogram1D& histogram,
00617                                                 AIDA::IEvaluator& evaluatorX,
00618                                                 AIDA::IFilter& filter )
00619 {
00620   m_store->clearBindings( m_header );
00621   if ( ! evaluatorX.initialize( *this ) ) return false;
00622   if ( ! filter.initialize( *this ) ) return false;
00623   const int numberOfRows = m_header.numberOfRows();
00624   for ( int iRow = 0; iRow < numberOfRows; ++iRow ) {
00625     m_header.setCurrentRowNumber( iRow );
00626     m_store->readTupleRow( m_header );
00627     if ( filter.accept() ) histogram.fill( evaluatorX.evaluateDouble() );
00628   }
00629   return true;
00630 }
00631 
00632 
00633 bool
00634 Anaphe::AIDA_Tuple_native::AIDA_Tuple::project( AIDA::IHistogram1D& histogram,
00635                                                 AIDA::IEvaluator& evaluatorX,
00636                                                 AIDA::IEvaluator& weight )
00637 {
00638   m_store->clearBindings( m_header );
00639   if ( ! evaluatorX.initialize( *this ) ) return false;
00640   if ( ! weight.initialize( *this ) ) return false;
00641   const int numberOfRows = m_header.numberOfRows();
00642   for ( int iRow = 0; iRow < numberOfRows; ++iRow ) {
00643     m_header.setCurrentRowNumber( iRow );
00644     m_store->readTupleRow( m_header );
00645     histogram.fill( evaluatorX.evaluateDouble(), weight.evaluateDouble() );
00646   }
00647   return true;
00648 }
00649 
00650 
00651 bool
00652 Anaphe::AIDA_Tuple_native::AIDA_Tuple::project( AIDA::IHistogram1D& histogram,
00653                                                 AIDA::IEvaluator& evaluatorX,
00654                                                 AIDA::IFilter& filter,
00655                                                 AIDA::IEvaluator& weight )
00656 {
00657   m_store->clearBindings( m_header );
00658   if ( ! evaluatorX.initialize( *this ) ) return false;
00659   if ( ! filter.initialize( *this ) ) return false;
00660   if ( ! weight.initialize( *this ) ) return false;
00661   const int numberOfRows = m_header.numberOfRows();
00662   for ( int iRow = 0; iRow < numberOfRows; ++iRow ) {
00663     m_header.setCurrentRowNumber( iRow );
00664     m_store->readTupleRow( m_header );
00665     if ( filter.accept() ) histogram.fill( evaluatorX.evaluateDouble(), weight.evaluateDouble() );
00666   }
00667   return true;
00668 }
00669 
00670 
00671 bool
00672 Anaphe::AIDA_Tuple_native::AIDA_Tuple::project( AIDA::IHistogram2D& histogram,
00673                                                 AIDA::IEvaluator& evaluatorX,
00674                                                 AIDA::IEvaluator& evaluatorY )
00675 {
00676   m_store->clearBindings( m_header );
00677   if ( ! evaluatorX.initialize( *this ) ) return false;
00678   if ( ! evaluatorY.initialize( *this ) ) return false;
00679   const int numberOfRows = m_header.numberOfRows();
00680   for ( int iRow = 0; iRow < numberOfRows; ++iRow ) {
00681     m_header.setCurrentRowNumber( iRow );
00682     m_store->readTupleRow( m_header );
00683     histogram.fill( evaluatorX.evaluateDouble(), evaluatorY.evaluateDouble() );
00684   }
00685   return true;
00686 }
00687 
00688 
00689 bool
00690 Anaphe::AIDA_Tuple_native::AIDA_Tuple::project( AIDA::IHistogram2D& histogram,
00691                                                 AIDA::IEvaluator& evaluatorX,
00692                                                 AIDA::IEvaluator& evaluatorY,
00693                                                 AIDA::IFilter& filter )
00694 {
00695   m_store->clearBindings( m_header );
00696   if ( ! evaluatorX.initialize( *this ) ) return false;
00697   if ( ! evaluatorY.initialize( *this ) ) return false;
00698   filter.initialize( *this );
00699   const int numberOfRows = m_header.numberOfRows();
00700   for ( int iRow = 0; iRow < numberOfRows; ++iRow ) {
00701     m_header.setCurrentRowNumber( iRow );
00702     m_store->readTupleRow( m_header );
00703     if ( filter.accept() ) histogram.fill( evaluatorX.evaluateDouble(), evaluatorY.evaluateDouble() );
00704   }
00705   return true;
00706 }
00707 
00708 
00709 bool
00710 Anaphe::AIDA_Tuple_native::AIDA_Tuple::project( AIDA::IHistogram2D& histogram,
00711                                                 AIDA::IEvaluator& evaluatorX,
00712                                                 AIDA::IEvaluator& evaluatorY,
00713                                                 AIDA::IEvaluator& weight )
00714 {
00715   m_store->clearBindings( m_header );
00716   if ( ! evaluatorX.initialize( *this ) ) return false;
00717   if ( ! evaluatorY.initialize( *this ) ) return false;
00718   if ( ! weight.initialize( *this ) ) return false;
00719   const int numberOfRows = m_header.numberOfRows();
00720   for ( int iRow = 0; iRow < numberOfRows; ++iRow ) {
00721     m_header.setCurrentRowNumber( iRow );
00722     m_store->readTupleRow( m_header );
00723     histogram.fill( evaluatorX.evaluateDouble(), evaluatorY.evaluateDouble(), weight.evaluateDouble() );
00724   }
00725   return true;
00726 }
00727 
00728 
00729 bool
00730 Anaphe::AIDA_Tuple_native::AIDA_Tuple::project( AIDA::IHistogram2D& histogram,
00731                                                 AIDA::IEvaluator& evaluatorX,
00732                                                 AIDA::IEvaluator& evaluatorY,
00733                                                 AIDA::IFilter& filter,
00734                                                 AIDA::IEvaluator& weight )
00735 {
00736   m_store->clearBindings( m_header );
00737   if ( ! evaluatorX.initialize( *this ) ) return false;
00738   if ( ! evaluatorY.initialize( *this ) ) return false;
00739   if ( ! filter.initialize( *this ) ) return false;
00740   if ( ! weight.initialize( *this ) ) return false;
00741   const int numberOfRows = m_header.numberOfRows();
00742   for ( int iRow = 0; iRow < numberOfRows; ++iRow ) {
00743     m_header.setCurrentRowNumber( iRow );
00744     m_store->readTupleRow( m_header );
00745     if ( filter.accept() ) histogram.fill( evaluatorX.evaluateDouble(), evaluatorY.evaluateDouble(), weight.evaluateDouble() );
00746   }
00747   return true;
00748 }
00749 
00750 
00751 bool
00752 Anaphe::AIDA_Tuple_native::AIDA_Tuple::project( AIDA::IHistogram3D& histogram,
00753                                                 AIDA::IEvaluator& evaluatorX,
00754                                                 AIDA::IEvaluator& evaluatorY,
00755                                                 AIDA::IEvaluator& evaluatorZ )
00756 {
00757   m_store->clearBindings( m_header );
00758   if ( ! evaluatorX.initialize( *this ) ) return false;
00759   if ( ! evaluatorY.initialize( *this ) ) return false;
00760   if ( ! evaluatorZ.initialize( *this ) ) return false;
00761   const int numberOfRows = m_header.numberOfRows();
00762   for ( int iRow = 0; iRow < numberOfRows; ++iRow ) {
00763     m_header.setCurrentRowNumber( iRow );
00764     m_store->readTupleRow( m_header );
00765     histogram.fill( evaluatorX.evaluateDouble(), evaluatorY.evaluateDouble(), evaluatorZ.evaluateDouble() );
00766   }
00767   return true;
00768 }
00769 
00770 
00771 bool
00772 Anaphe::AIDA_Tuple_native::AIDA_Tuple::project( AIDA::IHistogram3D& histogram,
00773                                                 AIDA::IEvaluator& evaluatorX,
00774                                                 AIDA::IEvaluator& evaluatorY,
00775                                                 AIDA::IEvaluator& evaluatorZ,
00776                                                 AIDA::IFilter& filter )
00777 {
00778   m_store->clearBindings( m_header );
00779   if ( ! evaluatorX.initialize( *this ) ) return false;
00780   if ( ! evaluatorY.initialize( *this ) ) return false;
00781   if ( ! evaluatorZ.initialize( *this ) ) return false;
00782   if ( ! filter.initialize( *this ) ) return false;
00783   const int numberOfRows = m_header.numberOfRows();
00784   for ( int iRow = 0; iRow < numberOfRows; ++iRow ) {
00785     m_header.setCurrentRowNumber( iRow );
00786     m_store->readTupleRow( m_header );
00787     if ( filter.accept() ) histogram.fill( evaluatorX.evaluateDouble(), evaluatorY.evaluateDouble(), evaluatorZ.evaluateDouble() );
00788   }
00789   return true;
00790 }
00791 
00792 
00793 bool
00794 Anaphe::AIDA_Tuple_native::AIDA_Tuple::project( AIDA::IHistogram3D& histogram,
00795                                                 AIDA::IEvaluator& evaluatorX,
00796                                                 AIDA::IEvaluator& evaluatorY,
00797                                                 AIDA::IEvaluator& evaluatorZ,
00798                                                 AIDA::IEvaluator& weight )
00799 {
00800   m_store->clearBindings( m_header );
00801   if ( ! evaluatorX.initialize( *this ) ) return false;
00802   if ( ! evaluatorY.initialize( *this ) ) return false;
00803   if ( ! evaluatorZ.initialize( *this ) ) return false;
00804   if ( ! weight.initialize( *this ) ) return false;
00805   const int numberOfRows = m_header.numberOfRows();
00806   for ( int iRow = 0; iRow < numberOfRows; ++iRow ) {
00807     m_header.setCurrentRowNumber( iRow );
00808     m_store->readTupleRow( m_header );
00809     histogram.fill( evaluatorX.evaluateDouble(), evaluatorY.evaluateDouble(), evaluatorZ.evaluateDouble(), weight.evaluateDouble() );
00810   }
00811   return true;
00812 }
00813 
00814 
00815 bool
00816 Anaphe::AIDA_Tuple_native::AIDA_Tuple::project( AIDA::IHistogram3D& histogram,
00817                                                 AIDA::IEvaluator& evaluatorX,
00818                                                 AIDA::IEvaluator& evaluatorY,
00819                                                 AIDA::IEvaluator& evaluatorZ,
00820                                                 AIDA::IFilter& filter,
00821                                                 AIDA::IEvaluator& weight )
00822 {
00823   m_store->clearBindings( m_header );
00824   if ( ! evaluatorX.initialize( *this ) ) return false;
00825   if ( ! evaluatorY.initialize( *this ) ) return false;
00826   if ( ! evaluatorZ.initialize( *this ) ) return false;
00827   if ( ! weight.initialize( *this ) ) return false;
00828   if ( ! filter.initialize( *this ) ) return false;
00829   const int numberOfRows = m_header.numberOfRows();
00830   for ( int iRow = 0; iRow < numberOfRows; ++iRow ) {
00831     m_header.setCurrentRowNumber( iRow );
00832     m_store->readTupleRow( m_header );
00833     if ( filter.accept() ) histogram.fill( evaluatorX.evaluateDouble(), evaluatorY.evaluateDouble(), evaluatorZ.evaluateDouble(), weight.evaluateDouble() );
00834   }
00835   return true;
00836 }
00837 
00838 
00839 bool
00840 Anaphe::AIDA_Tuple_native::AIDA_Tuple::project( AIDA::ICloud1D& cloud,
00841                                                 AIDA::IEvaluator& evaluatorX )
00842 {
00843   m_store->clearBindings( m_header );
00844   if ( ! evaluatorX.initialize( *this ) ) return false;
00845   const int numberOfRows = m_header.numberOfRows();
00846   for ( int iRow = 0; iRow < numberOfRows; ++iRow ) {
00847     m_header.setCurrentRowNumber( iRow );
00848     m_store->readTupleRow( m_header );
00849     cloud.fill( evaluatorX.evaluateDouble() );
00850   }
00851   return true;
00852 }
00853 
00854 
00855 bool
00856 Anaphe::AIDA_Tuple_native::AIDA_Tuple::project( AIDA::ICloud1D& cloud,
00857                                                 AIDA::IEvaluator& evaluatorX,
00858                                                 AIDA::IFilter& filter )
00859 {
00860   m_store->clearBindings( m_header );
00861   if ( ! evaluatorX.initialize( *this ) ) return false;
00862   if ( ! filter.initialize( *this ) ) return false;
00863   const int numberOfRows = m_header.numberOfRows();
00864   for ( int iRow = 0; iRow < numberOfRows; ++iRow ) {
00865     m_header.setCurrentRowNumber( iRow );
00866     m_store->readTupleRow( m_header );
00867     if ( filter.accept() ) cloud.fill( evaluatorX.evaluateDouble() );
00868   }
00869   return true;
00870 }
00871 
00872 
00873 bool
00874 Anaphe::AIDA_Tuple_native::AIDA_Tuple::project( AIDA::ICloud1D& cloud,
00875                                                 AIDA::IEvaluator& evaluatorX,
00876                                                 AIDA::IEvaluator& weight )
00877 {
00878   m_store->clearBindings( m_header );
00879   if ( ! evaluatorX.initialize( *this ) ) return false;
00880   if ( ! weight.initialize( *this ) ) return false;
00881   const int numberOfRows = m_header.numberOfRows();
00882   for ( int iRow = 0; iRow < numberOfRows; ++iRow ) {
00883     m_header.setCurrentRowNumber( iRow );
00884     m_store->readTupleRow( m_header );
00885     cloud.fill( evaluatorX.evaluateDouble(), weight.evaluateDouble() );
00886   }
00887   return true;
00888 }
00889 
00890 
00891 bool
00892 Anaphe::AIDA_Tuple_native::AIDA_Tuple::project( AIDA::ICloud1D& cloud,
00893                                                 AIDA::IEvaluator& evaluatorX,
00894                                                 AIDA::IFilter& filter,
00895                                                 AIDA::IEvaluator& weight )
00896 {
00897   m_store->clearBindings( m_header );
00898   if ( ! evaluatorX.initialize( *this ) ) return false;
00899   if ( ! filter.initialize( *this ) ) return false;
00900   if ( ! weight.initialize( *this ) ) return false;
00901   const int numberOfRows = m_header.numberOfRows();
00902   for ( int iRow = 0; iRow < numberOfRows; ++iRow ) {
00903     m_header.setCurrentRowNumber( iRow );
00904     m_store->readTupleRow( m_header );
00905     if ( filter.accept() ) cloud.fill( evaluatorX.evaluateDouble(), weight.evaluateDouble() );
00906   }
00907   return true;
00908 }
00909 
00910 
00911 bool
00912 Anaphe::AIDA_Tuple_native::AIDA_Tuple::project( AIDA::ICloud2D& cloud,
00913                                                 AIDA::IEvaluator& evaluatorX,
00914                                                 AIDA::IEvaluator& evaluatorY )
00915 {
00916   m_store->clearBindings( m_header );
00917   if ( ! evaluatorX.initialize( *this ) ) return false;
00918   if ( ! evaluatorY.initialize( *this ) ) return false;
00919   const int numberOfRows = m_header.numberOfRows();
00920   for ( int iRow = 0; iRow < numberOfRows; ++iRow ) {
00921     m_header.setCurrentRowNumber( iRow );
00922     m_store->readTupleRow( m_header );
00923     cloud.fill( evaluatorX.evaluateDouble(), evaluatorY.evaluateDouble() );
00924   }
00925   return true;
00926 }
00927 
00928 
00929 bool
00930 Anaphe::AIDA_Tuple_native::AIDA_Tuple::project( AIDA::ICloud2D& cloud,
00931                                                 AIDA::IEvaluator& evaluatorX,
00932                                                 AIDA::IEvaluator& evaluatorY,
00933                                                 AIDA::IFilter& filter )
00934 {
00935   m_store->clearBindings( m_header );
00936   if ( ! evaluatorX.initialize( *this ) ) return false;
00937   if ( ! evaluatorY.initialize( *this ) ) return false;
00938   if ( ! filter.initialize( *this ) ) return false;
00939   const int numberOfRows = m_header.numberOfRows();
00940   for ( int iRow = 0; iRow < numberOfRows; ++iRow ) {
00941     m_header.setCurrentRowNumber( iRow );
00942     m_store->readTupleRow( m_header );
00943     if ( filter.accept() ) cloud.fill( evaluatorX.evaluateDouble(), evaluatorY.evaluateDouble() );
00944   }
00945   return true;
00946 }
00947 
00948 
00949 bool
00950 Anaphe::AIDA_Tuple_native::AIDA_Tuple::project( AIDA::ICloud2D& cloud,
00951                                                 AIDA::IEvaluator& evaluatorX,
00952                                                 AIDA::IEvaluator& evaluatorY,
00953                                                 AIDA::IEvaluator& weight )
00954 {
00955   m_store->clearBindings( m_header );
00956   if ( ! evaluatorX.initialize( *this ) ) return false;
00957   if ( ! evaluatorY.initialize( *this ) ) return false;
00958   if ( ! weight.initialize( *this ) ) return false;
00959   const int numberOfRows = m_header.numberOfRows();
00960   for ( int iRow = 0; iRow < numberOfRows; ++iRow ) {
00961     m_header.setCurrentRowNumber( iRow );
00962     m_store->readTupleRow( m_header );
00963     cloud.fill( evaluatorX.evaluateDouble(), evaluatorY.evaluateDouble(), weight.evaluateDouble() );
00964   }
00965   return true;
00966 }
00967 
00968 
00969 bool
00970 Anaphe::AIDA_Tuple_native::AIDA_Tuple::project( AIDA::ICloud2D& cloud,
00971                                                 AIDA::IEvaluator& evaluatorX,
00972                                                 AIDA::IEvaluator& evaluatorY,
00973                                                 AIDA::IFilter& filter,
00974                                                 AIDA::IEvaluator& weight )
00975 {
00976   m_store->clearBindings( m_header );
00977   if ( ! evaluatorX.initialize( *this ) ) return false;
00978   if ( ! evaluatorY.initialize( *this ) ) return false;
00979   if ( ! filter.initialize( *this ) ) return false;
00980   if ( ! weight.initialize( *this ) ) return false;
00981   const int numberOfRows = m_header.numberOfRows();
00982   for ( int iRow = 0; iRow < numberOfRows; ++iRow ) {
00983     m_header.setCurrentRowNumber( iRow );
00984     m_store->readTupleRow( m_header );
00985     if ( filter.accept() ) cloud.fill( evaluatorX.evaluateDouble(), evaluatorY.evaluateDouble(), weight.evaluateDouble() );
00986   }
00987   return true;
00988 }
00989 
00990 
00991 bool
00992 Anaphe::AIDA_Tuple_native::AIDA_Tuple::project( AIDA::ICloud3D& cloud,
00993                                                 AIDA::IEvaluator& evaluatorX,
00994                                                 AIDA::IEvaluator& evaluatorY,
00995                                                 AIDA::IEvaluator& evaluatorZ )
00996 {
00997   m_store->clearBindings( m_header );
00998   if ( ! evaluatorX.initialize( *this ) ) return false;
00999   if ( ! evaluatorY.initialize( *this ) ) return false;
01000   if ( ! evaluatorZ.initialize( *this ) ) return false;
01001   const int numberOfRows = m_header.numberOfRows();
01002   for ( int iRow = 0; iRow < numberOfRows; ++iRow ) {
01003     m_header.setCurrentRowNumber( iRow );
01004     m_store->readTupleRow( m_header );
01005     cloud.fill( evaluatorX.evaluateDouble(), evaluatorY.evaluateDouble(), evaluatorZ.evaluateDouble() );
01006   }
01007   return true;
01008 }
01009 
01010 
01011 bool
01012 Anaphe::AIDA_Tuple_native::AIDA_Tuple::project( AIDA::ICloud3D& cloud,
01013                                                 AIDA::IEvaluator& evaluatorX,
01014                                                 AIDA::IEvaluator& evaluatorY,
01015                                                 AIDA::IEvaluator& evaluatorZ,
01016                                                 AIDA::IFilter& filter )
01017 {
01018   m_store->clearBindings( m_header );
01019   if ( ! evaluatorX.initialize( *this ) ) return false;
01020   if ( ! evaluatorY.initialize( *this ) ) return false;
01021   if ( ! evaluatorZ.initialize( *this ) ) return false;
01022   if ( ! filter.initialize( *this ) ) return false;
01023   const int numberOfRows = m_header.numberOfRows();
01024   for ( int iRow = 0; iRow < numberOfRows; ++iRow ) {
01025     m_header.setCurrentRowNumber( iRow );
01026     m_store->readTupleRow( m_header );
01027     if ( filter.accept() ) cloud.fill( evaluatorX.evaluateDouble(), evaluatorY.evaluateDouble(), evaluatorZ.evaluateDouble() );
01028   }
01029   return true;
01030 }
01031 
01032 
01033 bool
01034 Anaphe::AIDA_Tuple_native::AIDA_Tuple::project( AIDA::ICloud3D& cloud,
01035                                                 AIDA::IEvaluator& evaluatorX,
01036                                                 AIDA::IEvaluator& evaluatorY,
01037                                                 AIDA::IEvaluator& evaluatorZ,
01038                                                 AIDA::IEvaluator& weight )
01039 {
01040   m_store->clearBindings( m_header );
01041   if ( ! evaluatorX.initialize( *this ) ) return false;
01042   if ( ! evaluatorY.initialize( *this ) ) return false;
01043   if ( ! evaluatorZ.initialize( *this ) ) return false;
01044   if ( ! weight.initialize( *this ) ) return false;
01045   const int numberOfRows = m_header.numberOfRows();
01046   for ( int iRow = 0; iRow < numberOfRows; ++iRow ) {
01047     m_header.setCurrentRowNumber( iRow );
01048     m_store->readTupleRow( m_header );
01049     cloud.fill( evaluatorX.evaluateDouble(), evaluatorY.evaluateDouble(), evaluatorZ.evaluateDouble(), weight.evaluateDouble() );
01050   }
01051   return true;
01052 }
01053 
01054 
01055 bool
01056 Anaphe::AIDA_Tuple_native::AIDA_Tuple::project( AIDA::ICloud3D& cloud,
01057                                                 AIDA::IEvaluator& evaluatorX,
01058                                                 AIDA::IEvaluator& evaluatorY,
01059                                                 AIDA::IEvaluator& evaluatorZ,
01060                                                 AIDA::IFilter& filter,
01061                                                 AIDA::IEvaluator& weight )
01062 {
01063   m_store->clearBindings( m_header );
01064   if ( ! evaluatorX.initialize( *this ) ) return false;
01065   if ( ! evaluatorY.initialize( *this ) ) return false;
01066   if ( ! evaluatorZ.initialize( *this ) ) return false;
01067   if ( ! weight.initialize( *this ) ) return false;
01068   if ( ! filter.initialize( *this ) ) return false;
01069   const int numberOfRows = m_header.numberOfRows();
01070   for ( int iRow = 0; iRow < numberOfRows; ++iRow ) {
01071     m_header.setCurrentRowNumber( iRow );
01072     m_store->readTupleRow( m_header );
01073     if ( filter.accept() ) cloud.fill( evaluatorX.evaluateDouble(), evaluatorY.evaluateDouble(), evaluatorZ.evaluateDouble(), weight.evaluateDouble() );
01074   }
01075   return true;
01076 }
01077 
01078 
01079 bool
01080 Anaphe::AIDA_Tuple_native::AIDA_Tuple::project( AIDA::IProfile1D& profile,
01081                                                 AIDA::IEvaluator& evaluatorX,
01082                                                 AIDA::IEvaluator& evaluatorY )
01083 {
01084   m_store->clearBindings( m_header );
01085   if ( ! evaluatorX.initialize( *this ) ) return false;
01086   if ( ! evaluatorY.initialize( *this ) ) return false;
01087   const int numberOfRows = m_header.numberOfRows();
01088   for ( int iRow = 0; iRow < numberOfRows; ++iRow ) {
01089     m_header.setCurrentRowNumber( iRow );
01090     m_store->readTupleRow( m_header );
01091     profile.fill( evaluatorX.evaluateDouble(), evaluatorY.evaluateDouble() );
01092   }
01093   return true;
01094 }
01095 
01096 
01097 bool
01098 Anaphe::AIDA_Tuple_native::AIDA_Tuple::project( AIDA::IProfile1D& profile,
01099                                                 AIDA::IEvaluator& evaluatorX,
01100                                                 AIDA::IEvaluator& evaluatorY,
01101                                                 AIDA::IFilter& filter )
01102 {
01103   m_store->clearBindings( m_header );
01104   if ( ! evaluatorX.initialize( *this ) ) return false;
01105   if ( ! evaluatorY.initialize( *this ) ) return false;
01106   if ( ! filter.initialize( *this ) ) return false;
01107   const int numberOfRows = m_header.numberOfRows();
01108   for ( int iRow = 0; iRow < numberOfRows; ++iRow ) {
01109     m_header.setCurrentRowNumber( iRow );
01110     m_store->readTupleRow( m_header );
01111     if ( filter.accept() ) profile.fill( evaluatorX.evaluateDouble(), evaluatorY.evaluateDouble() );
01112   }
01113   return true;
01114 }
01115 
01116 
01117 bool
01118 Anaphe::AIDA_Tuple_native::AIDA_Tuple::project( AIDA::IProfile1D& profile,
01119                                                 AIDA::IEvaluator& evaluatorX,
01120                                                 AIDA::IEvaluator& evaluatorY,
01121                                                 AIDA::IEvaluator& weight )
01122 {
01123   m_store->clearBindings( m_header );
01124   if ( ! evaluatorX.initialize( *this ) ) return false;
01125   if ( ! evaluatorY.initialize( *this ) ) return false;
01126   if ( ! weight.initialize( *this ) ) return false;
01127   const int numberOfRows = m_header.numberOfRows();
01128   for ( int iRow = 0; iRow < numberOfRows; ++iRow ) {
01129     m_header.setCurrentRowNumber( iRow );
01130     m_store->readTupleRow( m_header );
01131     profile.fill( evaluatorX.evaluateDouble(), evaluatorY.evaluateDouble(), weight.evaluateDouble() );
01132   }
01133   return true;
01134 }
01135 
01136 
01137 bool
01138 Anaphe::AIDA_Tuple_native::AIDA_Tuple::project( AIDA::IProfile1D& profile,
01139                                                 AIDA::IEvaluator& evaluatorX,
01140                                                 AIDA::IEvaluator& evaluatorY,
01141                                                 AIDA::IFilter& filter,
01142                                                 AIDA::IEvaluator& weight )
01143 {
01144   m_store->clearBindings( m_header );
01145   if ( ! evaluatorX.initialize( *this ) ) return false;
01146   if ( ! evaluatorY.initialize( *this ) ) return false;
01147   if ( ! filter.initialize( *this ) ) return false;
01148   if ( ! weight.initialize( *this ) ) return false;
01149   const int numberOfRows = m_header.numberOfRows();
01150   for ( int iRow = 0; iRow < numberOfRows; ++iRow ) {
01151     m_header.setCurrentRowNumber( iRow );
01152     m_store->readTupleRow( m_header );
01153     if ( filter.accept() ) profile.fill( evaluatorX.evaluateDouble(), evaluatorY.evaluateDouble(), weight.evaluateDouble() );
01154   }
01155   return true;
01156 }
01157 
01158 
01159 bool
01160 Anaphe::AIDA_Tuple_native::AIDA_Tuple::project( AIDA::IProfile2D& profile,
01161                                                 AIDA::IEvaluator& evaluatorX,
01162                                                 AIDA::IEvaluator& evaluatorY,
01163                                                 AIDA::IEvaluator& evaluatorZ )
01164 {
01165   m_store->clearBindings( m_header );
01166   if ( ! evaluatorX.initialize( *this ) ) return false;
01167   if ( ! evaluatorY.initialize( *this ) ) return false;
01168   if ( ! evaluatorZ.initialize( *this ) ) return false;
01169   const int numberOfRows = m_header.numberOfRows();
01170   for ( int iRow = 0; iRow < numberOfRows; ++iRow ) {
01171     m_header.setCurrentRowNumber( iRow );
01172     m_store->readTupleRow( m_header );
01173     profile.fill( evaluatorX.evaluateDouble(), evaluatorY.evaluateDouble(), evaluatorZ.evaluateDouble() );
01174   }
01175   return true;
01176 }
01177 
01178 
01179 bool
01180 Anaphe::AIDA_Tuple_native::AIDA_Tuple::project( AIDA::IProfile2D& profile,
01181                                                 AIDA::IEvaluator& evaluatorX,
01182                                                 AIDA::IEvaluator& evaluatorY,
01183                                                 AIDA::IEvaluator& evaluatorZ,
01184                                                 AIDA::IFilter& filter )
01185 {
01186   m_store->clearBindings( m_header );
01187   if ( ! evaluatorX.initialize( *this ) ) return false;
01188   if ( ! evaluatorY.initialize( *this ) ) return false;
01189   if ( ! evaluatorZ.initialize( *this ) ) return false;
01190   if ( ! filter.initialize( *this ) ) return false;
01191   const int numberOfRows = m_header.numberOfRows();
01192   for ( int iRow = 0; iRow < numberOfRows; ++iRow ) {
01193     m_header.setCurrentRowNumber( iRow );
01194     m_store->readTupleRow( m_header );
01195     if ( filter.accept() ) profile.fill( evaluatorX.evaluateDouble(), evaluatorY.evaluateDouble(), evaluatorZ.evaluateDouble() );
01196   }
01197   return true;
01198 }
01199 
01200 
01201 bool
01202 Anaphe::AIDA_Tuple_native::AIDA_Tuple::project( AIDA::IProfile2D& profile,
01203                                                 AIDA::IEvaluator& evaluatorX,
01204                                                 AIDA::IEvaluator& evaluatorY,
01205                                                 AIDA::IEvaluator& evaluatorZ,
01206                                                 AIDA::IEvaluator& weight )
01207 {
01208   m_store->clearBindings( m_header );
01209   if ( ! evaluatorX.initialize( *this ) ) return false;
01210   if ( ! evaluatorY.initialize( *this ) ) return false;
01211   if ( ! evaluatorZ.initialize( *this ) ) return false;
01212   if ( ! weight.initialize( *this ) ) return false;
01213   const int numberOfRows = m_header.numberOfRows();
01214   for ( int iRow = 0; iRow < numberOfRows; ++iRow ) {
01215     m_header.setCurrentRowNumber( iRow );
01216     m_store->readTupleRow( m_header );
01217     profile.fill( evaluatorX.evaluateDouble(), evaluatorY.evaluateDouble(), evaluatorZ.evaluateDouble(), weight.evaluateDouble() );
01218   }
01219   return true;
01220 }
01221 
01222 
01223 bool
01224 Anaphe::AIDA_Tuple_native::AIDA_Tuple::project( AIDA::IProfile2D& profile,
01225                                                 AIDA::IEvaluator& evaluatorX,
01226                                                 AIDA::IEvaluator& evaluatorY,
01227                                                 AIDA::IEvaluator& evaluatorZ,
01228                                                 AIDA::IFilter& filter,
01229                                                 AIDA::IEvaluator& weight )
01230 {
01231   m_store->clearBindings( m_header );
01232   if ( ! evaluatorX.initialize( *this ) ) return false;
01233   if ( ! evaluatorY.initialize( *this ) ) return false;
01234   if ( ! evaluatorZ.initialize( *this ) ) return false;
01235   if ( ! weight.initialize( *this ) ) return false;
01236   if ( ! filter.initialize( *this ) ) return false;
01237   const int numberOfRows = m_header.numberOfRows();
01238   for ( int iRow = 0; iRow < numberOfRows; ++iRow ) {
01239     m_header.setCurrentRowNumber( iRow );
01240     m_store->readTupleRow( m_header );
01241     if ( filter.accept() ) profile.fill( evaluatorX.evaluateDouble(), evaluatorY.evaluateDouble(), evaluatorZ.evaluateDouble(), weight.evaluateDouble() );
01242   }
01243   return true;
01244 }

Generated on Tue Feb 18 17:51:19 2003 for AIDA_Tuple_native by doxygen1.2.16