diff --git a/src/flare_pp/bffs/sparse_gp.cpp b/src/flare_pp/bffs/sparse_gp.cpp index 74a1ad94..c713f7df 100644 --- a/src/flare_pp/bffs/sparse_gp.cpp +++ b/src/flare_pp/bffs/sparse_gp.cpp @@ -191,7 +191,9 @@ void SparseGP ::add_specific_environments(const Structure &structure, void SparseGP ::add_uncertain_environments(const Structure &structure, const std::vector &n_added) { - assert(n_added.size() == n_kernels && "n_added must have the same size as the number of kernels"); + 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.