#ifndef ROOT_TPrincipal
#define ROOT_TPrincipal
#ifndef ROOT_TNamed
#include "TNamed.h"
#endif
#ifndef ROOT_TVectorD
#include "TVectorD.h"
#endif
#ifndef ROOT_TMatrixD
#include "TMatrixD.h"
#endif
#ifndef ROOT_TList
#include "TList.h"
#endif
class TPrincipal : public TNamed {
protected:
Int_t fNumberOfDataPoints;
Int_t fNumberOfVariables;
TVectorD fMeanValues;
TVectorD fSigmas;
TMatrixD fCovarianceMatrix;
TMatrixD fEigenVectors;
TVectorD fEigenValues;
TVectorD fOffDiagonal;
TVectorD fUserData;
Double_t fTrace;
TList *fHistograms;
Bool_t fIsNormalised;
Bool_t fStoreData;
TPrincipal(const TPrincipal&);
TPrincipal& operator=(const TPrincipal&);
void MakeNormalised();
void MakeRealCode(const char *filename, const char *prefix, Option_t *option="");
public:
TPrincipal();
virtual ~TPrincipal();
TPrincipal(Int_t nVariables, Option_t *opt="ND");
virtual void AddRow(const Double_t *x);
virtual void Browse(TBrowser *b);
virtual void Clear(Option_t *option="");
const TMatrixD *GetCovarianceMatrix() const {return &fCovarianceMatrix;}
const TVectorD *GetEigenValues() const {return &fEigenValues;}
const TMatrixD *GetEigenVectors() const {return &fEigenVectors;}
TList *GetHistograms() const {return fHistograms;}
const TVectorD *GetMeanValues() const {return &fMeanValues;}
const Double_t *GetRow(Int_t row);
const TVectorD *GetSigmas() const {return &fSigmas;}
const TVectorD *GetUserData() const {return &fUserData;}
Bool_t IsFolder() const { return kTRUE;}
virtual void MakeCode(const char *filename ="pca", Option_t *option="");
virtual void MakeHistograms(const char *name = "pca", Option_t *option="epsdx");
virtual void MakeMethods(const char *classname = "PCA", Option_t *option="");
virtual void MakePrincipals();
virtual void P2X(const Double_t *p, Double_t *x, Int_t nTest);
virtual void Print(Option_t *opt="MSE") const;
virtual void SumOfSquareResiduals(const Double_t *x, Double_t *s);
void Test(Option_t *option="");
virtual void X2P(const Double_t *x, Double_t *p);
ClassDef(TPrincipal,2)
}
;
#endif