没有合适的资源?快使用搜索试试~ 我知道了~
首页Lingo API手册
资源详情
资源评论
资源推荐
LINDO
API
User’s Manual
LINDO Systems, Inc.
1415 North Dayton Street, Chicago, Illinois 60622
Phone: (312)988-7422 Fax: (312)988-9065
E-mail: info@lindo.com
COPYRIGHT
LINDO API and its related documentation are copyrighted. You may not copy the LINDO API
software or related documentation except in the manner authorized in the related documentation or
with the written permission of LINDO Systems, Inc.
TRADEMARKS
LINDO is a registered trademark of LINDO Systems, Inc. Other product and company names
mentioned herein are the property of their respective owners.
DISCLAIMER
LINDO Systems, Inc. warrants that on the date of receipt of your payment, the disk enclosed in the
disk envelope contains an accurate reproduction of LINDO API and that the copy of the related
documentation is accurately reproduced. Due to the inherent complexity of computer programs and
computer models, the LINDO API software may not be completely free of errors. You are advised to
verify your answers before basing decisions on them. NEITHER LINDO SYSTEMS INC. NOR
ANYONE ELSE ASSOCIATED IN THE CREATION, PRODUCTION, OR DISTRIBUTION OF
THE LINDO SOFTWARE MAKES ANY OTHER EXPRESSED WARRANTIES REGARDING
THE DISKS OR DOCUMENTATION AND MAKES NO WARRANTIES AT ALL, EITHER
EXPRESSED OR IMPLIED, REGARDING THE LINDO API SOFTWARE, INCLUDING THE
IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE
OR OTHERWISE. Further, LINDO Systems, Inc. reserves the right to revise this software and related
documentation and make changes to the content hereof without obligation to notify any person of such
revisions or changes.
Copyright 2006 by LINDO Systems, Inc. All rights reserved.
Published by
1415 North Dayton Street
Chicago, Illinois 60622
Technical Support: (312) 988-9421
E-mail: tech@lindo.com
http://www.lindo.com
iii
TABLE OF CONTENTS
TABLE OF CONTENTS ............................................................................................................ iii
Preface ..................................................................................................................................... vii
Chapter 1: Introduction.............................................................................................................. 1
What Is LINDO API? ............................................................................................................ 1
Linear Solvers................................................................................................................... 2
Mixed-Integer Solver......................................................................................................... 2
Nonlinear Solver ............................................................................................................... 3
Global Solver .................................................................................................................... 3
Installation ............................................................................................................................ 3
Windows Platforms ........................................................................................................... 3
Unix-Like Platforms........................................................................................................... 4
Setting up License Keys....................................................................................................... 6
Solving Models from a File ................................................................................................... 7
Sample Applications.............................................................................................................9
Array Representation of Models........................................................................................... 9
Sparse Matrix Representation ........................................................................................ 10
Simple Programming Example ....................................................................................... 13
Chapter 2: Function Definitions............................................................................................... 17
Common Parameter Macro Definitions .............................................................................. 18
Structure Creation and Deletion Routines.......................................................................... 20
License and Version Information Routines ........................................................................ 23
Input-Output Routines ........................................................................................................ 24
Parameter Setting and Retrieving Routines....................................................................... 32
Available Parameters...................................................................................................... 41
Model Loading Routines..................................................................................................... 72
Solver Initialization Routines .............................................................................................. 83
Optimization Routines ........................................................................................................ 88
Solution Query Routines .................................................................................................... 91
Model Query Routines...................................................................................................... 107
Model Modification Routines ............................................................................................ 128
Model and Solution Analysis Routines............................................................................. 142
Error Handling Routines ................................................................................................... 151
Advanced Routines .......................................................................................................... 153
Callback Management Routines ...................................................................................... 159
Memory Management Routines ....................................................................................... 170
Chapter 3: Solving Linear Programs ..................................................................................... 173
A Programming Example in C .......................................................................................... 173
A Programming Example in Visual Basic......................................................................... 183
VB and Delphi Specific Issues: ........................................................................................ 191
Chapter 4: Solving Mixed-Integer Programs......................................................................... 193
Staffing Example Using Visual C++ ................................................................................. 194
Staffing Example Using Visual Basic ............................................................................... 201
Chapter 5: Solving Quadratic Programs ............................................................................... 209
Setting up Quadratic Programs ........................................................................................ 210
Loading Quadratic Data via Extended MPS Format Files............................................ 210
iv TABLE OF CONTENTS
Loading Quadratic Data via API Functions .................................................................. 211
Sample Portfolio Selection Problems............................................................................... 214
Example 1. The Markowitz Model: ............................................................................... 214
Example 2. Portfolio Selection with Restrictions on the Number of Assets Invested:.. 218
Chapter 6: Solving Second-Order Cone Programs............................................................... 225
Setting up Second-Order Cone Programs ....................................................................... 228
Loading Cones via Extended MPS Format Files.......................................................... 228
Loading Cones via API Functions ................................................................................ 230
Example 3: Minimization of Norms: .............................................................................. 230
Converting Models to SOCP Form............................................................................... 235
Example 4: Ratios as SOCP Constraints: .................................................................... 236
Quadratic Programs as SOCP ..................................................................................... 240
Chapter 7: Solving Nonlinear Programs................................................................................ 243
Black-Box Style Interface ................................................................................................. 244
Loading Model Data...................................................................................................... 245
Evaluating Nonlinear Terms via Callback Functions .................................................... 247
Instruction-List Style Interface .......................................................................................... 251
Postfix Notation in Representing Expressions ............................................................. 251
Supported Operators and Functions ............................................................................ 253
Example 1..................................................................................................................... 260
Example 2..................................................................................................................... 260
Example 3..................................................................................................................... 260
Differentiation ................................................................................................................... 261
Solving Non-convex and Non-smooth models ................................................................. 261
Linearization ................................................................................................................. 262
Multistart Scatter Search for Difficult Nonlinear Models ............................................... 264
Global Optimization of Difficult Nonlinear Models ........................................................ 265
Sample Nonlinear Programming Problems...................................................................... 267
Example 1: Black-Box Style Interface: ......................................................................... 267
Example 2: Instruction-List Style Interface ................................................................... 273
Example 3: Multistart Solver for Non-Convex Models.................................................. 283
Example 4: Global Solver with MPI Input Format......................................................... 287
Chapter 8: Using Callback Functions.................................................................................... 293
Specifying a Callback Function ........................................................................................ 293
A Callback Example Using C ........................................................................................... 296
A Callback Example Using Visual Basic .......................................................................... 301
Integer Solution Callbacks................................................................................................ 302
Chapter 9: Analyzing Models and Solutions ......................................................................... 305
Sensitivity and Range Analysis of an LP.......................................................................... 305
Diagnosis of Infeasible or Unbounded Models................................................................. 307
Infeasible Models.......................................................................................................... 307
Unbounded Linear Programs ....................................................................................... 308
Infeasible Integer Programs ......................................................................................... 309
Infeasible Nonlinear Programs ..................................................................................... 309
An Example for Debugging an Infeasible Linear Program............................................... 309
Block Structured Models .................................................................................................. 315
Determining Total Decomposition Structures............................................................... 317
Determining Angular Structures ................................................................................... 318
Chapter 10: mxLINDO A MATLAB Interface......................................................................... 319
Introduction....................................................................................................................... 319
TABLE OF CONTENTS v
Setting up MATLAB to Interface with LINDO ................................................................... 319
Calling Conventions ......................................................................................................... 320
mxLINDO Routines .......................................................................................................... 320
Structure Creation and Deletion Routines.................................................................... 320
License Information Routines ....................................................................................... 323
Input-Output Routines .................................................................................................. 324
Error Handling Routines ............................................................................................... 330
Parameter Setting and Retrieving Routines ................................................................. 332
Model Loading Routines............................................................................................... 339
Solver Initialization Routines ........................................................................................ 348
Optimization Routines .................................................................................................. 352
Solution Query Routines............................................................................................... 353
Model Query Routines.................................................................................................. 360
Model Modification Routines ........................................................................................ 379
Model and Solution Analysis Routines ......................................................................... 394
Advanced Routines....................................................................................................... 401
Callback Management Routines................................................................................... 406
Auxiliary Routines......................................................................................................... 412
Sample MATLAB Functions ............................................................................................. 414
M-functions using mxLINDO......................................................................................... 414
Chapter 11: An Interface to Ox ............................................................................................. 419
Introduction....................................................................................................................... 419
Setting up Ox Interface..................................................................................................... 419
Calling Conventions ......................................................................................................... 420
Example. Portfolio Selection with Restrictions on the Number of Assets Invested...... 422
Appendix A: Error Codes ...................................................................................................... 427
Appendix B: MPS File Format............................................................................................... 431
Integer Variables .............................................................................................................. 433
Semi-continuous Variables............................................................................................... 434
SOS Sets.......................................................................................................................... 435
SOS2 Example................................................................................................................. 436
Quadratic Objective.......................................................................................................... 437
Quadratic Constraints....................................................................................................... 438
Second Order Cone Constraints ...................................................................................... 439
Appendix C: LINDO File Format ........................................................................................... 443
Flow of Control ................................................................................................................. 443
Formatting ........................................................................................................................ 443
Optional Modeling Statements ......................................................................................... 445
FREE Statement........................................................................................................... 445
GIN Statement .............................................................................................................. 446
INT Statement............................................................................................................... 446
SUB and SLB Statements ............................................................................................ 447
TITLE Statement........................................................................................................... 447
Appendix D: MPI File Format ................................................................................................ 449
INDEX ................................................................................................................................... 451
剩余476页未读,继续阅读
sokola
- 粉丝: 0
- 资源: 2
上传资源 快速赚钱
- 我的内容管理 收起
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
会员权益专享
最新资源
- ExcelVBA中的Range和Cells用法说明.pdf
- 基于单片机的电梯控制模型设计.doc
- 主成分分析和因子分析.pptx
- 共享笔记服务系统论文.doc
- 基于数据治理体系的数据中台实践分享.pptx
- 变压器的铭牌和额定值.pptx
- 计算机网络课程设计报告--用winsock设计Ping应用程序.doc
- 高电压技术课件:第03章 液体和固体介质的电气特性.pdf
- Oracle商务智能精华介绍.pptx
- 基于单片机的输液滴速控制系统设计文档.doc
- dw考试题 5套.pdf
- 学生档案管理系统详细设计说明书.doc
- 操作系统PPT课件.pptx
- 智慧路边停车管理系统方案.pptx
- 【企业内控系列】企业内部控制之人力资源管理控制(17页).doc
- 温度传感器分类与特点.pptx
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论4