3#include <boost/regex.hpp>
7 std::string indent(
' ', indentwidth);
8 std::cout << indent <<
"Symmetric division\n"
9 << indent <<
" first operand\n";
12 std::cout << indent <<
" second operand\n";
17 std::vector<std::shared_ptr<Base> > first, second;
21 for (
auto item: first) {
22 item->divideBy(second);
23 bfuncs.emplace_back(item->clone());
26 for (
auto item: first)
32 for (
auto item: second) {
33 item->divideBy(first);
34 bfuncs.emplace_back(item->clone());
37 for (
auto item: first)
39 for (
auto item: second)
47 boost::regex argumentList(
"(,[a-z]+\\(.*)");
48 boost::regex endParenthesis(
"\\)(.*)");
51 std::string str(it,
end);
52 if (!boost::regex_match(str, what, argumentList))
return false;
58 str = std::string(it,
end);
59 if (!boost::regex_match(str, what, endParenthesis))
return false;
61 std::string fullMatch = what[0];
62 std::string rest = what[1];
64 it += (fullMatch.size() - rest.size());
PartBunchBase< T, Dim >::ConstIterator end(PartBunchBase< T, Dim > const &bunch)
std::string::iterator iterator
virtual void apply(std::vector< std::shared_ptr< Base > > &bfuncs)=0
static bool parse(iterator &it, const iterator &end, Function *&fun)
virtual void print(int indent)=0
Function * firstOperand_m
Function * secondOperand_m
virtual void print(int indentwidth)
virtual void apply(std::vector< std::shared_ptr< Base > > &bfuncs)
static bool parse_detail(iterator &it, const iterator &end, Function *&fun)