home *** CD-ROM | disk | FTP | other *** search
/ Chip 1999 March / Chip_1999-03_cd.bin / zkuste / delphi / D / MATEM.ARJ / MATH2.ZIP / cppbld1 / math2.hpp next >
Encoding:
C/C++ Source or Header  |  1998-08-17  |  6.4 KB  |  147 lines

  1. //----------------------------------------------------------------------------
  2. // Math2.hpp - bcbdcc32 generated hdr (DO NOT EDIT) rev: 0
  3. // From: Math2.pas
  4. //----------------------------------------------------------------------------
  5. #ifndef Math2HPP
  6. #define Math2HPP
  7. //----------------------------------------------------------------------------
  8. #include <Vector.hpp>
  9. #include <Matrix.hpp>
  10. #include <Math1.hpp>
  11. #include <SysUtils.hpp>
  12. #include <System.hpp>
  13. namespace Math2
  14. {
  15. //-- type declarations -------------------------------------------------------
  16. class __declspec(delphiclass) ESDLMath2Error;
  17. class __declspec(pascalimplementation) ESDLMath2Error : public Sysutils::Exception
  18. {
  19.     typedef Sysutils::Exception inherited;
  20.     
  21. public:
  22.     /* Exception.Create */ __fastcall ESDLMath2Error(const System::AnsiString Msg) : Sysutils::Exception(
  23.         Msg) { }
  24.     /* Exception.CreateFmt */ __fastcall ESDLMath2Error(const System::AnsiString Msg, const System::TVarRec 
  25.         * Args, const int Args_Size) : Sysutils::Exception(Msg, Args, Args_Size) { }
  26.     /* Exception.CreateRes */ __fastcall ESDLMath2Error(int Ident) : Sysutils::Exception(Ident) { }
  27.     /* Exception.CreateResFmt */ __fastcall ESDLMath2Error(int Ident, const System::TVarRec * Args, const 
  28.         int Args_Size) : Sysutils::Exception(Ident, Args, Args_Size) { }
  29.     /* Exception.CreateHelp */ __fastcall ESDLMath2Error(const System::AnsiString Msg, int AHelpContext
  30.         ) : Sysutils::Exception(Msg, AHelpContext) { }
  31.     /* Exception.CreateFmtHelp */ __fastcall ESDLMath2Error(const System::AnsiString Msg, const System::TVarRec 
  32.         * Args, const int Args_Size, int AHelpContext) : Sysutils::Exception(Msg, Args, Args_Size, AHelpContext
  33.         ) { }
  34.     /* Exception.CreateResHelp */ __fastcall ESDLMath2Error(int Ident, int AHelpContext) : Sysutils::Exception(
  35.         Ident, AHelpContext) { }
  36.     /* Exception.CreateResFmtHelp */ __fastcall ESDLMath2Error(int Ident, const System::TVarRec * Args, 
  37.         const int Args_Size, int AHelpContext) : Sysutils::Exception(Ident, Args, Args_Size, AHelpContext)
  38.          { }
  39.     
  40. public:
  41.     /* TObject.Destroy */ __fastcall virtual ~ESDLMath2Error(void) { }
  42.     
  43. };
  44.  
  45. enum TClusterMethod { cmSingleLink, cmCompleteLink, cmWard, cmAvgLink, cmFlexLink };
  46.  
  47. class __declspec(delphiclass) TCurveFit;
  48. class __declspec(pascalimplementation) TCurveFit : public System::TObject
  49. {
  50.     typedef System::TObject inherited;
  51.     
  52. private:
  53.     double sumx;
  54.     double sumy;
  55.     double sumxq;
  56.     double sumyq;
  57.     double sumDiff;
  58.     double SumDiffq;
  59.     double sumxy;
  60.     double sumx2y;
  61.     double sumx3;
  62.     double sumx4;
  63.     double sum1byy;
  64.     double sum1byyq;
  65.     double sumxbyy;
  66.     double sumybyx;
  67.     double sum1byx;
  68.     double sum1byxq;
  69.     double sumlnx;
  70.     double sumlnxq;
  71.     double sumylnx;
  72.     double sumlny;
  73.     double sumlnyq;
  74.     double sumxlny;
  75.     double sumxqlny;
  76.     long FNumData;
  77.     Vector::TVector* SumXArray;
  78.     Vector::TVector* RHS;
  79.     double __fastcall GetMeanX(void);
  80.     double __fastcall GetMeanY(void);
  81.     double __fastcall GetStdDevX(void);
  82.     double __fastcall GetStdDevY(void);
  83.     double __fastcall GetMeanDiff(void);
  84.     double __fastcall GetStdDevDiff(void);
  85.     double __fastcall GetRxy(void);
  86.     
  87. public:
  88.     __fastcall TCurveFit(void);
  89.     __fastcall virtual ~TCurveFit(void);
  90.     void __fastcall Init(void);
  91.     void __fastcall EnterStatValue(double x, double y);
  92.     void __fastcall CalcStatistics(long &NumData, double &MeanX, double &MeanY, double &StdevX, double 
  93.         &StdevY, double &MeanDiff, double &StdevDiff, double &rxy);
  94.     void __fastcall CalcGaussFit(double &k0, double &k1, double &k2, double &FitQual);
  95.     void __fastcall CalcLinFit(double &k, double &d, double &FitQual);
  96.     void __fastcall CalcLogFit(double &k0, double &k1, double &FitQual);
  97.     void __fastcall CalcParabolFit(double &k0, double &k1, double &k2, double &FitQual);
  98.     bool __fastcall CalcPolyFit(const Byte nOrder, double * kArray, const int kArray_Size, double &FitQual
  99.         );
  100.     void __fastcall CalcReciLinFit(double &k0, double &k1, double &FitQual);
  101.     void __fastcall CalcHyperbolFit(double &k0, double &k1, double &FitQual);
  102.     __property long NumData = {read=FNumData, nodefault};
  103.     __property double MeanX = {read=GetMeanX};
  104.     __property double MeanY = {read=GetMeanY};
  105.     __property double StdDevX = {read=GetStdDevX};
  106.     __property double StdDevY = {read=GetStdDevY};
  107.     __property double MeanDiff = {read=GetMeanDiff};
  108.     __property double StdDevDiff = {read=GetStdDevDiff};
  109.     __property double CorrCoeff = {read=GetRxy};
  110. };
  111.  
  112. //-- var, const, procedure ---------------------------------------------------
  113. #define MaxPolyFitOrder (Byte)(8)
  114. extern void __fastcall PolynomialSmooth(Vector::TVector* SourceVec, int FirstElem, int LastElem, Vector::TVector* 
  115.     DestVec, int WindowSize);
  116. extern void __fastcall FirstDeriv(Vector::TVector* SourceVec, int FirstElem, int LastElem, Vector::TVector* 
  117.     DestVec, int WindowSize);
  118. extern bool __fastcall CalcCovar(Matrix::TMatrix* InData, Matrix::TMatrix* CovarMat, int LoC, int HiC
  119.     , int LoR, int HiR, int Scaling);
  120. extern bool __fastcall CalcEigVec(Matrix::TMatrix* InMat);
  121. extern double __fastcall GetEigenResult(int EigVecNum, int VecElem);
  122. extern int __fastcall GetEigenSize(void);
  123. extern void __fastcall RemoveEigenMatrix(void);
  124. extern bool __fastcall CalcPrincComp(Matrix::TMatrix* InData, int LoC, int HiC, int LoR, int HiR, int 
  125.     Scaling);
  126. extern double __fastcall CalcFishQ(double m1, double m2, double s1, double s2);
  127. extern void __fastcall MeanDistanceKNN(Matrix::TMatrix* InMat, int kn, int FirstRow, int LastRow, Vector::TVector* 
  128.     &DistVec);
  129. extern void __fastcall FindCenters(Matrix::TMatrix* InMat, int RowLo, int RowHi, int NumCent, Matrix::TMatrix* 
  130.     &Centers, double &MeanDist);
  131. extern void __fastcall FindNearestNeighbors(int k, Matrix::TMatrix* InMat, int FirstObj, int LastObj
  132.     , Vector::TVector* DatVec, Matrix::TMatrix* KNNList);
  133. extern double __fastcall CalcGaussKernel(Vector::TVector* Probe, Vector::TVector* RefCenter, double 
  134.     Width);
  135. extern double __fastcall CalcGaussKernelMat(Vector::TVector* Probe, Matrix::TMatrix* RefCenterMat, int 
  136.     RefCenterIx, double Width);
  137. extern int __fastcall AgglomClustering(Matrix::TMatrix* InMat, Matrix::TDistMode DistanceMeasure, TClusterMethod 
  138.     ClusterMethod, double alpha, Matrix::TIntMatrix* &ClustResult, Vector::TVector* &ClustDist, Vector::TVector* 
  139.     &DendroCoords);
  140.  
  141. }    /* namespace Math2 */
  142. #if !defined(NO_IMPLICIT_NAMESPACE_USE)
  143. using namespace Math2;
  144. #endif
  145. //-- end unit ----------------------------------------------------------------
  146. #endif    // Math2
  147.