These are chat archives for symengine/symengine

27th
May 2015
Abinash Meher
@abinashmeher999
May 27 2015 09:33

So this is what I found as a comment in ruby_gmp.h

/*
  MP_INT*, MP_RAT* and MP_FLOAT* are used because they don't have side-effects
  of single-element arrays mp*_t
  MP_FLOAT is defined here, as it's commented out in gmp.h
*/

@isuruf any idea?

Sumith Kulal
@Sumith1896
May 27 2015 17:33
While writing hash for Polynomial, I am basically expected to hash the map, right?
Ondřej Čertík
@certik
May 27 2015 23:03
@Sumith1896 right.
@abinashmeher999 yes, I think you are right that you need to allocate the struct on the heap.
That's what the Python wrappers, effectively, do as well.
What we should do is provide functions in the C API in symengine, that allocate this for you on the heap and return the pointer, and a function that frees it.
Anyone, feel free to ping me if you have any questions.