Path: news.mathworks.com!not-for-mail
From: "David Doria" <daviddoria@gmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Call a MEX function from Matlab Engine?
Date: Sat, 15 Mar 2008 18:19:01 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 28
Message-ID: <frh3ul$qi1$1@fred.mathworks.com>
References: <frc4bp$ipi$1@fred.mathworks.com> <frc7ir$s19$1@fred.mathworks.com> <frccfq$l2f$1@fred.mathworks.com> <frch5p$bdj$1@fred.mathworks.com> <frdvs6$lim$1@fred.mathworks.com> <fre31g$bk1$1@fred.mathworks.com> <fre6af$jpp$1@fred.mathworks.com> <frftgn$630$1@fred.mathworks.com> <frgbgs$hn8$1@fred.mathworks.com> <frh2lf$i59$1@fred.mathworks.com>
Reply-To: "David Doria" <daviddoria@gmail.com>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1205605141 27201 172.30.248.37 (15 Mar 2008 18:19:01 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Sat, 15 Mar 2008 18:19:01 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1105197
Xref: news.mathworks.com comp.soft-sys.matlab:457408



Sorry I was not clear.  The actual c++ function I want to
minimze is

double CostFunction();

CostFunction() calls many other functions such as
DistanceToPoint(), DistanceToPolygon() blah blah and also
records alot of things that are globals for the sake of the
OpenGL portion of my program. Also, these Distance()
functions that I mention rely on alot of classes that I
wrote such as 
class Polygon
class Edge
etc

I don't see how I can mex call of those things.  Maybe I
simply can't do this.  I found a package called GSL (GNU
scientific library) that has some unconstrained
minimization, and also a package for GSL called OOL (Open
Optimization Library) that contains some basic constrained
minimization functions.  These seem to work fine, but I
would have like to confirm their results with the matlab
fminunc() and fmincon() functions.

Thanks for all your help - at least I learned alot about mex
even if I can't apply it to this problem!

David