arrayutl.cpp

Go to the documentation of this file.
00001 #include "arraybse.h"
00002 #include "bnengine.h"
00003 //
00004 //********************************************************************************
00005 //                  UTILITY  MEMBER_FUNCTIONS
00006 //********************************************************************************
00007 //
00008 //
00009 // Routines return double. When adding multiple data types, I'll
00010 // need to promote the utilities to the derived classes so that
00011 // they can return the appropriate type.
00012 //
00013 double  CAMarrayBase::max() const
00014 {
00015 //
00016 //  Need Conversion Check
00017 //
00018     CAMarrayBase A;
00019     double* AdataP;
00020     long    n;
00021     double  value;
00022 
00023     if(A.Structure.isSubset() == 1)
00024     {
00025     A.initializeMinDuplicate(*this);
00026     AdataP = (double*)A.getDataPointer();
00027     n      = A.Structure.getFullDataCount();
00028     }
00029     else
00030     {
00031     AdataP = (double*)getDataPointer();
00032     n      = Structure.getFullDataCount();
00033     }
00034 
00035     CAMbinaryEngine::doubleMaxValue(AdataP, n, value);
00036     return value;
00037 }
00038 
00039 double  CAMarrayBase::min() const
00040 {
00041 //
00042 //  Need Conversion Check
00043 //
00044     CAMarrayBase A;
00045     double* AdataP;
00046     long n;
00047     double  value;
00048 
00049     if(A.Structure.isSubset() == 1)
00050     {
00051     A.initializeMinDuplicate(*this);
00052     AdataP = (double*)A.getDataPointer();
00053     n      = A.Structure.getFullDataCount();
00054     }
00055     else
00056     {
00057     AdataP = (double*)getDataPointer();
00058     n      = Structure.getFullDataCount();
00059     }
00060 
00061     CAMbinaryEngine::doubleMinValue(AdataP, n, value);
00062     return value;
00063 }
00064 
00065 double  CAMarrayBase::maxAbs() const
00066 {
00067 //
00068 //  Need Conversion Check
00069 //
00070     CAMarrayBase A;
00071     double* AdataP;
00072     long n;
00073     double  value;
00074 
00075     if(A.Structure.isSubset() == 1)
00076     {
00077     A.initializeMinDuplicate(*this);
00078     AdataP = (double*)A.getDataPointer();
00079     n      = A.Structure.getFullDataCount();
00080     }
00081     else
00082     {
00083     AdataP = (double*)getDataPointer();
00084     n      = Structure.getFullDataCount();
00085     }
00086 
00087     CAMbinaryEngine::doubleMaxAbsValue(AdataP, n, value);
00088     return value;
00089 }
00090 
00091 double  CAMarrayBase::minAbs() const
00092 {
00093 //
00094 //  Need Conversion Check
00095 //
00096     CAMarrayBase A;
00097     double* AdataP;
00098     long n;
00099     double  value;
00100 
00101     if(A.Structure.isSubset() == 1)
00102     {
00103     A.initializeMinDuplicate(*this);
00104     AdataP = (double*)A.getDataPointer();
00105     n      = A.Structure.getFullDataCount();
00106     }
00107     else
00108     {
00109     AdataP = (double*)getDataPointer();
00110     n      = Structure.getFullDataCount();
00111     }
00112 
00113     CAMbinaryEngine::doubleMinAbsValue(AdataP, n, value);
00114     return value;
00115 }
00116 
00117 
00118 double  CAMarrayBase::infNorm() const
00119 {
00120 //
00121 //  Need Conversion Check
00122 //
00123     CAMarrayBase A;
00124     double* AdataP;
00125     long    n;
00126     double  value;
00127 
00128     if(A.Structure.isSubset() == 1)
00129     {
00130     A.initializeMinDuplicate(*this);
00131     AdataP = (double*)A.getDataPointer();
00132     n      = A.Structure.getFullDataCount();
00133     }
00134     else
00135     {
00136     AdataP = (double*)getDataPointer();
00137     n      = Structure.getFullDataCount();
00138     }
00139 
00140     CAMbinaryEngine::doubleMaxAbsValue(AdataP, n, value);
00141     return value;
00142 }
00143 
00144 double  CAMarrayBase::pNorm(double p) const
00145 {
00146 //
00147 //  Need Conversion Check
00148 //
00149     CAMarrayBase A;
00150     double* AdataP;
00151     long    n;
00152     double  value;
00153 
00154     if(A.Structure.isSubset() == 1)
00155     {
00156     A.initializeMinDuplicate(*this);
00157     AdataP = (double*)A.getDataPointer();
00158     n      = A.Structure.getFullDataCount();
00159     }
00160     else
00161     {
00162     AdataP = (double*)getDataPointer();
00163     n      = Structure.getFullDataCount();
00164     }
00165 
00166     CAMbinaryEngine::doublepNorm(AdataP, n, p, value);
00167     return value;
00168 }
00169 
00170 double  CAMarrayBase::pNorm(int p) const {return pNorm(double(p));}
00171 double  CAMarrayBase::pNorm(long p) const {return pNorm(double(p));}
00172 double  CAMarrayBase::pNorm(float p) const {return pNorm(double(p));}
00173 
00174 //
00175 //********************************************************************************
00176 //                     CPP File End
00177 //********************************************************************************
00178 //
00179 
00180 
00181   

Generated on Wed Aug 6 12:58:42 2003 for Open-Sessame Framework by doxygen1.3