X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=nmdscommand.h;h=d7bedcf7f9c37a6f8091d32792c10a160be3e5c5;hb=c921bbf0623d5200f69b5d83b3c70ea533c69412;hp=5e4e65596a05a91cfdc6824db1b4086303a0f8e3;hpb=d04f948b1a2a1a2984fc4a45d04403b8c121c5bc;p=mothur.git diff --git a/nmdscommand.h b/nmdscommand.h index 5e4e655..d7bedcf 100644 --- a/nmdscommand.h +++ b/nmdscommand.h @@ -14,8 +14,17 @@ #include "linearalgebra.h" -/* references used to make this command: "Nonmetric Multidimensional Scalling: A Numerical Method" - by J. B. Kruskal Psychometrika - Vol 29, No. 2 June 1964 */ +/* + Translated from the nmds.R code written by Sarah Goslee using, + + # Non-metric multidimensional scaling function + # using the majorization algorithm from + # Borg & Groenen 1997, Modern Multidimensional Scaling. + # + + # also referenced (Kruskal 1964) + + */ /*****************************************************************/ class NMDSCommand : public Command { @@ -33,24 +42,28 @@ public: private: - bool abort; + bool abort, trace; string phylipfile, outputDir, axesfile; - int dimension, maxIters; - double step, cutoff; + int maxdim, mindim, maxIters, iters; + double epsilon; vector outputNames; map > outputTypes; LinearAlgebra linearCalc; - vector< vector > generateStartingConfiguration(int); //pass in numNames, return axes - int normalizeConfiguration(vector< vector >&, int); - vector satisfyMonotonicity(vector); - double calculateStress(vector&, vector&, double&); - vector< vector > calculateStressGradientVector(vector&, vector&, double, double, vector< vector >&); - double calculateMagnitude(vector< vector >&); - double calculateStep(vector< vector >&, vector< vector >&, vector&); - vector< vector > calculateNewConfiguration(double, vector< vector >&, vector< vector >&); + vector< vector > nmdsCalc(vector< vector >&, vector< vector >&, double&); + vector< vector > getConfiguration(vector< vector >&, int); + vector< vector > generateStartingConfiguration(int, int); //pass in numNames, return axes + int normalizeConfiguration(vector< vector >&, int, int); + double calculateStress(vector< vector >&, vector< vector >&); vector< vector > readAxes(vector); - int output(string, string, vector< vector >&, vector&, vector&); + int output(vector< vector >&, vector&, ofstream&); + + //vector satisfyMonotonicity(vector, vector); + //vector< vector > calculateStressGradientVector(vector&, vector&, double, double, vector< vector >&); + //double calculateMagnitude(vector< vector >&); + //double calculateStep(vector< vector >&, vector< vector >&, vector&); + //vector< vector > calculateNewConfiguration(double, vector< vector >&, vector< vector >&); + }; /*****************************************************************/