File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -191,6 +191,16 @@ void cmaple::ModelBase::extractRootFreqs(const Alignment* aln) {
191
191
// update root_freqs and root_log_freqs
192
192
RealNumType inverse_seq_length = 1.0 / seq_length;
193
193
for (StateType i = 0 ; i < num_states_; ++i) {
194
+ // validate root_freqs[i]
195
+ if (root_freqs[i] == 0 )
196
+ {
197
+ // Get the seqtype
198
+ const cmaple::SeqRegion::SeqType seqtype = getSeqType ();
199
+ std::string error_msg = " Root frequency of state " ;
200
+ error_msg += cmaple::Alignment::convertState2Char (i, seqtype);
201
+ error_msg += " is zero!" ;
202
+ throw std::logic_error (error_msg);
203
+ }
194
204
// root_freqs[i] /= seq_length;
195
205
root_freqs[i] *= inverse_seq_length;
196
206
inverse_root_freqs[i] = 1.0 / root_freqs[i];
You can’t perform that action at this time.
0 commit comments