diff --git a/include/evalhyd/evald.hpp b/include/evalhyd/evald.hpp index 19cbdbcecde37ea6f5e82ce593c273916d04bae4..a2e9ef300f649213f3967a64e3278132e5a1199a 100644 --- a/include/evalhyd/evald.hpp +++ b/include/evalhyd/evald.hpp @@ -210,19 +210,25 @@ namespace evalhyd xtl::missing<const std::vector<std::string>>() ) { - // check ranks of tensors - if (xt::get_rank<XD2>::value != 2) + // check ranks of expressions if they are tensors + if (xt::get_rank<XD2>::value != SIZE_MAX) { - throw std::runtime_error( - "observations and/or predictions and/or thresholds " - "are not two-dimensional" - ); + if (xt::get_rank<XD2>::value != 2) + { + throw std::runtime_error( + "observations and/or predictions and/or thresholds " + "are not two-dimensional" + ); + } } - if (xt::get_rank<XB3>::value != 3) + if (xt::get_rank<XB3>::value != SIZE_MAX) { - throw std::runtime_error( - "temporal masks are not three-dimensional" - ); + if (xt::get_rank<XB3>::value != 3) + { + throw std::runtime_error( + "temporal masks are not three-dimensional" + ); + } } // retrieve real types of the expressions diff --git a/include/evalhyd/evalp.hpp b/include/evalhyd/evalp.hpp index 4fa7a2b3be4688b8e6fe5e549089450da95d0774..fb64692a9401a1c1e49f90b75fb1a79950b5575f 100644 --- a/include/evalhyd/evalp.hpp +++ b/include/evalhyd/evalp.hpp @@ -190,24 +190,35 @@ namespace evalhyd xtl::missing<const std::vector<std::string>>() ) { - // check ranks of tensors - if (xt::get_rank<XD2>::value != 2) + // check ranks of expressions if they are tensors + if (xt::get_rank<XD2>::value != SIZE_MAX) { - throw std::runtime_error( - "observations and/or thresholds are not two-dimensional" - ); + if (xt::get_rank<XD2>::value != 2) + { + throw std::runtime_error( + "observations and/or thresholds are not two-dimensional" + ); + } } - if (xt::get_rank<XD4>::value != 4) + + if (xt::get_rank<XD4>::value != SIZE_MAX) { - throw std::runtime_error( - "predictions are not four-dimensional" - ); + if (xt::get_rank<XD4>::value != 4) + { + throw std::runtime_error( + "predictions are not four-dimensional" + ); + } } - if (xt::get_rank<XB4>::value != 4) + + if (xt::get_rank<XB4>::value != SIZE_MAX) { - throw std::runtime_error( - "temporal masks are not four-dimensional" - ); + if (xt::get_rank<XB4>::value != 4) + { + throw std::runtime_error( + "temporal masks are not four-dimensional" + ); + } } // retrieve real types of the expressions