GSoC 2016 – All set to go

GSoC Coding period is about to start next week.

The past week I was focused on completing the NTheory Ruby wrappers, in order to complete my promised workload for the pre-coding time.

 

The main lessons learnt from this week’s work was handling conversions between Ruby and C types. This proved to be a quite easy task, with the Ruby C API.

The Definitive Guide to Ruby’s C API covers this in detail.

Then I had to figure out how to let SymEngine Integers to be implicitly convertible into Ruby numeric types. This proved tricky for me to get around as I wasn’t aware that it could be done in the actual Ruby code, without having to use the Ruby C API. The implicit conversion to Ruby numeric types was quite easy.

As shown in the gist above, I just had to declare the class in the lib folder with the necessary conversion method.

With this part done, several number theory functions can now be called upon SymEngine Integers. Those functions are:

  • GCD
  • LCM
  • Mod
  • Next Prime
  • Quotient
  • Fibonacci Number
  • Lucas Number
  • Binomials

Now that this part is done, the next step would be to start coding from next Monday. From my proposed plan, the first two weeks would be for wrapping Complex Numbers and Floating Point Numbers for Ruby.

See you after the first week.

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 )

Google photo

You are commenting using your Google 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 )

Connecting to %s