problem in OPT++(C++ optimization toolbox)

D

Dark Wind

Hi,

I have been using OPT++ to solve a non linear programming problem. I
am totally new to C++, but I looked at an example given on OPT++
website and modified it according to my problem. But I am getting some
error there.

Since I don't have analytical derivatives, I am using FDNLF1 type of
problem and optimization method used is OptFDNIPS. I am getting
problem in the input arguments(function, constraints etc) of FDNLF1
which I constructed the way it is done in the example on opt++ website
(http://csmr.ca.sandia.gov/opt++/opt++2.4_doc/html/example2.html). But
that example uses NLF2 type of problem. Since I am totally new to C++,
I have no idea what is causing these errors. The error that I am
getting is :

--------------------------------------------------------- ERROR
MESSAGE----------------------------------------------------------------
example2.cpp: In function `int main()':
example2.cpp:24: error: no matching function for call to
`OPTPP::FDNLF1::FDNLF1(int&, void (&)(int, const
NEWMAT::ColumnVector&, double&, int&), void (&)(int,
NEWMAT::ColumnVector&), OPTPP::Constraint&)'
.../OPT++/optpp-2.4/include/NLF.h:388: note: candidates are:
OPTPP::FDNLF1::FDNLF1(const OPTPP::FDNLF1&)
.../OPT++/optpp-2.4/include/NLF.h:425: note:
OPTPP::FDNLF1::FDNLF1(int, void (*)(int, const NEWMAT::ColumnVector&,
OPTPP::real&, int&, void*), void (*)(int, NEWMAT::ColumnVector&),
OPTPP::CompoundConstraint*(*)(int), void*)
.../OPT++/optpp-2.4/include/NLF.h:422: note:
OPTPP::FDNLF1::FDNLF1(int, void (*)(int, const NEWMAT::ColumnVector&,
OPTPP::real&, int&, void*), void (*)(int, NEWMAT::ColumnVector&),
void*)
.../OPT++/optpp-2.4/include/NLF.h:419: note:
OPTPP::FDNLF1::FDNLF1(int, void (*)(int, const NEWMAT::ColumnVector&,
OPTPP::real&, int&, void*), void (*)(int, NEWMAT::ColumnVector&),
OPTPP::CompoundConstraint*, void*)
.../OPT++/optpp-2.4/include/NLF.h:415: note:
OPTPP::FDNLF1::FDNLF1(int, int, void (*)(int, const
NEWMAT::ColumnVector&, NEWMAT::ColumnVector&, int&), void (*)(int,
NEWMAT::ColumnVector&))
.../OPT++/optpp-2.4/include/NLF.h:411: note:
OPTPP::FDNLF1::FDNLF1(int, void (*)(int, const NEWMAT::ColumnVector&,
OPTPP::real&, int&), void (*)(int, NEWMAT::ColumnVector&),
OPTPP::CompoundConstraint*(*)(int))
.../OPT++/optpp-2.4/include/NLF.h:407: note:
OPTPP::FDNLF1::FDNLF1(int, void (*)(int, const NEWMAT::ColumnVector&,
OPTPP::real&, int&), void (*)(int, NEWMAT::ColumnVector&),
OPTPP::CompoundConstraint*)
.../OPT++/optpp-2.4/include/NLF.h:405: note:
OPTPP::FDNLF1::FDNLF1(int)
.../OPT++/optpp-2.4/include/NLF.h:403: note:
OPTPP::FDNLF1::FDNLF1()
tstfcn.cpp: In function `void ineq_hs65(int, const
NEWMAT::ColumnVector&, NEWMAT::ColumnVector&, int&)':
tstfcn.cpp:86: error: invalid operands of types `double' and `double'
to binary `operator^'
tstfcn.cpp:90: error: invalid operands of types `double' and `double'
to binary `operator^'
tstfcn.cpp:93: error: invalid operands of types `double' and `double'
to binary `operator^'
tstfcn.cpp:95: error: invalid operands of types `double' and `double'
to binary `operator^'
tstfcn.cpp:96: error: invalid operands of types `double' and `double'
to binary `operator^'
tstfcn.cpp:100: error: invalid operands of types `double' and `double'
to binary `operator^'
tstfcn.cpp:103: error: invalid operands of types `double' and `double'
to binary `operator^'
tstfcn.cpp:105: error: invalid operands of types `double' and `double'
to binary `operator^'
-------------------------------------------- END OF ERROR MESSAGE
-----------------------------------------------------------------

Is there anyone who has used this package(OPT++) and solved a non-
linear problem(non-linear objfun and constraints) without analytical
gradients. I would appreciate any help in this regard. Even an example
code for a general non-linear problem will help.

Thank you
 
F

fred.l.kleinschmidt

Hi,

I have been using OPT++ to solve a non linear programming problem. I
am totally new to C++, but I looked at an example given on OPT++
website and modified it according to my problem. But I am getting some
error there.

Since I don't have analytical derivatives, I am using FDNLF1 type of
problem and optimization method used is OptFDNIPS. I am getting
problem in the input arguments(function, constraints etc) of FDNLF1
which I constructed the way it is done in the example on opt++ website
(http://csmr.ca.sandia.gov/opt++/opt++2.4_doc/html/example2.html). But
that example uses NLF2 type of problem. Since I am totally new to C++,
I have no idea what is causing these errors. The error that I am
getting is :

--------------------------------------------------------- ERROR
MESSAGE----------------------------------------------------------------
example2.cpp: In function `int main()':
example2.cpp:24: error: no matching function for call to
`OPTPP::FDNLF1::FDNLF1(int&, void (&)(int, const
NEWMAT::ColumnVector&, double&, int&), void (&)(int,
NEWMAT::ColumnVector&), OPTPP::Constraint&)'
../OPT++/optpp-2.4/include/NLF.h:388: note: candidates are:
OPTPP::FDNLF1::FDNLF1(const OPTPP::FDNLF1&)
../OPT++/optpp-2.4/include/NLF.h:425: note:
OPTPP::FDNLF1::FDNLF1(int, void (*)(int, const NEWMAT::ColumnVector&,
OPTPP::real&, int&, void*), void (*)(int, NEWMAT::ColumnVector&),
OPTPP::CompoundConstraint*(*)(int), void*)
../OPT++/optpp-2.4/include/NLF.h:422: note:
OPTPP::FDNLF1::FDNLF1(int, void (*)(int, const NEWMAT::ColumnVector&,
OPTPP::real&, int&, void*), void (*)(int, NEWMAT::ColumnVector&),
void*)
../OPT++/optpp-2.4/include/NLF.h:419: note:
OPTPP::FDNLF1::FDNLF1(int, void (*)(int, const NEWMAT::ColumnVector&,
OPTPP::real&, int&, void*), void (*)(int, NEWMAT::ColumnVector&),
OPTPP::CompoundConstraint*, void*)
../OPT++/optpp-2.4/include/NLF.h:415: note:
OPTPP::FDNLF1::FDNLF1(int, int, void (*)(int, const
NEWMAT::ColumnVector&, NEWMAT::ColumnVector&, int&), void (*)(int,
NEWMAT::ColumnVector&))
../OPT++/optpp-2.4/include/NLF.h:411: note:
OPTPP::FDNLF1::FDNLF1(int, void (*)(int, const NEWMAT::ColumnVector&,
OPTPP::real&, int&), void (*)(int, NEWMAT::ColumnVector&),
OPTPP::CompoundConstraint*(*)(int))
../OPT++/optpp-2.4/include/NLF.h:407: note:
OPTPP::FDNLF1::FDNLF1(int, void (*)(int, const NEWMAT::ColumnVector&,
OPTPP::real&, int&), void (*)(int, NEWMAT::ColumnVector&),
OPTPP::CompoundConstraint*)
../OPT++/optpp-2.4/include/NLF.h:405: note:
OPTPP::FDNLF1::FDNLF1(int)
../OPT++/optpp-2.4/include/NLF.h:403: note:
OPTPP::FDNLF1::FDNLF1()
tstfcn.cpp: In function `void ineq_hs65(int, const
NEWMAT::ColumnVector&, NEWMAT::ColumnVector&, int&)':
tstfcn.cpp:86: error: invalid operands of types `double' and `double'
to binary `operator^'
tstfcn.cpp:90: error: invalid operands of types `double' and `double'
to binary `operator^'
tstfcn.cpp:93: error: invalid operands of types `double' and `double'
to binary `operator^'
tstfcn.cpp:95: error: invalid operands of types `double' and `double'
to binary `operator^'
tstfcn.cpp:96: error: invalid operands of types `double' and `double'
to binary `operator^'
tstfcn.cpp:100: error: invalid operands of types `double' and `double'
to binary `operator^'
tstfcn.cpp:103: error: invalid operands of types `double' and `double'
to binary `operator^'
tstfcn.cpp:105: error: invalid operands of types `double' and `double'
to binary `operator^'
-------------------------------------------- END OF ERROR MESSAGE
-----------------------------------------------------------------

Is there anyone who has used this package(OPT++) and solved a non-
linear problem(non-linear objfun and constraints) without analytical
gradients. I would appreciate any help in this regard. Even an example
code for a general non-linear problem will help.

Thank you

Your problem is on line 24 of example2.cpp

you are making a call to the function FDNLF1, passing it parameters
that do not match any existing FDNLF1 definitions.
 
D

Dark Wind

Thanks. I had an idea that problem is there. But in the error message
it is saying that I have passed int&(which I have no idea of) as the
first parameter. But I passed it an 'int' and not an int&. And in
other parameters also, I passed void () function, but here it says I
passed void(&). Any suggestions on this ?

Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top