#include "eval_sub.h"

tensor eval_sub::compute(const tensor &a, const tensor &b) {
    // these use our tensor operator- overload
    tensor c = a - b; 
    return c;
}

void eval_sub::eval(vars_type &variables, const kwargs_type &kwargs) {
    assert(inputs_.size() == 2);
    auto ita = variables.find(inputs_[0]);
    auto itb = variables.find(inputs_[1]);
    variables[expr_id_] = compute(ita->second,itb->second);
}

std::shared_ptr<eval_op> eval_sub::clone(const expression &expr) {
    return std::make_shared<eval_sub>(expr);
}