isuruf on master
Adding a Correct Path to the St… Update CONTRIBUTING.md Co-auth… Merge pull request #1947 from D… (compare)
Add
and if the coefficient is 0.0
, remove it
0
for expand(4.0*(x + y - (x+y)))
is totally fine
@isuruf Hi Isuru, long time no see! Was wondering if the following behavior is expected. Thanks!! (master
, ed7479baf59a36636061acc35b676bcf9073a932
)
int main() {
RCP<const Basic> a = symbol("a"), b = symbol("b"), c = symbol("c");
map_basic_basic d {{mul(a,b), c}};
RCP<const Basic> r1 = mul(SymEngine::integer(2), mul(a, b)),
r2 = add(SymEngine::integer(1), r1);
std::cout << *r1 << " -> " << *r1->subs(d) << std::endl;
std::cout << *r2 << " -> " << *r2->subs(d) << std::endl;
return 0;
}
produces
2*a*b -> 2*a*b
1 + 2*a*b -> 1 + 2*c
2*a*b*c -> 2*a*b*c
1 + 2*a*b*c -> 1+2*a*b*c
The new as_ctypes API enables some really nice solver accuracy improvements for us downstream
What's the difference between this and the cython one?