GSoC Week 4 Progress

As week #4 comes to an end, the headway I made last week was lost, with lots of memory related errors. But in terms of experience it was quite a good week.

First of all, some loose ends of PR #51 in symengine.rb was tied up and it was merged, fully completing the FunctionSymbol functionality.

Next, as I explained in the previous blogpost, the evaluation methods were implemented. The method ‘evalf’ provides a single point to evaluate floating point values of mathematics expressions (real & complex), at a given precision.

This was the first time I was contributing code directly to the SymEngine’s C++ code. The coding part was pretty much straight-forward, as the method required only to get the expression to be evaluated, the precision needed, and whether it was a real number or not. Using these information, the evaluation was to be forwarded to eval_double, eval_mpfr, eval_complex_double or eval_mpc. But some memory leaks were present, costing me quite a lot of time to localize the errors and to rectify them.

Now, except for a certain case in the cwrapper tests, everything seems to be working fine, and the work can be checked out under PR #987 in symengine, and PR #55 in symengine.rb repository.

Also, during this week I was checking out the possible implementation of matrices for the Ruby Wrappers. I decided to interface SymEngine matrices to NMatrix through the Ruby API. So, for the starters I will be going ahead with the SymEngine::DenseMatrix class.

In Ruby, I plan to implement the following ways of implementing the DenseMatrix:

mat = SymEngine::DenseMatrix.new()
mat = SymEngine::DenseMatrix.new(SymEngine::DenseMatrix)
mat = SymEngine::DenseMatrix.new(NMatrix)
mat = SymEngine::DenseMatrix.new(Array)
mat = SymEngine::DenseMatrix.new(no_rows, no_columns)

Apart from the coding work, last week’s code reviews were an interesting part of the learning experience. I was reviewing code of Gaurav – another SciRuby GSoCer, who is also writing Ruby wrappers. Looking at his code and hearing what he had to tell about mine was quite interesting.

See you next week, hopefully with better news on the SymEngine matrices!

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s