symengine / symengine.R

A R interface to the symbolic manipulation library SymEngine.
27 stars 8 forks source link

install script should use openMp by default? #44

Open mattfidler opened 5 years ago

mattfidler commented 5 years ago

The Mac/Windows toolchains for R have openMP support, so I think you should enable it in the default install script to add speed gains.

isuruf commented 5 years ago

OpenMP support in symengine is minimal. It only parallelize operations over matrices and if you don't use matrices, it will not help at all.

mattfidler commented 5 years ago

I actually do use matricies, I had forgotten; Are they supported in symengine.R?

It seems it isn't yet:

> S("Matrix([[a, b], [c, d]])")
(FunctionSymbol)    Matrix(a, b, c, d)
Marlin-Na commented 5 years ago

@mattfidler It is supported:

Matrix(LETTERS[1:4], 2, byrow = TRUE)
mattfidler commented 5 years ago

Ah; OK;

>Matrix(LETTERS[1:4], 2, byrow = TRUE)
> x
DenseMatrix of dim 2 x 2
[A, B]
[C, D]

So the operations for symengine would be the R operators. t etc.

> x %*% t(x)
[A**2 + B**2, A*C + B*D]
[A*C + B*D, C**2 + D**2]
mattfidler commented 5 years ago

The additional openMp parallelization would be minimal, but possibly worthwhile? Anyhow, thanks for the information. I will let you decide.

Marlin-Na commented 5 years ago

@mattfidler I will keep this issue open and possibly enable it in future.