From 93e23da6f7e2ff3ebb75ec8328328a6557febfff Mon Sep 17 00:00:00 2001
From: Thibault Hallouin <thibault.hallouin@inrae.fr>
Date: Wed, 22 Feb 2023 16:14:40 +0100
Subject: [PATCH] avoid copies of temporal masks

The template argument defining the type of for temporal masks was not
used in the elements/intermediates/metrics functions, and since a copy
from the user-provided input masks is required to not modify it, it
makes more sense to directly initialise it as an xtensor rather than
propagate a template argument to use pytensor/rtensor.
---
 include/evalhyd/detail/determinist/evaluator.hpp | 2 +-
 include/evalhyd/detail/probabilist/evaluator.hpp | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/evalhyd/detail/determinist/evaluator.hpp b/include/evalhyd/detail/determinist/evaluator.hpp
index 165a2c3..0aeca94 100644
--- a/include/evalhyd/detail/determinist/evaluator.hpp
+++ b/include/evalhyd/detail/determinist/evaluator.hpp
@@ -27,7 +27,7 @@ namespace evalhyd
             const XD2& q_obs;
             const XD2& q_prd;
             // members for optional input data
-            XB3 t_msk;
+            xt::xtensor<bool, 3> t_msk;
             const std::vector<xt::xkeep_slice<int>>& b_exp;
 
             // members for dimensions
diff --git a/include/evalhyd/detail/probabilist/evaluator.hpp b/include/evalhyd/detail/probabilist/evaluator.hpp
index 93111a1..128ca28 100644
--- a/include/evalhyd/detail/probabilist/evaluator.hpp
+++ b/include/evalhyd/detail/probabilist/evaluator.hpp
@@ -34,7 +34,7 @@ namespace evalhyd
             const XD2& _q_thr;
             const xt::xtensor<double, 1>& _c_lvl;
             xtl::xoptional<const std::string, bool> _events;
-            XB4 t_msk;
+            xt::xtensor<bool, 4> t_msk;
             const std::vector<xt::xkeep_slice<int>>& b_exp;
 
             // member for "reproducible randomness"
-- 
GitLab