From 47431da892d3762d8bef25844d5ad06e12206994 Mon Sep 17 00:00:00 2001 From: Jonathan Vandermause Date: Fri, 1 Nov 2024 00:59:27 -0400 Subject: [PATCH] use runtime error instead --- src/flare_pp/bffs/sparse_gp.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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.