Ipopt-内点算法使用


自己建立的基于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(“

*** Error during initialization!
“);
    return (int) status;
  }

  // Ask Ipopt to solve the problem
  status = app->OptimizeTNLP(mynlp);

  if (status == Solve_Succeeded) {
    printf(“

*** The problem solved!咩哈哈哈哈!!!
“);
  }
  else {
    printf(“

*** The problem FAILED!
“);
  }

  // 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使用例子代码Debugipopt.out

     文件    3887104  2013-06-15 22:13  ipopt使用例子代码Debug est_ipopt.exe

     文件   10545644  2013-06-15 22:13  ipopt使用例子代码Debug est_ipopt.ilk

     文件   14371840  2013-06-15 22:13  ipopt使用例子代码Debug est_ipopt.pdb

     文件       2106  2013-06-13 20:07  ipopt使用例子代码examplehs071_main.cpp

     文件       7858  2013-06-15 22:13  ipopt使用例子代码examplehs071_nlp.cpp

     文件       4266  2010-12-22 14:21  ipopt使用例子代码examplehs071_nlp.hpp

     文件        468  2008-09-16 10:10  ipopt使用例子代码includeconfigall_system.h

     文件       5219  2010-10-30 18:24  ipopt使用例子代码includeconfigall_system_msc.h

     文件      27589  2010-12-22 14:21  ipopt使用例子代码includeIpAdaptiveMuUpdate.cpp

     文件       6748  2010-12-22 14:21  ipopt使用例子代码includeIpAdaptiveMuUpdate.hpp

     文件      27478  2010-12-22 14:21  ipopt使用例子代码includeIpAlgBuilder.cpp

     文件       3124  2010-12-22 14:21  ipopt使用例子代码includeIpAlgBuilder.hpp

     文件       4535  2010-12-22 14:21  ipopt使用例子代码includeIpAlgorithmRegOp.cpp

     文件        542  2010-12-22 14:21  ipopt使用例子代码includeIpAlgorithmRegOp.hpp

     文件       5830  2010-12-22 14:21  ipopt使用例子代码includeIpAlgStrategy.hpp

     文件       1799  2010-12-22 14:21  ipopt使用例子代码includeIpAlgTypes.hpp

     文件      20674  2010-12-22 14:21  ipopt使用例子代码includeIpAugRestoSystemSolver.cpp

     文件       6504  2010-12-22 14:21  ipopt使用例子代码includeIpAugRestoSystemSolver.hpp

     文件       6810  2010-12-22 14:21  ipopt使用例子代码includeIpAugSystemSolver.hpp

     文件      47093  2010-12-22 14:21  ipopt使用例子代码includeIpBacktrackingLineSearch.cpp

     文件      15173  2010-12-22 14:21  ipopt使用例子代码includeIpBacktrackingLineSearch.hpp

     文件       6845  2010-12-22 14:21  ipopt使用例子代码includeIpBacktrackingLSAcceptor.hpp

     文件       8150  2010-12-22 14:21  ipopt使用例子代码includeIpBlas.cpp

     文件       3039  2010-12-22 14:21  ipopt使用例子代码includeIpBlas.hpp

     文件      24252  2010-12-22 14:21  ipopt使用例子代码includeIpCachedResults.hpp

     文件      21480  2010-12-22 14:21  ipopt使用例子代码includeIpCompoundMatrix.cpp

     文件      11116  2010-12-22 14:21  ipopt使用例子代码includeIpCompoundMatrix.hpp

     文件      10478  2010-12-22 14:21  ipopt使用例子代码includeIpCompoundSymMatrix.cpp

     文件       9422  2010-12-22 14:21  ipopt使用例子代码includeIpCompoundSymMatrix.hpp

............此处省略203个文件信息

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件举报,一经查实,本站将立刻删除。

发表评论

评论列表(条)