Anaphe Home Page Reference Documentation

Main Page     Namespaces     Classes     Source Code    

P_I_Histo_2D.ddl

Go to the documentation of this file.
00001 #ifndef _H_P__I_HISTO_2D_H_
00002 
00003 #if 1
00004         //
00005         // Persistent case.
00006         //
00007         #define _H_P__I_HISTO_2D_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_2D_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 P_I_Histo_2D: public P_I_Histo
00023 {
00024 public:
00026   H_IID_IMPLEMENT( P_I_Histo_2D );
00027 public:
00028   typedef P_I_Histo_2D  Like_Current;
00029   typedef H_P__REF(I_Histo_2D)  Ref_Like_Current;
00030 protected:
00031   P_I_Histo_2D(): P_I_Histo() {}
00033   virtual ~P_I_Histo_2D() {}
00034 public:
00036   virtual Size dim() const { return 2; }
00037 
00038 public:
00042   Ref_Like_Current clone( int copy_data = 1 )
00043     {
00044       H_P__REF(I_Histo) h = (const H_P__REF(I_Histo) &)
00045         clone_( copy_data );
00046       return R_CAST( Ref_Like_Current & )(h);
00047     }
00048 
00050   Ref_Like_Current clone( H_P_CLUSTER1(a_place), int copy_data = 1 )
00051     {
00052       H_P__REF(I_Histo) h = (const H_P__REF(I_Histo) &)
00053         clone_( a_place, copy_data );
00054       return R_CAST(Ref_Like_Current &)(h);
00055     }
00056 
00057 public:
00060   Ref_Like_Current add( const Ref_Like_Current &other )
00061     {
00062       if(((Ref_Like_Current &) other)->dim() == dim()) {
00063         H_P__REF(I_Histo) h = (const H_P__REF(I_Histo) &)
00064           add1_( *( (Ref_Like_Current &) other ) );
00065         return R_CAST(Ref_Like_Current &)(h);
00066       } else {
00067         HTL_ERR("Dimension mismatch in add(..)");
00068         return other;
00069       }
00070     }
00071 
00073   void add( const I_Histo &other ) { add_( other ); }
00074 
00077   Ref_Like_Current sub( const Ref_Like_Current &other )
00078     {
00079       if(((Ref_Like_Current &) other)->dim() == dim()) {
00080         H_P__REF(I_Histo) h = (const H_P__REF(I_Histo) &)
00081           sub1_( *( (Ref_Like_Current &) other ) );
00082         return R_CAST(Ref_Like_Current &)(h);
00083       } else {
00084         HTL_ERR("Dimension mismatch in sub(..)");
00085         return other;
00086       }
00087     }
00088 
00090   void sub( const I_Histo &other ) { sub_( other ); }
00091 
00094   Ref_Like_Current mul( const Ref_Like_Current &other )
00095     {
00096       if(((Ref_Like_Current &) other)->dim() == dim()) {
00097         H_P__REF(I_Histo) h = (const H_P__REF(I_Histo) &)
00098           mul1_( *( (Ref_Like_Current &) other ) );
00099         return R_CAST(Ref_Like_Current &)(h);
00100       } else {
00101         HTL_ERR("Dimension mismatch in mul(..)");
00102         return other;
00103       }
00104     }
00105 
00107   void mul( const I_Histo &other ) { mul_( other ); }
00108 
00111   Ref_Like_Current div( const Ref_Like_Current &other )
00112     {
00113       if(((Ref_Like_Current &) other)->dim() == dim()) {
00114         H_P__REF(I_Histo) h = (const H_P__REF(I_Histo) &)
00115           div1_( *( (Ref_Like_Current &) other ) );
00116         return R_CAST(Ref_Like_Current &)(h);
00117       } else {
00118         HTL_ERR("Dimension mismatch in div(..)");
00119         return other;
00120       }
00121     }
00122 
00124   void div( const I_Histo &other ) { div_( other ); }
00125 
00128   Ref_Like_Current binomial_div( const Ref_Like_Current &other )
00129     {
00130       if(((Ref_Like_Current &) other)->dim() == dim()) {
00131         H_P__REF(I_Histo) h = (const H_P__REF(I_Histo) &)
00132           binomial_div1_( *( (Ref_Like_Current &) other ) );
00133         return R_CAST(Ref_Like_Current &)(h);
00134       } else {
00135         HTL_ERR("Dimension mismatch in binomial_div(..)");
00136         return other;
00137       }
00138     }
00139 
00141   void binomial_div( const I_Histo &other ) { binomial_div_( other ); }
00143         void add( double x ) { add_( x ); }
00145         void sub( double x ) { sub_( x ); }
00147         void mul( double x ) { mul_( x ); }
00149         void div( double x ) { div_( x ); }
00150 };
00151 
00152 #endif
00153 


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