These are chat archives for symengine/symengine

14th
Jul 2017
Ranjith Kumar
@ranjithkumar007
Jul 14 2017 04:56
@isuruf , Is the following design fine for #1309?
template <typename Func>
class BottomUpVisitor : public BaseVisitor<BottomUpVisitor<Func>>
{
private:
    RCP<const Basic> result_;
    Func f;

public:
    BottomUpVisitor(const Func &f_) : f(f_){}
};

inline RCP<const Basic> identity(const RCP<const Basic> &arg) { return arg; }

class ExpandasExp : public BaseVisitor<ExpandasExp, BottomUpVisitor<decltype(&identity)>>
{
public:
    using BottomUpVisitor::bvisit;

    ExpandasExp() : BaseVisitor<ExpandasExp, BottomUpVisitor<decltype(&identity)>>(&identity){}

    template<typename T> // Overload for Sin etc..
    void bvisit(const T &x)
    {
        ...
        result_ = x.expand_as_exp();
        ...
    }
};
Shikhar Jaiswal
@ShikharJ
Jul 14 2017 16:20
@isuruf What can be done regarding the Singleton registry issue in sympy/sympy#12655 ?