Skip to content

Commit

Permalink
Minor bits.
Browse files Browse the repository at this point in the history
  • Loading branch information
bluescarni committed Sep 10, 2024
1 parent 80b4e24 commit 0a15ca0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/taylor_adaptive.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,9 @@ void taylor_adaptive<T>::finalise_ctor_impl(sys_t vsys, std::vector<T> state,
#if defined(HEYOKA_HAVE_REAL)

if constexpr (std::same_as<T, mppp::real>) {
// 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.
Expand Down
4 changes: 2 additions & 2 deletions src/taylor_adaptive_batch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -152,11 +152,11 @@ void taylor_adaptive_batch<T>::finalise_ctor_impl(sys_t vsys, std::vector<T> 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 ({})",
Expand Down

0 comments on commit 0a15ca0

Please sign in to comment.