These are chat archives for symengine/symengine

18th
May 2017
Shikhar Jaiswal
@ShikharJ
May 18 2017 10:20
@isuruf Regarding sympy/sympy#12653 , as far as I remember, SymEngine's parsing functionalities are only used through sympify function in SymEngine.py. So, would it not make sense to port over such functions to SymPy?
Isuru Fernando
@isuruf
May 18 2017 11:23
@ShikharJ, what do you mean?
In SymPy also, parsing is mostly used through sympify
Shikhar Jaiswal
@ShikharJ
May 18 2017 11:26
Probably I misunderstood your point. Anyways, so should we leave Parsing as it is?
Isuru Fernando
@isuruf
May 18 2017 11:35
Probably yes
Shikhar Jaiswal
@ShikharJ
May 18 2017 11:53
One of the issues I am facing is that we are currently exporting sympify as S and hence attributes such as S.One and S.Zero aren't recognized. I've tried using S(0) and S(1) instead, but that is leading to errors.
Isuru Fernando
@isuruf
May 18 2017 11:56
S.One and S(0) should be identical
Shikhar Jaiswal
@ShikharJ
May 18 2017 12:14
Here is the original log pushed to Travis:
https://travis-ci.org/ShikharJ/sympy/jobs/230652041
and this is the output that I obtained by making the above changes:
https://travis-ci.org/ShikharJ/sympy/jobs/233589903
Yingbo Ma
@YingboMa
May 18 2017 13:41
Hello, is there a functionality to construct a function symbol like f = Function('f') in SymPy?
Christopher Rackauckas
@ChrisRackauckas
May 18 2017 13:44
lambdify
oh wait
you want a function symbol, not a function from a symbol
my bad
Isuru Fernando
@isuruf
May 18 2017 17:13
You can do from symengine.sympy_compat import Function
Yingbo Ma
@YingboMa
May 18 2017 18:40
@isuruf Thanks
Oh, how do I do it in Julia?
Isuru Fernando
@isuruf
May 18 2017 18:45
Hmm, give me a minute
Isuru Fernando
@isuruf
May 18 2017 18:56
function Base.convert{T}(::Type{CVecBasic}, x::Vector{T})
    vec = CVecBasic()
    for i in x
       b::Basic = Basic(i)
       ccall((:vecbasic_push_back, libsymengine), Void, (Ptr{Void}, Ptr{Basic}), vec.ptr, &b)
    end
    return vec
end

function function_symbol(name::String, x::CVecBasic)
    a = Basic()
    ccall((:function_symbol_set, libsymengine), Void, (Ptr{Basic}, Ptr{Int8}, Ptr{Void}), &a, name, x.ptr)
    return a
end

function_symbol{T}(name::String, x::Vector{T}) = function_symbol(name, convert(CVecBasic, x))
Yingbo Ma
@YingboMa
May 18 2017 19:06
Thanks!
Yingbo Ma
@YingboMa
May 18 2017 20:22
Could you please add function symbol in SymEngine.jl? @isuruf