13 lines
355 B
C++
13 lines
355 B
C++
#include <eqpalg/exp_macro/delta.h>
|
|
#include <boost/regex.hpp>
|
|
#include <sstream>
|
|
std::string replace_delta_macro(std::string&& exp_str) {
|
|
boost::regex base_regex("delta\\((\\d+)\\)");
|
|
std::string plv;
|
|
std::stringstream ss;
|
|
ss << "abs(pv$1_1-pv$1_0)";
|
|
plv = ss.str();
|
|
auto ret = boost::regex_replace(exp_str, base_regex, plv);
|
|
return ret;
|
|
}
|