Skip to content

Commit

Permalink
give error message when the input rate file has bad format
Browse files Browse the repository at this point in the history
  • Loading branch information
Thu-Hien To authored and Thu-Hien To committed May 29, 2021
1 parent 85f7dae commit ff36442
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
Binary file modified bin/lsd2_mac
Binary file not shown.
Binary file modified bin/lsd2_unix
Binary file not shown.
4 changes: 4 additions & 0 deletions src/lsd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,10 @@ int lsd::buildTimeTree( int argc, char** argv, InputOutputStream *inputOutput)
string line;
if( getline(*(io->inRate), line)) {
vector<double> all_rates = read_double_from_line(line);
if (all_rates.size()==0){
cerr<<"Error from the input rate file, expect a real number"<<endl;
exit(EXIT_FAILURE);
}
opt->rho = all_rates[0];
if (all_rates.size() > 1){
int i = 1;
Expand Down

0 comments on commit ff36442

Please sign in to comment.