#include "mix_cc/matheval.h" #include #include #include #include namespace mix_cc { namespace dataframe { namespace detail { class inner_exp { public: void init(std::string& exp_str, int tag_count) { this->exp_str = exp_str; this->exp_parser.parse(exp_str); } double calc(const Eigen::Block& row) { this->load_row_to_buffer(row); return this->calc(); } protected: void load_row_to_buffer( const Eigen::Block& row) { tmp_data["time"] = row(0); for (auto i = 1; i < row.size(); i++) { tmp_data["tag" + std::to_string(i)] = row(i); } } double calc() { exp_parser.evaluate(tmp_data); } std::map tmp_data; std::string exp_str; matheval::Parser exp_parser; }; } // namespace detail } // namespace dataframe } // namespace mix_cc