Skip to content

Commit

Permalink
formatting issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Upabjojr committed Nov 26, 2018
1 parent 38492fc commit 4734400
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions matchpygen/example_yield.cpp
Expand Up @@ -11,16 +11,17 @@
using namespace std;
using namespace SymEngine;

typedef map<string, RCP<const Basic> > Substitution2;
typedef map<string, RCP<const Basic>> Substitution2;

int try_add_variable(Substitution2 &subst, string variable_name,
RCP<const Basic> &replacement)
{
if (subst.find(variable_name) == subst.end()) {
subst[variable_name] = replacement;
//this[variable_name] = replacement; //.copy() if isinstance(replacement, Multiset) else replacement
// this[variable_name] = replacement; //.copy() if
// isinstance(replacement, Multiset) else replacement
} else {
//Node &existing_value = *(this->find(variable_name));
// Node &existing_value = *(this->find(variable_name));
/*
if (isinstance(existing_value, tuple)) {
if (isinstance(replacement, Multiset)) {
Expand Down Expand Up @@ -51,7 +52,7 @@ int try_add_variable(Substitution2 &subst, string variable_name,
return 0;
}

typedef deque<RCP<const Basic> > Deque;
typedef deque<RCP<const Basic>> Deque;

Deque get_deque(RCP<const Basic> expr)
{
Expand Down Expand Up @@ -92,8 +93,8 @@ class match_root
}
(*this.*current)();
if (yield_queue.size() > 0) {
shared_ptr<YieldType> front = make_shared<YieldType>(
yield_queue.front());
shared_ptr<YieldType> front
= make_shared<YieldType>(yield_queue.front());
yield_queue.pop_front();
return front;
}
Expand Down Expand Up @@ -223,7 +224,6 @@ class match_root
{
current = NULL;
}

};

int main(int argc, char *argv[])
Expand All @@ -238,12 +238,12 @@ int main(int argc, char *argv[])

shared_ptr<tuple<int, Substitution2>> result = matcher.next();
std::cout << "Result for " << expr->__str__() << " is " << get<0>(*result)
<< std::endl;
<< std::endl;

matcher = match_root(y);
result = matcher.next();
std::cout << "Result for " << y->__str__() << " is " << get<0>(*result)
<< std::endl;
<< std::endl;

matcher = match_root(x);
result = matcher.next();
Expand Down

0 comments on commit 4734400

Please sign in to comment.