Skip to content

SymEngine.R: Symbolic Computation in R

Marlin NȺ edited this page Dec 25, 2017 · 5 revisions

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 defferentiation, 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

This project idea is proposed by Jialin Ma <ma95.jl@gmail.com>. Isuru Fernando <isuruf@gmail.com> is willing to mentor on the symengine side. If you are interested in serving as an additional mentor please check out the current prototype and contact us.

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.

Clone this wiki locally