New split calculation

git-svn-id: svn://scm.gforge.inria.fr/svnroot/paradiseo@1592 331e1502-861f-0410-8da2-ba01fb791d7f
This commit is contained in:
wcancino 2009-06-25 15:32:07 +00:00
commit 5312c3321e
6 changed files with 322 additions and 15 deletions

View file

@ -0,0 +1,53 @@
#include <eo>
#include <phylotreeIND.h>
using namespace std;
gsl_rng *rn2;
RandomNr *rn;
//Sequences *seq;
long seed;
//vector<phylotreeIND> arbores;
string datafile, path;
phylotreeIND *templatetree_ptr;
int main(int argc, char *argv[])
{
// measures execution time
eoParser parser(argc, argv);
datafile = parser.createParam(string(), "data", "Datafile", 'd',"Param").value();
path = parser.createParam(string(), "path", "Treefile", 'p',"Param").value();
cout << "\n\nReading Sequence Datafile..." << path+datafile;
datafile = path+datafile;
Sequences seq6(datafile.c_str());
// Sequences seq7("/home/wcancino/experimentos/PhyloMOEA_0.2/omp_tests/datasets/TEST.500_5000");
cout << " done.\n";
// calculate datafile
cout << "calculating pattersn..." << endl;
seq6.calculate_patterns();
seq6.calculate_frequences();
gsl_rng *rn2 = gsl_rng_alloc(gsl_rng_default);
RandomNr *rn = new RandomNr(time(NULL));
phylotreeIND templatetree6( rn, seq6, rn2);
phylotreeIND *test = templatetree6.randomClone();
phylotreeIND test2(*test);
test2.TBR();
test->calculate_splits4();
test->print_splits_2();
test->printNewick(cout);
test2.calculate_splits4();
cout << "distance " << test->compare_topology_4(test2) << endl;
cout << "distance " << test->compare_topology_2(test2) << endl;
// of.close();
gsl_rng_free(rn2);
// delete probmatrixs;
delete rn;
return 0;
}