packages.biu: do not check if NDEBUG

This commit is contained in:
陈浩南 2024-08-22 22:49:21 +08:00
parent 7a152011f0
commit 45a1c4520b
2 changed files with 6 additions and 0 deletions

View File

@ -50,8 +50,10 @@ namespace biu::common
template <typename Array> std::generator<std::pair<Array, std::size_t>> sequence(Array from, Array to)
{
# ifndef NDEBUG
assert(from.size() == to.size());
for (std::size_t i = 0; i < from.size(); i++) assert(from[i] < to[i]);
# endif
Array current = from;
std::size_t total = 0;
auto make_next = [&](this auto&& self, std::size_t i)

View File

@ -184,8 +184,10 @@ namespace biu::eigen
// decomposition declarations can't be constexpr
constexpr auto size = get_size.template operator()<ToSize>();
# ifndef NDEBUG
if (!size.second(vector))
throw std::invalid_argument("The size of the destination Eigen container mismatches the input container");
# endif
if constexpr (size.first == dynamicSize)
return std::vector<typename Vector::Scalar>(vector.data(), vector.data() + vector.size());
else
@ -235,8 +237,10 @@ namespace biu::eigen
// decomposition declarations can't be constexpr
constexpr auto size = get_size();
# ifndef NDEBUG
if (!size.second(matrix))
throw std::invalid_argument("The size of the destination Eigen container mismatches the input container");
# endif
using container_per_row = std::conditional_t<size.first.second == dynamicSize,
std::vector<typename Matrix::Scalar>, std::array<typename Matrix::Scalar, size.first.second>>;