throw error if invalid assignment

release/4.3a0
Varun Agrawal 2024-08-21 04:19:44 -04:00
parent 9818f89cec
commit 8abd2756ea
1 changed files with 3 additions and 2 deletions

View File

@ -346,9 +346,10 @@ double GaussianMixture::error(const HybridValues &values) const {
} }
} }
// The discrete assignment is not valid so we return 0.0 erorr. // The discrete assignment is not valid so we throw an error.
if (!valid_assignment) { if (!valid_assignment) {
return 0.0; throw std::runtime_error(
"Invalid discrete values in values. Not all discrete keys specified.");
} }
// Directly index to get the conditional, no need to build the whole tree. // Directly index to get the conditional, no need to build the whole tree.