MATLAB functions in C ++

Does anyone know a resource where we can get FREE C ++ libraries for MATLAB functions? For example, problems with linear algebra can be solved using LAPACK and BLAS.

In addition, MATLAB in the .NET project is out of the question - I'm talking about direct C ++ implementations of the popular MATLAB functions (I don’t know what functions I need in C ++, but the functions used are not going to be esoteric).

Any suggestions on such resources?

+5
c ++ matlab visual-c ++ - 2005
source share
5 answers

I have never heard of the comprehensive Matlab functions interface for C ++. This suggests that almost all matlab exists in the C / C ++ library somewhere, some from my head:

  • LAPACK, BLAS, you already mentioned this, and there are some good implementations, the most noticeable (free) - ATLAS .
  • FFT implemented in Matlab through the fftw library
  • There are many fast open source image libraries, i.e. interpolation, filtering.
  • There are really good OOP matrix libraries, boost has a nice option.

After that, figure out what you need well, and there is a good chance that someone has implemented it in C / C ++.

+9
source share

I also like

  • Armadillo (templated C ++ library)
  • Eigen (another C ++ boilerplate library)
  • Newmat (older but well-tested C ++ matrix library)

Also, your original question is not specific enough for the best pointers.

+5
source share

Sorry to restore the old question, but I'm currently working on an open source C ++ library that answers this question exactly:

KeyCpp is an open source C ++ library that provides the MATLAB / Octave syntax as several useful numerical methods, as well as some graphing functions. Currently there are functions for eig , ode45 , fft , linsolve , svd , interp1 , plot and many other common MATLAB functions.

Although there are other (very good) libraries that provide many of these functions (such as Armadillo, Eigen, etc.), most of them are not complete numerical libraries, and most of their syntax is incompatible with MATLAB syntax. Although KeyCpp is also not a complete numerical library (but it is improving all the time!), The syntax is close to MATLAB, as C ++ allows.

In KeyCpp, we use the following syntax to construct the t and y vectors: (Go here for a more extensive example)

 #include <iostream> #include <keycpp/keycpp.h> using namespace keycpp; int main(int argc, char** argv) { // Lets create some data: y = sin(t) std::vector<double> t = linspace(-pi,pi,100); std::vector<double> y = sin(t); Figure h; h.plot(t,y,"-b"); h.grid_on(); h.legend({"Series 1"}); h.title("Example Plot"); h.xlabel("time"); h.ylabel("y"); return 0; } 

Plot output from example.

The KeyCpp library functionality takes advantage of LAPACK, Gnuplot, and odeint (from Boost). The following open source projects have been included in this library: Kiss FFT, Gnuplot-cpp.

Doxygen documentation for most features is here.

+4
source share

Besides the good suggestions already proposed, you can also pick up the code you need from the Octave or Scilab source code. However, both of them have GPL-style licenses that may not suit your needs.

+2
source share

Read the Matlab documentation carefully and try to find the DLL and other components that it installs on your hard drives. I think you will find that Matlab uses the BLAS version for BLAS, possibly also LAPACK and others.

0
source share

All Articles