Commit df13cac1 authored by Thibault Hallouin's avatar Thibault Hallouin
Browse files

bring back xexpression for templated class

With xexpression, the compiler will complain if the type used does
not implement the xexpression interface. Before the move to OO approach,
it was present, but got lost along the way.
Showing with 6 additions and 1 deletion
+6 -1
#ifndef EVALHYD_DETERMINIST_EVALUATOR_HPP #ifndef EVALHYD_DETERMINIST_EVALUATOR_HPP
#define EVALHYD_DETERMINIST_EVALUATOR_HPP #define EVALHYD_DETERMINIST_EVALUATOR_HPP
#include <xtensor/xexpression.hpp>
#include <xtensor/xtensor.hpp> #include <xtensor/xtensor.hpp>
namespace evalhyd namespace evalhyd
...@@ -19,7 +20,11 @@ namespace evalhyd ...@@ -19,7 +20,11 @@ namespace evalhyd
public: public:
// constructor method // constructor method
Evaluator(const A& obs, const A& prd) : q_obs{obs}, q_prd{prd} { Evaluator(const xt::xexpression<A>& obs,
const xt::xexpression<A>& prd) :
q_obs{obs.derived_cast()},
q_prd{prd.derived_cast()}
{
// check that data dimensions are compatible // check that data dimensions are compatible
if (q_prd.dimension() != q_obs.dimension()) if (q_prd.dimension() != q_obs.dimension())
{ {
......
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