SymEngine.R: Symbolic Computation in R - rstats-gsoc/gsoc2018 GitHub Wiki

Background

SymEngine is a standalone fast C++ symbolic manipulation library, which provides a fast computer_algebra_system , which is a lack in R. It has wrappers in several other languages, namely C, Python, Ruby, Julia and Haskell.

A prototype has been implemented at https://github.com/marlin-na/symengine.R

Related work

  • There are several functions in base R for differentiation, integration, solving system of equations, etc. E.g. `solve`, `stats::D`, `stats::deriv`, `stats::integrate`, `stats::numericDeriv`.
  • R package Deriv for symbolic differentiation, it allows user to supply custom rules for differentiation.
  • R package numDeriv for calculating numerical approximations to derivatives.
  • R package gmp and Rmpfr provide multiple precision arithmetic and floating point operations. They also include some special functions, e.g. Rmpfr::integrateR for numerical integration.
  • R package mpc available at R forge. It provides multiple precision arithmetic for complex numbers.
  • R package rSymPy provides an interface to ‘SymPy’ library in python via rJava.
  • R package Ryacas provides an interface to the ‘Yacas’ computer algebra system. It is easier to install compared to `rSymPy`.

Details of your coding project

TODO

Expected impact

The project is expected to provide a fast computer algebra system and a seamless interface within R. It may also serve as an alternative interface to gmp, mpfr, mpc libraries. The matrix system offered by SymEngine is also valuable for statistical computing.

Mentors

Possible mentors:

  • Jialin Ma <[email protected]> proposed the project idea and implemented the prototype.
  • Isuru Fernando <[email protected]> is one of the authors of symengine.
  • Hans W Borchers <[email protected]>, author of R package “pracma” and “numbers”, mentor of previous R-GSoC projects including “RMaxima” in 2012.

Tests

You’ll have to store a pointer to SymEngine objects. For the test assume a SymEngine object is like below,

typedef struct {
    double A;
    double B;
} CStruct;

Come up with a solution to create a struct, update the struct, delete the struct and showing the contents of the struct from R.

Solutions of tests

Students, please post a link to your test results here.

Xin Chen (https://github.com/irexyc/test-symengine.R)

⚠️ **GitHub.com Fallback** ⚠️