Home || Architecture || Video Search || Visual Search || Scripts || Applications || Important Messages || OGL || Src

NgbIntegral.h

Go to the documentation of this file.
00001 #ifndef Impala_Core_Histogram_NgbIntegral_h
00002 #define Impala_Core_Histogram_NgbIntegral_h
00003 
00004 #include "Core/Array/Pattern/Categories.h"
00005 #include "Core/Array/Pattern/Cnum.h"
00006 #include "Core/Array/Element/E1Cast.h"
00007 
00008 namespace Impala
00009 {
00010 namespace Core
00011 {
00012 namespace Array
00013 {
00014 namespace Trait
00015 {
00016 
00017 
00031 class NgbIntegral
00032 {
00033 public:
00034 
00036     typedef Array::Pattern::TagLoop IteratorCategory;
00037 
00039     typedef Array::Pattern::Tag1Phase PhaseCategory;
00040 
00041     //typedef typename ArrayT::StorType StorType;
00042     //typedef typename ArrayT::ArithType ArithType;
00043 
00045     NgbIntegral()
00046     {
00047     }
00048 
00050     ~NgbIntegral()
00051     {
00052     }
00053 
00055     int
00056     Width()
00057     {
00058         return 2;
00059     }
00060 
00062     int
00063     Height()
00064     {
00065         return 2;
00066     }
00067 
00069     void
00070     Init(int x, int y, const double& value)
00071     {
00072         //ILOG_DEBUG("Init called: (" <<x<< "," <<y<< ") value = " << value);
00073         mValue = 0;
00074     }
00075 
00077     void
00078     NextEl(int m, int n, const double& value)
00079     {
00080         //ILOG_DEBUG("NextEl called: (m,n)=(" <<m<< "," <<n<< ") value = " <<
00081         //           value);
00082         if(m==0 && n==0)
00083             mValue -= value;
00084         else
00085             mValue += value;
00086     }
00087 
00089     double
00090     Result() const
00091     {
00092         //ILOG_DEBUG("returned value = " << mValue);
00093         return mValue;
00094     }
00095 
00096 private:
00097     double mValue;
00098     ILOG_VAR_DEC;
00099 };
00100 
00101 ILOG_VAR_INIT(NgbIntegral, Impala.Core.Array.Trait);
00102 
00103 
00104 } // namespace Trait
00105 } // namespace Array
00106 } // namespace Core
00107 } // namespace Impala
00108 
00109 #endif

Generated on Fri Mar 19 09:30:59 2010 for ImpalaSrc by  doxygen 1.5.1