CPLEX equivalent C++ of cplexmiqp MATLAB - c++

I have a matlab script, which uses Cplex, to implement in C++. Does the C++ equivalent of the toolbox function cplexmiqp exist ?
If not, how can I solve my problem? I only have the parameters needed to this function to solve the MIP problem (H, f, Aineq, bineq, Aeq, beq, sostype, sosind, soswt, lb, ub, ctype)

cplexmiqp is a convenience function in the CPLEX MATLAB Toolbox API. There is nothing exactly equivalent to this in the C++ API. However, the C++ API is actually more powerful/flexible and you can definitely accomplish the same task. You'll have to build the model using your input data, solve it, and query the solution using methods in the C++ API. I'd suggest that you take a close look at the ilomiqpex1.cpp example that is shipped with CPLEX.

Related

Calling MATLAB from C without using Coder?

So I'm currently working on a project where I'm trying to call a MATLAB algorithm from C++ because we're trying to have the final application work on an iOS device.
Is there a way to call that MATLAB code that's been written from C++ without using MATLAB coder?
I've looked into using coder.ExternalDependency class and the official documentation but that uses MATLAB coder and I am trying to avoid that.
I also looked into using feval but all of the examples I could find online were only using pre-built in MATLAB functions like gcd - can I use feval with functions that I wrote myself to call from C++, or do they have to be functions already existing in MATLAB?
Or if anyone has any other suggestions on how to call a MATLAB function in a C++ program that would be great.

Calling R functions from C++

I want to perform multinomial logistic regression [using glm()] and do some graphs [gplot()] in C++.
I'm not able to write a function for this kind of regression in C++, but maybe is possible to open R and call glm() function in order to performe it inside of C++, is it? how? I would appreciate any idea.
Thanks in advance!
Yes you can via the RInside project which provides you with a (very simple) class R which instantiates the R interpreter. You can then pass commands as (possibly multi-line) strings and evaluate via the REPL.
There are numerous examples in the package itself, and on different blog posts. As it uses Rcpp extensively, it is also covered in one chapter of the Rcpp book.

Implementing MATLAB function in c++ using Intel C++ compiler

I have developed a MATLAB program with Visual C++. I am using IntelĀ® Integrated Performance Primitives because speed of program is important issue and I have done a lot of efforts for implementing some MATLAB functions. For example, for Min and Max functions over a vector i use ippsMaxIndx_32f; but, there is function in MATLAB like Find.
Here is a description of the Find method in MATLAB:
Description
I need a function which implements this find function of MATLAB with high speed.
Are there any functions inside Intel Ipp, that works like the Find function in MATLAB?
I've never heard of a comprehensive port of matlab functionality to C++. That being said, almost everything matlab does exists within a C/C++ library somewhere, some off the top of my head:
LAPACK, BLAS, and there are a few good implementations, the most notable (free) one being ATLAS.
FFT is implemented in matlab via the fftw library
There are loads of fast open-source image libraries out there, ie. interpolation, filtering.
There are really good OOP matrix libraries out there, boost has a nice one.\
After that, well figure out what you need and there is a good chance someone has implemented it in C/C++.
You can check to these to see if you can find the function you are looking for! As i am not sure for that.
I've used ippsFind_* and they have worked just fine.

Calling MATLAB or Scilab function from C++ project

I'm trying to access some Scilab functions from my C++ project. I'm working on Windows 7. How can I do that.?
For example,
function [r] = fun(a,b)
r =a+b;
endfunction
How can I tell my C++ project, it should run the Scilab function "fun" and give the parameter a=4, b=9. so that I get their value?
If somebody did this for MATLAB, I think this will be the same here (without using its engine).
A lead would be to use Julia that is quite similar to MATLAB. I'm not sure it's possible yet to compile to a library. The project is based on LLVM so maybe you can generated C code and integrate it with your code.
For MATLAB, you can use the MATLAB compiler, and you should be able find some examples on the MATLAB website.
You will need the Scilab runtime aside, but call_scilab is probably what you are looking for.

Implement matlab code in C++?

I have a certain code written in Matlab. I wanted to obtain similar results using a c++ code. I wanted to know whether a c++ library exists for matrix manipulations? My current Matlab code consists of matrix multiplications,inverse and complements.
There are dozens of linear algebra libraries for C++. Here is another one not mentioned in the other links so far:
http://www.alglib.net/
I have used Newmat in a similar situation.
Not sure if this would help you, or your company/university have licenses for it but matlabcoder can export your matlab code to c++ without much extra work.
http://www.mathworks.com/products/matlab-coder/