Anaphe Home Page Reference Documentation

Main Page     Namespaces     Classes     Source Code    

T_I_Histo_3D.h

Go to the documentation of this file.
00001 #ifndef _H_T__I_HISTO_3D_H_
00002 
00003 #if 0
00004         //
00005         // Persistent case.
00006         //
00007         #define _H_P__I_HISTO_3D_H_ 1
00008         #include "HTL/P_macros.h"
00009         #include "HTL/P_I_Histo.h"
00010 #else
00011         //
00012         // Transient case.
00013         //
00014         #define _H_T__I_HISTO_3D_H_ 1
00015         #include "HTL/T_macros.h"
00016         #include "HTL/T_I_Histo.h"
00017 #endif
00018 
00019 #include "HTL/HTL_std.h"
00020 
00022 class T_I_Histo_3D: public T_I_Histo
00023 {
00024 public:
00026   H_IID_IMPLEMENT( T_I_Histo_3D );
00027 public:
00028   typedef T_I_Histo_3D  Like_Current;
00029   typedef H_T__REF(I_Histo_3D)  Ref_Like_Current;
00030 protected:
00031   T_I_Histo_3D(): T_I_Histo() {}
00033   virtual ~T_I_Histo_3D() {}
00034 public:
00038   virtual Size extra_bin_count() const { 
00039     Size xBins = i_partition(0).bin_count();
00040     Size yBins = i_partition(1).bin_count();
00041     Size zBins = i_partition(2).bin_count();
00042     return ((xBins+2)*(yBins+2)*(zBins+2) - xBins*yBins*zBins);
00043   }
00044 
00046   virtual Size dim() const { return 3; }
00047 
00048   virtual int version() const { return 0; }
00049 
00050 public:
00054   Ref_Like_Current clone( int copy_data = 1 )
00055     {
00056       H_T__REF(I_Histo) h = (const H_T__REF(I_Histo) &)
00057         clone_( copy_data );
00058       return R_CAST( Ref_Like_Current & )(h);
00059     }
00060 
00062   Ref_Like_Current clone( H_T_CLUSTER1(a_place), int copy_data = 1 )
00063     {
00064       H_T__REF(I_Histo) h = (const H_T__REF(I_Histo) &)
00065         clone_( a_place, copy_data );
00066       return R_CAST(Ref_Like_Current &)(h);
00067     }
00068 
00069 public:
00072   Ref_Like_Current add( const Ref_Like_Current &other )
00073     {
00074       if(((Ref_Like_Current &) other)->dim() == dim()) {
00075         H_T__REF(I_Histo) h = (const H_T__REF(I_Histo) &)
00076           add1_( *( (Ref_Like_Current &) other ) );
00077         return R_CAST(Ref_Like_Current &)(h);
00078       } else {
00079         HTL_ERR("Dimension mismatch in add(..)");
00080         return other;
00081       }
00082     }
00083 
00085   void add( const I_Histo &other ) { add_( other ); }
00086 
00089   Ref_Like_Current sub( const Ref_Like_Current &other )
00090     {
00091       if(((Ref_Like_Current &) other)->dim() == dim()) {
00092         H_T__REF(I_Histo) h = (const H_T__REF(I_Histo) &)
00093           sub1_( *( (Ref_Like_Current &) other ) );
00094         return R_CAST(Ref_Like_Current &)(h);
00095       } else {
00096         HTL_ERR("Dimension mismatch in sub(..)");
00097         return other;
00098       }
00099     }
00100 
00102   void sub( const I_Histo &other ) { sub_( other ); }
00103 
00106   Ref_Like_Current mul( const Ref_Like_Current &other )
00107     {
00108       if(((Ref_Like_Current &) other)->dim() == dim()) {
00109         H_T__REF(I_Histo) h = (const H_T__REF(I_Histo) &)
00110           mul1_( *( (Ref_Like_Current &) other ) );
00111         return R_CAST(Ref_Like_Current &)(h);
00112       } else {
00113         HTL_ERR("Dimension mismatch in mul(..)");
00114         return other;
00115       }
00116     }
00117 
00119   void mul( const I_Histo &other ) { mul_( other ); }
00120 
00123   Ref_Like_Current div( const Ref_Like_Current &other )
00124     {
00125       if(((Ref_Like_Current &) other)->dim() == dim()) {
00126         H_T__REF(I_Histo) h = (const H_T__REF(I_Histo) &)
00127           div1_( *( (Ref_Like_Current &) other ) );
00128         return R_CAST(Ref_Like_Current &)(h);
00129       } else {
00130         HTL_ERR("Dimension mismatch in div(..)");
00131         return other;
00132       }
00133     }
00134 
00136   void div( const I_Histo &other ) { div_( other ); }
00137 
00140   Ref_Like_Current binomial_div( const Ref_Like_Current &other )
00141     {
00142       if(((Ref_Like_Current &) other)->dim() == dim()) {
00143         H_T__REF(I_Histo) h = (const H_T__REF(I_Histo) &)
00144           binomial_div1_( *( (Ref_Like_Current &) other ) );
00145         return R_CAST(Ref_Like_Current &)(h);
00146       } else {
00147         HTL_ERR("Dimension mismatch in binomial_div(..)");
00148         return other;
00149       }
00150     }
00151 
00153   void binomial_div( const I_Histo &other ) { binomial_div_( other ); }
00155         void add( double x ) { add_( x ); }
00157         void sub( double x ) { sub_( x ); }
00159         void mul( double x ) { mul_( x ); }
00161         void div( double x ) { div_( x ); }
00162 };
00163 
00164 #endif
00165 
00166 
00167 
00168 
00169 
00170 
00171 
00172 
00173 


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