X-Git-Url: https://git.donarmstrong.com/?p=mothur.git;a=blobdiff_plain;f=linearalgebra.h;h=e0933ee52564915d35bcf6e9f91f73c2cea80d2d;hp=286649374e1bd5a4768c257f564e86fb8ca14567;hb=a8e2df1b96a57f5f29576b08361b86a96a8eff4f;hpb=37eac2026d91179acda0494c4dcca22f176551b9 diff --git a/linearalgebra.h b/linearalgebra.h index 2866493..e0933ee 100644 --- a/linearalgebra.h +++ b/linearalgebra.h @@ -12,6 +12,7 @@ #include "mothurout.h" + class LinearAlgebra { public: @@ -19,15 +20,56 @@ public: ~LinearAlgebra() {} vector > matrix_mult(vector >, vector >); + void recenter(double, vector >, vector >&); int tred2(vector >&, vector&, vector&); int qtli(vector&, vector&, vector >&); - vector< vector > calculateEuclidianDistance(vector >&, int); + vector< vector > calculateEuclidianDistance(vector >&, int); //pass in axes and number of dimensions + vector< vector > calculateEuclidianDistance(vector >&); //pass in axes + vector > getObservedEuclideanDistance(vector >&); double calcPearson(vector >&, vector >&); + double calcSpearman(vector >&, vector >&); + double calcKendall(vector >&, vector >&); + double calcPearson(vector&, vector&, double&); + double calcSpearman(vector&, vector&, double&); + double calcKendall(vector&, vector&, double&); + + double calcSpearmanSig(double, double, double, double); //length, f^3 - f where f is the number of ties in x, f^3 - f where f is the number of ties in y, sum of squared diffs in ranks. - designed to find the sif of one score. + double calcPearsonSig(double, double); //length, coeff. + double calcKendallSig(double, double); //length, coeff. + + vector solveEquations(vector >, vector); + vector solveEquations(vector >, vector); + vector > getInverse(vector >); + + private: MothurOut* m; double pythag(double, double); + double betacf(const double, const double, const double); + double betai(const double, const double, const double); + double gammln(const double); + double gammp(const double, const double); + double gammq(const double, const double); + double gser(double&, const double, const double, double&); + double gcf(double&, const double, const double, double&); + double erfcc(double); + + double ran0(int&); //for testing + double ran1(int&); //for testing + double ran2(int&); //for testing + double ran3(int&); //for testing + double ran4(int&); //for testing + void psdes(unsigned long &, unsigned long &); //for testing + + void ludcmp(vector >&, vector&, double&); + void lubksb(vector >&, vector&, vector&); + + void ludcmp(vector >&, vector&, float&); + void lubksb(vector >&, vector&, vector&); + + }; #endif