Commit 8d6b26ff authored by Thibault Hallouin's avatar Thibault Hallouin
Browse files

template function to avoid unnecessary copy

1 merge request!3release v0.1.0
Pipeline #43881 passed with stage
in 3 minutes and 3 seconds
Showing with 4 additions and 3 deletions
+4 -3
......@@ -165,10 +165,11 @@ namespace evalhyd
}
/// Function to generate temporal mask based on masking conditions
template<class X1, class X2>
inline xt::xtensor<bool, 1> generate_mask_from_conditions(
const std::array<char, 32>& msk_char_arr,
const xt::xtensor<double, 1>& q_obs,
const xt::xtensor<double, 2>& q_prd = {}
const X1& q_obs,
const X2& q_prd
)
{
// parse string to identify masking conditions
......@@ -200,7 +201,7 @@ namespace evalhyd
auto get_q = [&]() {
if (var == "q_obs")
{
return q_obs;
return xt::xtensor<double, 1>(q_obs);
}
else if (var == "q_prd_median")
{
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment