These are chat archives for symengine/symengine

11th
Dec 2015
Ralf Stephan
@rwst
Dec 11 2015 08:27

@isuruf : Today is even worse than yesterday.

symengine_wrapper.pyx:484:46: Compiler crash in AnalyseExpressionsTransform

At the moment I'm basically trying to brute-force the code space to find a combination that works.

Ralf Stephan
@rwst
Dec 11 2015 08:45
@isuruf Interesting. It could be that it has something to do with missing copy/constructor declarations in a cdef struct/cppclass.
In both cases the crash is in an assignment.
Ralf Stephan
@rwst
Dec 11 2015 09:15
The next problem is that I can work around the template ctypedef const problem by typedefing RCP[const Basic] to rcp_const_basic and using that throughout---but when I try to give it as argument to c2py Cython will not recognize that rcp_const_basic is identical to the c2py argument type:
symengine_wrapper.pyx:484:35: Cannot assign type 'rcp_const_basic' to 'RCP[Basic const ]'
Isuru Fernando
@isuruf
Dec 11 2015 13:11
@rwst, maybe changing all instances of RCP[const Basic] to rcp_const_basic would be a good idea right?
Ralf Stephan
@rwst
Dec 11 2015 13:37
@isuruf Yes but I have posted a question on the newsgroup and stated that I cannot change the function signature. Maybe they see from that better that Cython needs fixing ;-), or they even come up with a better workaround than that.
Ralf Stephan
@rwst
Dec 11 2015 13:54

@isuruf Let's assume the change you propose is done and c2py looks like:

cdef c2py(rcp_const_basic o):
    cdef Basic r
(long list of r = ...)
    r.thisptr = o
    return r

This does not compile, error:

    r.thisptr = o
                ^
symengine_wrapper.pyx:104:17: Cannot assign type 'rcp_const_basic' to 'RCP[Basic const ]'

So haven't we just only moved the problem elsewhere?

Ralf Stephan
@rwst
Dec 11 2015 14:07

OK, casting works via the obscure

<symengine.RCP[const symengine.Basic]>

so I don't need to convert everything.

Ralf Stephan
@rwst
Dec 11 2015 14:48
Does someone know how to turn off caching in SymPy? The solution in the FAQ (SYMPY_USE_CACHE=no) does not work.
Isuru Fernando
@isuruf
Dec 11 2015 15:16
@rwst, I was suggesting we change everywhere in symengine.py
Ralf Stephan
@rwst
Dec 11 2015 15:16
@isuruf did I not change everywhere?
Isuru Fernando
@isuruf
Dec 11 2015 15:17
In Basic also if thisptr was rcp_const_basic instead of RCP[const Basic] then that error won't be there right?
Ralf Stephan
@rwst
Dec 11 2015 15:22
I may have thought I changed everything but didn't. Some oddity of gvim I suspect.
Ralf Stephan
@rwst
Dec 11 2015 15:28
I'll try it again later. Atm it works using one single cast. @certik The numbers are now in isympy for sin(x)*cos(x) 8ms for N=100, and 770ms for N=1000, which is about 3 times faster than Sage(Pynac), 1-2 times faster than Pari, but 1 order of magnitude slower than Flint.
For N=1000 it's 10x faster than Sage.
Ralf Stephan
@rwst
Dec 11 2015 16:40

@isuruf How do I run tests locally? Atm I'm running isympy after installation of symengine.py and do:

In [1]: import symengine.tests
In [2]: symengine.test()

However my test py file gets simply aborted (other files pass). How can I get better diagnostics? I'm still a Python noob.

Isuru Fernando
@isuruf
Dec 11 2015 16:41
symengine.test is a way to check if symengine installation is successful.
For development testing, run nosetests -v or py.test -v from the root
To look at C++ exceptions, use a debug version of symengine with WITH_BFD=yes
Ralf Stephan
@rwst
Dec 11 2015 16:43
Will look sharper tomorrow, thanks.