#include "program.h"
#include "evaluation.h"

program::program()
{
}

void program::append_expression(
    int expr_id,
    const char *op_name,
    const char *op_type,
    int inputs[],
    int num_inputs)
{
    // create an expression object with the provided parameters
    expression expr(expr_id, op_name, op_type, inputs, num_inputs);

    // append the expression to the expressions vector
    expressions_.push_back(expr);
}

int program::add_op_param_double(
    const char *key,
    double value)
{
    // get end of expressions_ values and send to our add_op_param_double
    expressions_.back().add_op_param_double(key, value);
    return 0;
}

int program::add_op_param_ndarray(
    const char *key,
    int dim,
    size_t shape[],
    double data[])
{
   // get end of expressions_ values and send to our add_op_param_ndarray
   expressions_.back().add_op_param_ndarray(key, dim, shape, data);
   return 0;
}


evaluation *program::build()
{
    evaluation *eval = new evaluation(expressions_);
    return eval;
}
