Skip to content

Commit

Permalink
fix br=0 due to duplicate declaration
Browse files Browse the repository at this point in the history
  • Loading branch information
Thu-Hien To authored and Thu-Hien To committed Oct 13, 2020
1 parent 49846df commit ae2b90f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
Binary file modified bin/lsd2_mac
Binary file not shown.
7 changes: 4 additions & 3 deletions src/lsd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,9 @@ int lsd::buildTimeTree( int argc, char** argv, InputOutputStream *inputOutput)
opt->givenRate[0] = false;
}
}
if (opt->estimate_root=="" || opt->estimate_root=="k") constraintConsistent = initConstraint(opt, nodes);
if (opt->estimate_root=="" || opt->estimate_root=="k"){
constraintConsistent = initConstraint(opt, nodes);
}
if (opt->e>0) calculateOutliers(opt,nodes,median_rate,true);
if (opt->splitExternal) splitExternalBranches(opt,nodes);
if (!opt->constraint){//LD without constraints
Expand All @@ -159,7 +161,6 @@ int lsd::buildTimeTree( int argc, char** argv, InputOutputStream *inputOutput)
}
else if (opt->estimate_root=="k"){
cout<<"Estimating the root position on the branch defined by given outgroups ..."<<endl;
double br=0;
vector<int>::iterator iter=nodes[0]->suc.begin();
int s1=(*iter);
iter++;
Expand Down Expand Up @@ -218,9 +219,9 @@ int lsd::buildTimeTree( int argc, char** argv, InputOutputStream *inputOutput)
}
}
else if (opt->estimate_root=="k"){

if (constraintConsistent){
cout<<"Estimating the root position on the branch defined by given outgroups ..."<<endl;
double br=0;
vector<int>::iterator iter=nodes[0]->suc.begin();
int s1=(*iter);
iter++;
Expand Down
10 changes: 5 additions & 5 deletions src/options.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Pr* getOptions( int argc, char** argv )

Pr* getCommandLine( int argc, char** argv)
{
const string VERSION="v.1.9.6";
const string VERSION="v.1.9.7";
Pr* opt = new Pr();
int c;
string s;
Expand Down Expand Up @@ -124,8 +124,8 @@ Pr* getCommandLine( int argc, char** argv)
if( !isReal(optarg) )
myExit("Argument of option -b must be a real.\n");
opt->c = atof( optarg );
if (opt->c<=0 || opt->c>1)
myExit("Argument of option -b must be a positive number samller than 1, see the help\n page of lsd2 -h for more information.\n");
if (opt->c<=0)
myExit("Argument of option -b must be a positive number, see the help\n page for more information.\n");
break;
case 'e':
if( !isReal(optarg) )
Expand Down Expand Up @@ -356,7 +356,7 @@ Pr* getInterface()

void printInterface(ostream& in, Pr* opt)
{
const string VERSION = "v.1.9.6";
const string VERSION = "v.1.9.7";

in<<"\nLEAST-SQUARE METHODS TO ESTIMATE RATES AND DATES - "<<VERSION<<" \n\n";
in<<"\nInput files:\n";
Expand Down Expand Up @@ -513,7 +513,7 @@ void printHelp( void )
const string BOLD = "\033[00;01m";
const string LINE = "\033[00;04m";
const string FLAT = "\033[00;00m";
const string VERSION = "v.1.9.6";
const string VERSION = "v.1.9.7";

cout<<BOLD<<"LSD: LEAST-SQUARES METHODS TO ESTIMATE RATES AND DATES - "<<VERSION<<"\n\n";
cout<<BOLD<<"DESCRIPTION\n"
Expand Down

0 comments on commit ae2b90f

Please sign in to comment.