Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

is it possible to use Eigen with c?

Tags:

c

eigen

I don't know very much about template programming, and I currently use gsl. I'm interested in seeing if Eigen can be use in C. Has anybody used Eigen in C before? Is there something I can test to find out if it will be easy?

like image 958
csta Avatar asked May 11 '12 20:05

csta


People also ask

How do I add Eigen to C++?

go to codeblocks Settings-> complier-> Search Directories-> Add-> enter the address of the folder you chose in (1)-> o.k. declare #include "Eigen/Dense" before the main function.

Is Eigen header only?

ARPACK-Eigen is implemented as a header-only C++ library, whose only dependency, Eigen, is also header-only.

Does Eigen use Blas?

Eigen: Using BLAS/LAPACK from Eigen. Since Eigen version 3.3 and later, any F77 compatible BLAS or LAPACK libraries can be used as backends for dense matrix products and dense matrix decompositions.

Why do we use Eigen fast?

For operations involving complex expressions, Eigen is inherently faster than any BLAS implementation because it can handle and optimize a whole operation globally -- while BLAS forces the programmer to split complex operations into small steps that match the BLAS fixed-function API, which incurs inefficiency due to ...


2 Answers

Since Eigen is a C++ template library, it cannot be directly used with C.

Hypothetically, one could wrap the C++ templates into a C API, and use that. However, that's bound to involve a lot of work and would strike me as a bit pointless (one might as well use existing C libraries for linear algebra).

like image 142
NPE Avatar answered Oct 10 '22 05:10

NPE


AFAIK, Eigen is a template-only library. C doesn't support templates. So without writing a bunch of wrapper functions that expose a C-style interface, no.

like image 35
Oliver Charlesworth Avatar answered Oct 10 '22 05:10

Oliver Charlesworth