11 std::string indent(
' ', indentwidth);
12 std::cout << indent <<
"Symmetric division\n"
13 << indent <<
" first operand\n";
16 std::cout << indent <<
" second operand\n";
21 std::vector<std::shared_ptr<Base> > first, second;
25 for (
auto item: first) {
26 item->divideBy(second);
27 bfuncs.emplace_back(item->clone());
30 for (
auto item: first)
36 for (
auto item: second) {
37 item->divideBy(first);
38 bfuncs.emplace_back(item->clone());
41 for (
auto item: first)
43 for (
auto item: second)
51 std::regex argumentList(
"(,[a-z]+\\(.*)");
52 std::regex endParenthesis(
"\\)(.*)");
55 std::string str(it,
end);
56 if (!std::regex_match(str, what, argumentList))
return false;
62 str = std::string(it,
end);
63 if (!std::regex_match(str, what, endParenthesis))
return false;
65 std::string fullMatch = what[0];
66 std::string rest = what[1];
68 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)