diff --git a/src/flare_pp/bffs/sparse_gp.cpp b/src/flare_pp/bffs/sparse_gp.cpp index 698ee6f0..c713f7df 100644 --- a/src/flare_pp/bffs/sparse_gp.cpp +++ b/src/flare_pp/bffs/sparse_gp.cpp @@ -191,6 +191,10 @@ void SparseGP ::add_specific_environments(const Structure &structure, void SparseGP ::add_uncertain_environments(const Structure &structure, const std::vector &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> sorted_indices =