GSoC Summary - isuruf/symengine GitHub Wiki

##GSoC Summary

As the GSoC progressed, my project turned out to be a bit different than what I set out to do at the beginning. To summarize what I did,

###CMake Package SymEngine is using CMake as its build tool and to build SymEngine in Sage environment, CMake needed to be built first in Sage. Ticket at Sage to build CMake is at trac#18078. Main issue was that CMake, although supports a number of compilers, building CMake itself is supported by only a few compilers, in the case of OS X only Clang. Sage was using its own gcc to compile C/C++ projects. Details about patches needed are in my blog.

Now that trac#18078 is accepted, you can just do,

./sage -i cmake

to install the CMake package in Sage.

###Floating point support SymEngine had no floating point objects. Evaluations could only be done using Arb, an arbitrary precision ball arithmetic library. Since Arb was only an optional package in Sage, to minimize the dependencies, we decided to provide floating point support in the form of std::double, std::complex<std::double> for machine precision reals and complex numbers and MPFR and MPC libraries for arbitrary precision real and complex floats respectively.

Pull requests for adding floating point support for SymEngine are, #431, #432, #439, #446, #448, #456, #459, #465, #466, #467, #504, #561, #565 which included, RealDouble, ComplexDouble, RealMPFR and ComplexMPC classes.

In [1]: from symengine import *

In [2]: a = sqrt(2)**sin(5)

In [3]: a.n(real=True) # Uses std::double for evaluations when real=True, else uses std::complex<std::double>
Out[3]: 0.7172449759998334

In [4]: a.n(100, real=True) # Uses MPFR since machine precision is 53 bits ( < 100 bits)
Out[4]: 0.71724497599983341922006695239656                                                                                      
                                                                                                                                
In [5]: b = asin(100)                                                                                                        
                                                                                                                                
In [6]: b.n(100) # Uses MPC since machine precision is 53 bits ( < 100 bits )                                                                                                               
Out[6]: 1.5707963267948966192313216916397 + 5.2982923656104845907016668349453*I

In [7]: b.n() # Default precision of 53 bits uses std::complex<std::double>
Out[7]: 1.5707963267949 + 5.29829236561048*I 

###Python Wrappers Wrapping more functionality into Python, #433, #525, #526, #534, #538 which included wrapping hyperbolic functions, adding more methods like __getitem__ for Matrices and making the wrappers usable from other Cython modules.

###Building in OS X and Windows Patches to build and test in OS X and Windows, #473, #547, #552, #553, #560 and #564 where patches for support for OS X and Windows including MinGW and MinGW-w64 were introduced.

###Continuous Integration - OS X and Windows