33 lines
682 B
C++
Executable file
33 lines
682 B
C++
Executable file
#ifndef EVALUATION_H
|
|
#define EVALUATION_H
|
|
|
|
#include "expression.h"
|
|
#include "eval_op.h"
|
|
|
|
class evaluation
|
|
{
|
|
public:
|
|
evaluation(const std::vector<expression> &exprs);
|
|
|
|
void add_kwargs_double(
|
|
const char *key,
|
|
double value);
|
|
|
|
void add_kwargs_ndarray(
|
|
const char *key,
|
|
int dim,
|
|
size_t shape[],
|
|
double data[]);
|
|
|
|
// return 0 for success
|
|
int execute();
|
|
|
|
tensor &get_result();
|
|
|
|
private:
|
|
std::vector<std::shared_ptr<eval_op>> ops_; // instead of exprs_
|
|
std::map<int, tensor> variables_;
|
|
std::map<std::string, tensor> kwargs_;
|
|
}; // class evaluation
|
|
|
|
#endif // EVALUATION_H
|