X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=linearalgebra.h;h=e4c8c1588b60c3868de7f4e06353a43112ea3037;hb=250e3b11b1c9c1e1ad458ab6c7e71ac2e67e11d9;hp=321f46a1e283b6f4113b8dfd8242b0dfa190cc4e;hpb=8dd3c225255d7084e3aff8740aa4f1f1cabb367a;p=mothur.git diff --git a/linearalgebra.h b/linearalgebra.h index 321f46a..e4c8c15 100644 --- a/linearalgebra.h +++ b/linearalgebra.h @@ -20,25 +20,63 @@ public: ~LinearAlgebra() {} vector > matrix_mult(vector >, vector >); + vector >transpose(vector >); void recenter(double, vector >, vector >&); - int tred2(vector >&, vector&, vector&); + //eigenvectors + int tred2(vector >&, vector&, vector&); int qtli(vector&, vector&, vector >&); + 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 calcKruskalWallis(vector&, double&); + double calcWilcoxon(vector&, vector&, double&); 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 >); + double choose(double, double); + double normalvariate(double mu, double sigma); + vector< vector > lda(vector< vector >& a, vector groups, vector< vector >& means, bool&); //Linear discriminant analysis - a is [features][valuesFromGroups] groups indicates which group each sampling comes from. For example if groups = early, late, mid, early, early. a[0][0] = value for feature0 from groupEarly. + int svd(vector< vector >& a, vector& w, vector< vector >& v); //Singular value decomposition 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 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 gammp(const double, const double); + double pnorm(double x); + + 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