Anaphe Home Page Reference Documentation

Main Page     Namespaces     Classes     Source Code    

T_I_Histo_1D.h

Go to the documentation of this file.
00001 #ifndef _H_T__I_HISTO_1D_H_
00002 
00003 #if 0
00004         //
00005         // Persistent case.
00006         //
00007         #define _H_P__I_HISTO_1D_H_ 1
00008         #include "HTL/P_I_Histo.h"
00009 #else
00010         //
00011         // Transient case.
00012         //
00013         #define _H_T__I_HISTO_1D_H_ 1
00014         #include "HTL/T_I_Histo.h"
00015 #endif
00016 
00017 #include "HTL/HTL_std.h"
00018 
00020 class T_I_Histo_1D
00021         : public T_I_Histo
00022 {
00023 public:
00025   H_IID_IMPLEMENT( T_I_Histo_1D );
00026   typedef T_I_Histo_1D Like_Current;
00027   typedef H_T__REF(I_Histo_1D)  Ref_Like_Current;
00028 protected:
00029   T_I_Histo_1D(): T_I_Histo() {}
00031   virtual ~T_I_Histo_1D() {}
00032 public:
00036   virtual Size extra_bin_count() const { return 3; }
00038   virtual Size dim() const { return 1; }
00040   virtual int version() const { return 0; }
00041 public:
00045   Ref_Like_Current clone( int copy_data = 1 )
00046     {
00047       H_T__REF(I_Histo) h = (const H_T__REF(I_Histo) &)
00048         clone_( copy_data );
00049       return R_CAST( Ref_Like_Current & )(h);
00050     }
00052   Ref_Like_Current clone( H_T_CLUSTER1(a_place), int copy_data = 1 )
00053     {
00054       H_T__REF(I_Histo) h = (const H_T__REF(I_Histo) &)
00055         clone_( a_place, copy_data );
00056       return R_CAST(Ref_Like_Current &)(h);
00057     }
00058 public:
00061   Ref_Like_Current add( const Ref_Like_Current &other )
00062     {
00063       if (((Ref_Like_Current &) other)->dim() == dim()) {
00064         H_T__REF(I_Histo) h = (const H_T__REF(I_Histo) &)
00065           add1_( *( (Ref_Like_Current &) other ) );
00066         return R_CAST(Ref_Like_Current &)(h);
00067       } else {
00068         HTL_ERR("Dimension mismatch in add(..)");
00069         return other;
00070       }
00071     }
00072 
00074   void add( const I_Histo &other ) { add_( other ); }
00075 
00078   Ref_Like_Current sub( const Ref_Like_Current &other )
00079     {
00080       if (((Ref_Like_Current &) other)->dim() == dim()) {
00081         H_T__REF(I_Histo) h = (const H_T__REF(I_Histo) &)
00082           sub1_( *( (Ref_Like_Current &) other ) );
00083         return R_CAST(Ref_Like_Current &)(h);
00084       } else {
00085         HTL_ERR("Dimension mismatch in sub(..)");
00086         return other;
00087       }
00088     }
00089 
00091   void sub( const I_Histo &other ) { sub_( other ); }
00092         
00095   Ref_Like_Current mul( const Ref_Like_Current &other )
00096     {
00097       if (((Ref_Like_Current &) other)->dim() == dim()) {
00098         H_T__REF(I_Histo) h = (const H_T__REF(I_Histo) &)
00099           mul1_( *( (Ref_Like_Current &) other ) );
00100         return R_CAST(Ref_Like_Current &)(h);
00101       } else {
00102         HTL_ERR("Dimension mismatch in mul(..)");
00103         return other;
00104       }
00105     }
00106 
00108         void mul( const I_Histo &other ) { mul_( other ); }
00109 
00112   Ref_Like_Current div( const Ref_Like_Current &other )
00113     {
00114       if (((Ref_Like_Current &) other)->dim() == dim()) {
00115         H_T__REF(I_Histo) h = (const H_T__REF(I_Histo) &)
00116           div1_( *( (Ref_Like_Current &) other ) );
00117         return R_CAST(Ref_Like_Current &)(h);
00118       } else {
00119         HTL_ERR("Dimension mismatch in div(..)");
00120         return other;
00121       }
00122     }
00123 
00125   void div( const I_Histo &other ) { div_( other ); }
00126 
00129   Ref_Like_Current binomial_div( const Ref_Like_Current &other )
00130     {
00131       if (((Ref_Like_Current &) other)->dim() == dim()) {
00132         H_T__REF(I_Histo) h = (const H_T__REF(I_Histo) &)
00133           binomial_div1_( *( (Ref_Like_Current &) other ) );
00134         return R_CAST(Ref_Like_Current &)(h);
00135       } else {
00136         HTL_ERR("Dimension mismatch in binomial_div(..)");
00137         return other;
00138       }
00139     }
00140 
00142   void binomial_div( const I_Histo &other ) { binomial_div_( other ); }
00144         void add( double x ) { add_( x ); }
00146         void sub( double x ) { sub_( x ); }
00148         void mul( double x ) { mul_( x ); }
00150         void div( double x ) { div_( x ); }
00151 };
00152 
00153 
00154 #endif
00155 


Anaphe documentation generated by Doxygen (www.doxygen.org)