These are chat archives for symengine/symengine

15th
Dec 2016
Isuru Fernando
@isuruf
Dec 15 2016 03:36
@bollu, SymEngine internally allocates memory dynamically. Is that going to be a problem?
To make it threadsafe, add -DWITH_SYMENGINE_THREAD_SAFE=yes to cmake when building symengine if you are compiling it yourself. Ubuntu ppa package and conda package is compiled with that option
Siddharth
@bollu
Dec 15 2016 07:27
it shouldn't be, but again, I don't fully understand the interactions right now
I'll investigate further and get back to you
Siddharth
@bollu
Dec 15 2016 08:00
@isuruf are you around? I wanted some clarification with the memory contract
like, if I want to call
```
CWRAPPER_OUTPUT_TYPE basic_add(basic s, const basic a, const basic b);
basic s should be allocated with basic_new_heap right?
Isuru Fernando
@isuruf
Dec 15 2016 13:34
@bollu, or with basic_new_stack
aneesh2312
@aneesh2312
Dec 15 2016 13:44
I would like to contribute to symengine. I know C++. I tried to go through the code on GitHub, but don't know exactly where to start. Can someone guide me?
Siddharth
@bollu
Dec 15 2016 14:21
@isuruf ah, right.
@isuruf : quick question: on the Haskell side, I observe that
x * (v - 1) != x * v - x * 1
I'm writing a minimal test case to reproduce this
x and v are symbols
but is this considered a bug?
@aneesh2312 go take a look at issues tagged "easy to fix". Here is a link
if you have specific interests, please do tell!
Siddharth
@bollu
Dec 15 2016 14:57
@isuruf code to repro bug is in a gist here
Isuru Fernando
@isuruf
Dec 15 2016 14:57
@bollu, that is intended. symengine/symengine#207
Siddharth
@bollu
Dec 15 2016 14:59
@isuruf ah, okay
Isuru Fernando
@isuruf
Dec 15 2016 15:00
basically, == is not mathematical equality, but structural equality
Siddharth
@bollu
Dec 15 2016 15:00
ahh, interesting
so what should I use to check mathematical equality?
Isuru Fernando
@isuruf
Dec 15 2016 15:00
there's not such function in symengine yet, though sympy has some
Siddharth
@bollu
Dec 15 2016 15:00
^ I was testing whether the ring axioms hold
hm
Isuru Fernando
@isuruf
Dec 15 2016 15:01
for your use case, just check whether expand(a - b) == 0
Siddharth
@bollu
Dec 15 2016 15:02
oh, okay, thank you :)
Siddharth
@bollu
Dec 15 2016 15:07
so, in the future, will there be such a function?
Isuru Fernando
@isuruf
Dec 15 2016 15:08
yes
Siddharth
@bollu
Dec 15 2016 18:54
are there element-wise multiplication functions in symengine for matrices? I don't see them
may I add them?
I
I'm trying to maintain API compatibility with haskell's "native" matrix library (hmatrix)
it uses (*) as element wise multiplication
and so on
Siddharth
@bollu
Dec 15 2016 19:15
also, what about shapes? like, auto scaling a 1x1 matrix to fit the shape of a differently shaped matrix? (the way numpy does)
Siddharth
@bollu
Dec 15 2016 20:03
is there expand for matrices?
Kalevi Suominen
@jksuom
Dec 15 2016 20:14
Yes, there is, in sympy.matrices.matrices. It simply applies expand to each entry.
Siddharth
@bollu
Dec 15 2016 20:15
but is it implemented in SymEngine?
I'm writing the FFI to Haskell

also, it appears (through the FFI) that

[0, 2]
[4, 6]

gives divide by zero on me trying to invert it though it isn't singular

I haven't tried to reproduce this in C
but, am I missing something basic?