資源簡介
自己建立的基于VS2008的IPOPT工程文件,包含了一個簡單的優化問題的例子,可為使用IPOPT提供一些參考。

代碼片段和文件信息
//?Copyright?(C)?2005?2009?International?Business?Machines?and?others.
//?All?Rights?Reserved.
//?This?code?is?published?under?the?Eclipse?Public?License.
//
//?$Id:?hs071_main.cpp?1864?2010-12-22?19:21:02Z?andreasw?$
//
//?Authors:??Carl?Laird?Andreas?Waechter?????IBM????2005-08-10
#include?“IpIpoptApplication.hpp“
#include?“hs071_nlp.hpp“
//?for?printf
#ifdef?HAVE_CSTDIO
#?include?
#else
#?ifdef?HAVE_STDIO_H
#??include?
#?else
#??error?“don‘t?have?header?file?for?stdio“
#?endif
#endif
using?namespace?Ipopt;
int?main(int?argv?char*?argc[])
{
??//?Create?a?new?instance?of?your?nlp
??//??(use?a?SmartPtr?not?raw)
??SmartPtr?mynlp?=?new?HS071_NLP();
??//?Create?a?new?instance?of?IpoptApplication
??//??(use?a?SmartPtr?not?raw)
??//?We?are?using?the?factory?since?this?allows?us?to?compile?this
??//?example?with?an?Ipopt?Windows?DLL
??SmartPtr?app?=?IpoptApplicationFactory();
??//SmartPtr?app?=?new?IpoptApplication();
??//?Change?some?options
??//?Note:?The?following?choices?are?only?examples?they?might?not?be
??//???????suitable?for?your?optimization?problem.
??app->Options()->SetNumericValue(“tol“?1e-7);
??app->Options()->SetStringValue(“mu_strategy“?“adaptive“);
??app->Options()->SetStringValue(“output_file“?“ipopt.out“);
??//?The?following?overwrites?the?default?name?(ipopt.opt)?of?the
??//?options?file
??//?app->Options()->SetStringValue(“option_file_name“?“hs071.opt“);
??//?Intialize?the?IpoptApplication?and?process?the?options
??ApplicationReturnStatus?status;
??status?=?app->Initialize();
??if?(status?!=?Solve_Succeeded)?{
????printf(“\n\n***?Error?during?initialization!\n“);
????return?(int)?status;
??}
??//?Ask?Ipopt?to?solve?the?problem
??status?=?app->OptimizeTNLP(mynlp);
??if?(status?==?Solve_Succeeded)?{
????printf(“\n\n***?The?problem?solved!咩哈哈哈哈!!!\n“);
??}
??else?{
????printf(“\n\n***?The?problem?FAILED!\n“);
??}
??//?As?the?SmartPtrs?go?out?of?scope?the?reference?count
??//?will?be?decremented?and?the?objects?will?automatically
??//?be?deleted.
??return?(int)?status;
}
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件???????3619??2013-06-17?20:19??ipopt使用例子代碼\Debug\ipopt.out
?????文件????3887104??2013-06-15?22:13??ipopt使用例子代碼\Debug\test_ipopt.exe
?????文件???10545644??2013-06-15?22:13??ipopt使用例子代碼\Debug\test_ipopt.ilk
?????文件???14371840??2013-06-15?22:13??ipopt使用例子代碼\Debug\test_ipopt.pdb
?????文件???????2106??2013-06-13?20:07??ipopt使用例子代碼\example\hs071_main.cpp
?????文件???????7858??2013-06-15?22:13??ipopt使用例子代碼\example\hs071_nlp.cpp
?????文件???????4266??2010-12-22?14:21??ipopt使用例子代碼\example\hs071_nlp.hpp
?????文件????????468??2008-09-16?10:10??ipopt使用例子代碼\include\configall_system.h
?????文件???????5219??2010-10-30?18:24??ipopt使用例子代碼\include\configall_system_msc.h
?????文件??????27589??2010-12-22?14:21??ipopt使用例子代碼\include\IpAdaptiveMuUpdate.cpp
?????文件???????6748??2010-12-22?14:21??ipopt使用例子代碼\include\IpAdaptiveMuUpdate.hpp
?????文件??????27478??2010-12-22?14:21??ipopt使用例子代碼\include\IpAlgBuilder.cpp
?????文件???????3124??2010-12-22?14:21??ipopt使用例子代碼\include\IpAlgBuilder.hpp
?????文件???????4535??2010-12-22?14:21??ipopt使用例子代碼\include\IpAlgorithmRegOp.cpp
?????文件????????542??2010-12-22?14:21??ipopt使用例子代碼\include\IpAlgorithmRegOp.hpp
?????文件???????5830??2010-12-22?14:21??ipopt使用例子代碼\include\IpAlgStrategy.hpp
?????文件???????1799??2010-12-22?14:21??ipopt使用例子代碼\include\IpAlgTypes.hpp
?????文件??????20674??2010-12-22?14:21??ipopt使用例子代碼\include\IpAugRestoSystemSolver.cpp
?????文件???????6504??2010-12-22?14:21??ipopt使用例子代碼\include\IpAugRestoSystemSolver.hpp
?????文件???????6810??2010-12-22?14:21??ipopt使用例子代碼\include\IpAugSystemSolver.hpp
?????文件??????47093??2010-12-22?14:21??ipopt使用例子代碼\include\IpBacktrackingLineSearch.cpp
?????文件??????15173??2010-12-22?14:21??ipopt使用例子代碼\include\IpBacktrackingLineSearch.hpp
?????文件???????6845??2010-12-22?14:21??ipopt使用例子代碼\include\IpBacktrackingLSAcceptor.hpp
?????文件???????8150??2010-12-22?14:21??ipopt使用例子代碼\include\IpBlas.cpp
?????文件???????3039??2010-12-22?14:21??ipopt使用例子代碼\include\IpBlas.hpp
?????文件??????24252??2010-12-22?14:21??ipopt使用例子代碼\include\IpCachedResults.hpp
?????文件??????21480??2010-12-22?14:21??ipopt使用例子代碼\include\IpCompoundMatrix.cpp
?????文件??????11116??2010-12-22?14:21??ipopt使用例子代碼\include\IpCompoundMatrix.hpp
?????文件??????10478??2010-12-22?14:21??ipopt使用例子代碼\include\IpCompoundSymMatrix.cpp
?????文件???????9422??2010-12-22?14:21??ipopt使用例子代碼\include\IpCompoundSymMatrix.hpp
............此處省略203個文件信息
- 上一篇:IAR10.10破解文件.rar
- 下一篇:bp神經網絡圖像識別
評論
共有 條評論