These are chat archives for symengine/symengine

15th
May 2015
Isuru Fernando
@isuruf
May 15 2015 03:22

For 1, if I use a singleton, like

Evaluate& RealDouble::get_eval() const {
    static EvaluateDouble evaluate_double;
    return evaluate_double;
}

Then it is faster than 3.

Isuru Fernando
@isuruf
May 15 2015 03:32
I meant for 3, If I use a singleton it is faster than 1
Isuru Fernando
@isuruf
May 15 2015 06:55
In SymEngine there are lots of code that is similar to rcp_static_cast<const Rational>(b)->i where an RCP object is made and then discarded. Isn't it better to just do static_cast<const Rational &>(*b).i?
If we need to make checks in Debug mode (#426) we can introduce a function that does the casting.
Ondřej Čertík
@certik
May 15 2015 18:02
Yes, for sure --- I was thinking that each static_cast in symengine can be checked in Debug mode.
And we should simply be using them and avoid operations on RCP.
Isuru Fernando
@isuruf
May 15 2015 18:04
can we check static_cast in Debug mode with a compiler flag? If not we'll need a function that does casting, but do the check on Debug mode
Ondřej Čertík
@certik
May 15 2015 18:05
I was thinking we should add a function that does that.
See also #445 for similar ideas.
Isuru Fernando
@isuruf
May 15 2015 18:17
symengine_static_cast?