Skip to content

Commit c980ef8

Browse files
committed
finite profile process: adding an error message when Nstate not specified in custom mixture file
1 parent e7ec4d5 commit c980ef8

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

sources/FiniteProfileProcess.cpp

+7-1
Original file line numberDiff line numberDiff line change
@@ -446,6 +446,11 @@ void FiniteProfileProcess::ReadNcomponent(string filename) {
446446
}
447447
int tmpNstate;
448448
is >> tmpNstate;
449+
if (tmpNstate != GetDim()) {
450+
cerr << "error when reading empirical mixture : incorrect number of states\n";
451+
cerr << "see manual for formatting an empirical mixture\n";
452+
exit(1);
453+
}
449454
for (int k=0; k<tmpNstate; k++) {
450455
string c;
451456
is >> c;
@@ -915,7 +920,8 @@ void FiniteProfileProcess::ReadStatFix(string filename) {
915920
int tmp;
916921
is >> tmp;
917922
if (tmp != Nstate) {
918-
cerr << "error when reading empirical mixture : bad number of states\n";
923+
cerr << "error when reading empirical mixture : incorrect number of states\n";
924+
cerr << "see manual for formatting an empirical mixture\n";
919925
exit(1);
920926
}
921927
// read alphabet

0 commit comments

Comments
 (0)