zoukankan      html  css  js  c++  java
  • 实现nlopt为matlab接口API(非线性约束下的最优化)

    1、The first step is download tw folders, one comes from 

    https://nlopt.readthedocs.io/en/latest/NLopt_on_Windows/ (64 version)

    Another 64-bit Windows DLLs, built with MinGW, which comes from 

    http://ab-initio.mit.edu/wiki/index.php?title=NLopt_on_Windows&redirect=no
    

     2、 Then cd into the folder with a bin subdirectory that contains libnlopt.dll, 

             use the command below to generate libnlopt.exports (the command is done under Developer Command Prompt for VS2013 )

    dumpbin /EXPORTS yourfile.dll > yourfile.exports
    

    Then select all the defined functions and copy them to a new file and name it as libnlopt.def, in the its header, add two lines: 

    LIBRARY libnlopt.dll
    EXPORTS
    

    Then, still under Developer Command Prompt for VS2013, excute  command:

    lib /def:libnlopt.def /machine:x64

    Finally, do the following steps

    % chage directory 
    cd('Directory of nlopt');
    % add the files to the search directory
    addpath(genpath('Directory of nlopt'));
    % build, link to header and link to .lib file (no space between -I, -L, and -l) 
    mex .matlab
    lopt_optimize.c -IDirectory of nlopt -LDirectory of nlopt -llibnlopt
    

    the mex steup succeed!  

      

     

  • 相关阅读:
    设计模式大赛 -- 大话设计模式
    访问者模式 -- 大话设计模式
    puts的用处
    scanf的使用
    iOS,手势识别简单使用
    iOS,多媒体,地图相关
    iOS,文本输入,键盘相关
    iOS,XMPP本地环境搭建和框架使用
    iOS,自动布局autoresizing和auto layout,VFL语言
    iOS,图片处理
  • 原文地址:https://www.cnblogs.com/seisjun/p/11867071.html
Copyright © 2011-2022 走看看