Skip to content

Commit

Permalink
Merge pull request #426 from mir-group/jon/nadded-assert
Browse files Browse the repository at this point in the history
check size of n_added
  • Loading branch information
jonpvandermause authored Nov 1, 2024
2 parents 94a5f55 + 47431da commit aea1aec
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/flare_pp/bffs/sparse_gp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,10 @@ void SparseGP ::add_specific_environments(const Structure &structure,
void SparseGP ::add_uncertain_environments(const Structure &structure,
const std::vector<int> &n_added) {

if (n_added.size() != n_kernels) {
throw std::runtime_error("n_added must have the same size as the number of kernels");
}

initialize_sparse_descriptors(structure);
// Compute cluster uncertainties.
std::vector<std::vector<int>> sorted_indices =
Expand Down

0 comments on commit aea1aec

Please sign in to comment.