These are chat archives for symengine/symengine
lambdifyconverts the sympy expression to a numpy expression.
ufuncifymakes a numpy ufunc. All of these take in a vector.
lambdifyis only good if the compile time is a bottleneck.
ufuncifycompiles the function, but since Julia has JIT compilation, you don't need that
I also want to make sure it's an in-place op afterwards:
function Base.ctranspose(p::LotkaVoltera) = (t,u,J) -> begin J[1,1] = p.a-p.b J[1,2] = -p.b J[2,1] = u J[2,2] = -3 + u end
where the RHS are the functions I got from the symbolic derivatives. It seemed that all of the functions would return a matrix instead.
SymPy.jl. In SymPy, default matrix type is
MutableDenseMatrixwhich is mutable
difffunction with SymEngine and it should work.
SymEngine.jluses the cwrappers here. https://github.com/symengine/symengine/blob/master/symengine/cwrapper.h . Matrix functionality is not yet wrapped into Julia, but that should be easy with
expand6bbenchmark in the pdf I gave, Maple has a spike probably because of garbage collection.