Skip to content

Commit 7deb81f

Browse files
committed
Tests work again, still problems further down examples/scalar_manipulations.cnb
1 parent 83f9e3f commit 7deb81f

File tree

7 files changed

+9
-4679
lines changed

7 files changed

+9
-4679
lines changed

core/Functional.hh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11

22
#pragma once
33

4+
#include <functional>
45
#include "Storage.hh"
56

67
namespace cadabra {

core/algorithms/map_sympy.cc

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,8 @@ bool map_sympy::can_apply(iterator st)
7272

7373
Algorithm::result_t map_sympy::apply(iterator& it)
7474
{
75+
// std::cerr << "Apply on " << tr << std::endl;
76+
7577
std::vector<std::string> wrap;
7678
wrap.push_back(head_);
7779

@@ -80,19 +82,17 @@ Algorithm::result_t map_sympy::apply(iterator& it)
8082
for(auto& fac: left)
8183
prod.append_child(prod.begin(), fac);
8284
auto top=prod.begin();
85+
// std::cerr << "Feeding to sympy " << prod << std::endl;
8386
sympy::apply(kernel, prod, top, wrap, "", "");
8487
// Now remove the non-index carrying factors and replace with
8588
// the factors of 'prod' just simplified.
86-
sibling_iterator ps=prod.begin(top);
87-
while(ps!=prod.end(top)) {
88-
tr.insert_subtree(*left.begin(), ps);
89-
++ps;
90-
}
91-
std::cerr << "Before erasing " << Ex(it) << std::endl;
89+
tr.insert_subtree(*left.begin(), top);
90+
// std::cerr << "Before erasing " << Ex(it) << std::endl;
9291
for(auto& kl: left)
9392
tr.erase(kl);
93+
// std::cerr << "After erasing " << Ex(it) << std::endl;
9494

95-
return result_t::l_no_action;
95+
return result_t::l_applied;
9696
}
9797
else {
9898
sympy::apply(kernel, tr, it, wrap, "", "");

0 commit comments

Comments
 (0)