From 0a15ca0e07ef8d8c47f0b1445472cb06aba09295 Mon Sep 17 00:00:00 2001 From: Francesco Biscani Date: Tue, 10 Sep 2024 09:04:26 +0200 Subject: [PATCH] Minor bits. --- src/taylor_adaptive.cpp | 4 +++- src/taylor_adaptive_batch.cpp | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/taylor_adaptive.cpp b/src/taylor_adaptive.cpp index 51e5f3880..093c49c2e 100644 --- a/src/taylor_adaptive.cpp +++ b/src/taylor_adaptive.cpp @@ -265,7 +265,9 @@ void taylor_adaptive::finalise_ctor_impl(sys_t vsys, std::vector state, #if defined(HEYOKA_HAVE_REAL) if constexpr (std::same_as) { - // The user passed in a non-empty multiprecision state. + // The user passed in a non-empty multiprecision state. We need + // to either enforce the desired precision, or to check that the + // values in the state have all the same precision. if (prec) { // If the user explicitly specifies a precision, enforce that precision // on the state vector. diff --git a/src/taylor_adaptive_batch.cpp b/src/taylor_adaptive_batch.cpp index ae6e1ce11..55fc67501 100644 --- a/src/taylor_adaptive_batch.cpp +++ b/src/taylor_adaptive_batch.cpp @@ -152,11 +152,11 @@ void taylor_adaptive_batch::finalise_ctor_impl(sys_t vsys, std::vector sta m_compact_mode = compact_mode; // Check several input params. - if (m_batch_size == 0u) { + if (m_batch_size == 0u) [[unlikely]] { throw std::invalid_argument("The batch size in an adaptive Taylor integrator cannot be zero"); } - if (state.size() % m_batch_size != 0u) { + if (state.size() % m_batch_size != 0u) [[unlikely]] { throw std::invalid_argument( fmt::format("Invalid size detected in the initialization of an adaptive Taylor " "integrator: the state vector has a size of {}, which is not a multiple of the batch size ({})",