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

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