I need to solve an optimization problem, which is defined in a Mathematica notebook.
Using Mathematica's FindMinimum
is not an option, because it is too slow. So, the idea is to use an external solver for quadratically constraint quadratic problems and use MathLink to get the constraints of the problem from Mathematica, calculate the solution, and return the solution to Mathematica.
And here is my problem: The constraints (quadratic and linear) are given to me as a list of expressions, e.g.
{ -1+(-0.363263+x)^2+(-0.329466+y)^2<=0,
-1+(-0.248721+x)^2+(0.451803 +y)^2<=0,
-1+(0.33444 +x)^2+(-0.41341+y)^2<=0,
-1+(0.414249 +x)^2+(0.384528 +y)^2<=0,
-1+(-0.65488+x)^2+(0.242478 +y)^2<=0,
-1+(-0.176244+x)^2+(0.30843 +y)^2<=0,
-1.4+x<=t, -0.5+y<=t, 0.4 -x<=t, -0.5-y<=t }
How do I deal with such a list in my C++ function? Do I need to change its template signature so that it takes a SymbolList instead of a RealList (as in my current version)?
Or is there a way to extract all the numbers in my constraint list and put them in a list in Mathematica?
FindMinimum is not an option, because it is too slow
is not justified. I'll remove the vote if you share some insight about the problem that justifies it $\endgroup$ – Dr. belisarius Sep 2 '12 at 22:06FindMinimum
, or chose a better algorithm. It were good if you would actually show to issue at hand. Even ifFindMinimum
is the actual bottleneck most likelyMathLink
is not the way to go. $\endgroup$ – user21 Sep 3 '12 at 9:18