463 changed files with 215966 additions and 4 deletions
-
8CMakeLists.txt
-
13resources/3rdparty/CMakeLists.txt
-
33resources/3rdparty/glpk-4.57/AUTHORS
-
674resources/3rdparty/glpk-4.57/COPYING
-
2932resources/3rdparty/glpk-4.57/ChangeLog
-
209resources/3rdparty/glpk-4.57/INSTALL
-
7resources/3rdparty/glpk-4.57/Makefile.am
-
759resources/3rdparty/glpk-4.57/Makefile.in
-
1841resources/3rdparty/glpk-4.57/NEWS
-
39resources/3rdparty/glpk-4.57/README
-
223resources/3rdparty/glpk-4.57/THANKS
-
949resources/3rdparty/glpk-4.57/aclocal.m4
-
1537resources/3rdparty/glpk-4.57/config.guess
-
27resources/3rdparty/glpk-4.57/config.h.in
-
1789resources/3rdparty/glpk-4.57/config.sub
-
13840resources/3rdparty/glpk-4.57/configure
-
148resources/3rdparty/glpk-4.57/configure.ac
-
787resources/3rdparty/glpk-4.57/depcomp
-
BINresources/3rdparty/glpk-4.57/doc/cnfsat.pdf
-
413resources/3rdparty/glpk-4.57/doc/cnfsat.tex
-
BINresources/3rdparty/glpk-4.57/doc/glpk.pdf
-
168resources/3rdparty/glpk-4.57/doc/glpk.tex
-
343resources/3rdparty/glpk-4.57/doc/glpk01.tex
-
3470resources/3rdparty/glpk-4.57/doc/glpk02.tex
-
1572resources/3rdparty/glpk-4.57/doc/glpk03.tex
-
1387resources/3rdparty/glpk-4.57/doc/glpk04.tex
-
1090resources/3rdparty/glpk-4.57/doc/glpk05.tex
-
462resources/3rdparty/glpk-4.57/doc/glpk06.tex
-
258resources/3rdparty/glpk-4.57/doc/glpk07.tex
-
738resources/3rdparty/glpk-4.57/doc/glpk08.tex
-
424resources/3rdparty/glpk-4.57/doc/glpk09.tex
-
165resources/3rdparty/glpk-4.57/doc/glpk10.tex
-
203resources/3rdparty/glpk-4.57/doc/glpk11.tex
-
707resources/3rdparty/glpk-4.57/doc/glpk12.tex
-
BINresources/3rdparty/glpk-4.57/doc/gmpl.pdf
-
4295resources/3rdparty/glpk-4.57/doc/gmpl.tex
-
BINresources/3rdparty/glpk-4.57/doc/gmpl_es.pdf
-
3233resources/3rdparty/glpk-4.57/doc/gmpl_es.tex
-
BINresources/3rdparty/glpk-4.57/doc/graphs.pdf
-
4150resources/3rdparty/glpk-4.57/doc/graphs.tex
-
135resources/3rdparty/glpk-4.57/doc/miplib2.txt
-
143resources/3rdparty/glpk-4.57/doc/miplib3.txt
-
103resources/3rdparty/glpk-4.57/doc/netlib.txt
-
BINresources/3rdparty/glpk-4.57/doc/notes/dfeas.pdf
-
BINresources/3rdparty/glpk-4.57/doc/notes/gomory.pdf
-
BINresources/3rdparty/glpk-4.57/doc/notes/keller.pdf
-
BINresources/3rdparty/glpk-4.57/doc/notes/scf.pdf
-
BINresources/3rdparty/glpk-4.57/doc/notes/simplex1.pdf
-
BINresources/3rdparty/glpk-4.57/doc/notes/simplex2.pdf
-
58resources/3rdparty/glpk-4.57/examples/INDEX
-
15resources/3rdparty/glpk-4.57/examples/Makefile.am
-
558resources/3rdparty/glpk-4.57/examples/Makefile.in
-
282resources/3rdparty/glpk-4.57/examples/alloy.mps
-
77resources/3rdparty/glpk-4.57/examples/assign.mod
-
83resources/3rdparty/glpk-4.57/examples/bpp.mod
-
49resources/3rdparty/glpk-4.57/examples/cal.mod
-
81resources/3rdparty/glpk-4.57/examples/cf12a.mod
-
88resources/3rdparty/glpk-4.57/examples/cf12b.mod
-
51resources/3rdparty/glpk-4.57/examples/cflsq.mod
-
113resources/3rdparty/glpk-4.57/examples/color.mod
-
44resources/3rdparty/glpk-4.57/examples/cplex/README
-
121resources/3rdparty/glpk-4.57/examples/cplex/concorde.txt
-
2130resources/3rdparty/glpk-4.57/examples/cplex/cplex.c
-
301resources/3rdparty/glpk-4.57/examples/cplex/cplex.h
-
67resources/3rdparty/glpk-4.57/examples/cpp.mod
-
84resources/3rdparty/glpk-4.57/examples/crypto.mod
-
7resources/3rdparty/glpk-4.57/examples/csv/distances.csv
-
4resources/3rdparty/glpk-4.57/examples/csv/markets.csv
-
2resources/3rdparty/glpk-4.57/examples/csv/parameters.csv
-
3resources/3rdparty/glpk-4.57/examples/csv/plants.csv
-
70resources/3rdparty/glpk-4.57/examples/csv/transp_csv.mod
-
226resources/3rdparty/glpk-4.57/examples/dbf/ForestMgt_Model_I_GIS_dbf.mod
-
BINresources/3rdparty/glpk-4.57/examples/dbf/Forest_Cost.dbf
-
BINresources/3rdparty/glpk-4.57/examples/dbf/NetRev_Table.dbf
-
2resources/3rdparty/glpk-4.57/examples/dbf/README
-
BINresources/3rdparty/glpk-4.57/examples/dbf/TCost_Table.dbf
-
BINresources/3rdparty/glpk-4.57/examples/dbf/Yield_Table_Vol.dbf
-
BINresources/3rdparty/glpk-4.57/examples/dbf/cultural_pres.dbf
-
BINresources/3rdparty/glpk-4.57/examples/dbf/mgt_year.dbf
-
BINresources/3rdparty/glpk-4.57/examples/dbf/stands.dbf
-
BINresources/3rdparty/glpk-4.57/examples/dbf/standtype.dbf
-
222resources/3rdparty/glpk-4.57/examples/dea.mod
-
99resources/3rdparty/glpk-4.57/examples/diet.mod
-
565resources/3rdparty/glpk-4.57/examples/dist.mod
-
519resources/3rdparty/glpk-4.57/examples/egypt.mod
-
93resources/3rdparty/glpk-4.57/examples/fctp.mod
-
127resources/3rdparty/glpk-4.57/examples/food.mod
-
150resources/3rdparty/glpk-4.57/examples/food2.mod
-
164resources/3rdparty/glpk-4.57/examples/furnace.mps
-
79resources/3rdparty/glpk-4.57/examples/gap.mod
-
10resources/3rdparty/glpk-4.57/examples/glpsol.c
-
98resources/3rdparty/glpk-4.57/examples/graph.mod
-
168resources/3rdparty/glpk-4.57/examples/hashi.mod
-
25resources/3rdparty/glpk-4.57/examples/huge.mod
-
345resources/3rdparty/glpk-4.57/examples/icecream.mps
-
17resources/3rdparty/glpk-4.57/examples/iptsamp.c
-
114resources/3rdparty/glpk-4.57/examples/jssp.mod
-
54resources/3rdparty/glpk-4.57/examples/magic.mod
-
85resources/3rdparty/glpk-4.57/examples/maxcut.mod
-
83resources/3rdparty/glpk-4.57/examples/maxflow.mod
@ -0,0 +1,33 @@ |
|||
The GLPK package was developed and programmed by Andrew Makhorin, |
|||
Department for Applied Informatics, Moscow Aviation Institute, Moscow, |
|||
Russia. |
|||
|
|||
E-mail: <mao@gnu.org> |
|||
|
|||
Paper mail: 125871, Russia, Moscow, Volokolamskoye sh., 4, |
|||
Moscow Aviation Institute, Andrew O. Makhorin |
|||
|
|||
-----BEGIN PGP PUBLIC KEY BLOCK----- |
|||
Version: GnuPG v1.2.2 (MingW32) |
|||
|
|||
mQGiBD8UdT8RBAC6yWYxoa1b7U973J0jBuQpgZnhXlGJJpMZgAW9efDBD17vhkJm |
|||
hPVOQBKRUeOOLcW3/a7NMoNLMdmF1Rgz1FPVy3RgBDsYj4Sp4RBCsX/o0xXh+jxe |
|||
gncr4bdN0Ruk03pezVtLi9oYygdxfI51SsjZ2vwYP6BhMwv+xrIgcnc4qwCgoCit |
|||
26mTd0FoGOmsQuipo6X5LaUD/1l7NqFIjiGdWthyG3TqsiK5Ew7xF3fLEABXKPjb |
|||
PMRTMucX8XXHmW8RUD1vP1uGDnEn6s+fjc3/RtaqKjqGMdLt4XgHQkImaVguNpSS |
|||
IxN3LaK600BgAbwSd1bomRqWNlczAM7469VvGG9ASpCBveUUrqwerHZcUbvngL62 |
|||
pIcqA/41dO0xYrOTqMRhuguYMgHL2xbwB2Aj2TqRwBm697DIS25B9nE+8UsbjGRx |
|||
q3EmeuHeZ5kN5RbESXkGUB8whIcYxvH16HRNmM1ZjmFoBVL2Z6S2gpa2ZUqsq7BZ |
|||
s+hriElm3dfOQCt79/o852uKWu5bSjw2yiemVA2T8tG4OoN6DrQjQW5kcmV3IE1h |
|||
a2hvcmluIDxtYW9AbWFpMi5yY25ldC5ydT6IWwQTEQIAGwUCPxR1PwYLCQgHAwID |
|||
FQIDAxYCAQIeAQIXgAAKCRDRe/IwWYHoGKpHAJ44MmzWKr8OiTc0Bb6/RD56aekp |
|||
3wCdGznQMCfWFkehQPbeNaB5yFIs+8a5AQ0EPxR1UBAEAO3U3H5M0iYv06C4kKty |
|||
6ReWyYH4CzMAfp2lPVUKzRSjPtoAJ6SkrBSKMT+U+DahxZ4K4HbinvHq3uvlwWax |
|||
xw0wKxJl4oY6EGE1Jqn3B//Ak47RaNMnrs9V739WT1YNRpQvh4wOCeMekBzksf43 |
|||
hm4dSV4PMQkLmrEeG2+BYaZnAAMFA/4tVHhjGRkxzcTcfHCB+Yo3PXeIQMuIs00c |
|||
VKCrNReLni/3BWZC0w9tFzZSdz+URXefPWDGuAC16vLCVOD06NcIQGutPe189dUn |
|||
Kf9Bl6qc9DyWsxSTdF/PbLqcLfEe9g7fHhIwdY+w/hSq2n3NEURMzHiMT1U3CvHd |
|||
As5IzV/yD4hGBBgRAgAGBQI/FHVQAAoJENF78jBZgegYRZEAmwReJkMSrbs0EQs2 |
|||
wjyTCMd5KDh3AKCR2/RvVad9RT3ShYnUiPPYTL2/Nw== |
|||
=OfLQ |
|||
-----END PGP PUBLIC KEY BLOCK----- |
@ -0,0 +1,674 @@ |
|||
GNU GENERAL PUBLIC LICENSE |
|||
Version 3, 29 June 2007 |
|||
|
|||
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/> |
|||
Everyone is permitted to copy and distribute verbatim copies |
|||
of this license document, but changing it is not allowed. |
|||
|
|||
Preamble |
|||
|
|||
The GNU General Public License is a free, copyleft license for |
|||
software and other kinds of works. |
|||
|
|||
The licenses for most software and other practical works are designed |
|||
to take away your freedom to share and change the works. By contrast, |
|||
the GNU General Public License is intended to guarantee your freedom to |
|||
share and change all versions of a program--to make sure it remains free |
|||
software for all its users. We, the Free Software Foundation, use the |
|||
GNU General Public License for most of our software; it applies also to |
|||
any other work released this way by its authors. You can apply it to |
|||
your programs, too. |
|||
|
|||
When we speak of free software, we are referring to freedom, not |
|||
price. Our General Public Licenses are designed to make sure that you |
|||
have the freedom to distribute copies of free software (and charge for |
|||
them if you wish), that you receive source code or can get it if you |
|||
want it, that you can change the software or use pieces of it in new |
|||
free programs, and that you know you can do these things. |
|||
|
|||
To protect your rights, we need to prevent others from denying you |
|||
these rights or asking you to surrender the rights. Therefore, you have |
|||
certain responsibilities if you distribute copies of the software, or if |
|||
you modify it: responsibilities to respect the freedom of others. |
|||
|
|||
For example, if you distribute copies of such a program, whether |
|||
gratis or for a fee, you must pass on to the recipients the same |
|||
freedoms that you received. You must make sure that they, too, receive |
|||
or can get the source code. And you must show them these terms so they |
|||
know their rights. |
|||
|
|||
Developers that use the GNU GPL protect your rights with two steps: |
|||
(1) assert copyright on the software, and (2) offer you this License |
|||
giving you legal permission to copy, distribute and/or modify it. |
|||
|
|||
For the developers' and authors' protection, the GPL clearly explains |
|||
that there is no warranty for this free software. For both users' and |
|||
authors' sake, the GPL requires that modified versions be marked as |
|||
changed, so that their problems will not be attributed erroneously to |
|||
authors of previous versions. |
|||
|
|||
Some devices are designed to deny users access to install or run |
|||
modified versions of the software inside them, although the manufacturer |
|||
can do so. This is fundamentally incompatible with the aim of |
|||
protecting users' freedom to change the software. The systematic |
|||
pattern of such abuse occurs in the area of products for individuals to |
|||
use, which is precisely where it is most unacceptable. Therefore, we |
|||
have designed this version of the GPL to prohibit the practice for those |
|||
products. If such problems arise substantially in other domains, we |
|||
stand ready to extend this provision to those domains in future versions |
|||
of the GPL, as needed to protect the freedom of users. |
|||
|
|||
Finally, every program is threatened constantly by software patents. |
|||
States should not allow patents to restrict development and use of |
|||
software on general-purpose computers, but in those that do, we wish to |
|||
avoid the special danger that patents applied to a free program could |
|||
make it effectively proprietary. To prevent this, the GPL assures that |
|||
patents cannot be used to render the program non-free. |
|||
|
|||
The precise terms and conditions for copying, distribution and |
|||
modification follow. |
|||
|
|||
TERMS AND CONDITIONS |
|||
|
|||
0. Definitions. |
|||
|
|||
"This License" refers to version 3 of the GNU General Public License. |
|||
|
|||
"Copyright" also means copyright-like laws that apply to other kinds of |
|||
works, such as semiconductor masks. |
|||
|
|||
"The Program" refers to any copyrightable work licensed under this |
|||
License. Each licensee is addressed as "you". "Licensees" and |
|||
"recipients" may be individuals or organizations. |
|||
|
|||
To "modify" a work means to copy from or adapt all or part of the work |
|||
in a fashion requiring copyright permission, other than the making of an |
|||
exact copy. The resulting work is called a "modified version" of the |
|||
earlier work or a work "based on" the earlier work. |
|||
|
|||
A "covered work" means either the unmodified Program or a work based |
|||
on the Program. |
|||
|
|||
To "propagate" a work means to do anything with it that, without |
|||
permission, would make you directly or secondarily liable for |
|||
infringement under applicable copyright law, except executing it on a |
|||
computer or modifying a private copy. Propagation includes copying, |
|||
distribution (with or without modification), making available to the |
|||
public, and in some countries other activities as well. |
|||
|
|||
To "convey" a work means any kind of propagation that enables other |
|||
parties to make or receive copies. Mere interaction with a user through |
|||
a computer network, with no transfer of a copy, is not conveying. |
|||
|
|||
An interactive user interface displays "Appropriate Legal Notices" |
|||
to the extent that it includes a convenient and prominently visible |
|||
feature that (1) displays an appropriate copyright notice, and (2) |
|||
tells the user that there is no warranty for the work (except to the |
|||
extent that warranties are provided), that licensees may convey the |
|||
work under this License, and how to view a copy of this License. If |
|||
the interface presents a list of user commands or options, such as a |
|||
menu, a prominent item in the list meets this criterion. |
|||
|
|||
1. Source Code. |
|||
|
|||
The "source code" for a work means the preferred form of the work |
|||
for making modifications to it. "Object code" means any non-source |
|||
form of a work. |
|||
|
|||
A "Standard Interface" means an interface that either is an official |
|||
standard defined by a recognized standards body, or, in the case of |
|||
interfaces specified for a particular programming language, one that |
|||
is widely used among developers working in that language. |
|||
|
|||
The "System Libraries" of an executable work include anything, other |
|||
than the work as a whole, that (a) is included in the normal form of |
|||
packaging a Major Component, but which is not part of that Major |
|||
Component, and (b) serves only to enable use of the work with that |
|||
Major Component, or to implement a Standard Interface for which an |
|||
implementation is available to the public in source code form. A |
|||
"Major Component", in this context, means a major essential component |
|||
(kernel, window system, and so on) of the specific operating system |
|||
(if any) on which the executable work runs, or a compiler used to |
|||
produce the work, or an object code interpreter used to run it. |
|||
|
|||
The "Corresponding Source" for a work in object code form means all |
|||
the source code needed to generate, install, and (for an executable |
|||
work) run the object code and to modify the work, including scripts to |
|||
control those activities. However, it does not include the work's |
|||
System Libraries, or general-purpose tools or generally available free |
|||
programs which are used unmodified in performing those activities but |
|||
which are not part of the work. For example, Corresponding Source |
|||
includes interface definition files associated with source files for |
|||
the work, and the source code for shared libraries and dynamically |
|||
linked subprograms that the work is specifically designed to require, |
|||
such as by intimate data communication or control flow between those |
|||
subprograms and other parts of the work. |
|||
|
|||
The Corresponding Source need not include anything that users |
|||
can regenerate automatically from other parts of the Corresponding |
|||
Source. |
|||
|
|||
The Corresponding Source for a work in source code form is that |
|||
same work. |
|||
|
|||
2. Basic Permissions. |
|||
|
|||
All rights granted under this License are granted for the term of |
|||
copyright on the Program, and are irrevocable provided the stated |
|||
conditions are met. This License explicitly affirms your unlimited |
|||
permission to run the unmodified Program. The output from running a |
|||
covered work is covered by this License only if the output, given its |
|||
content, constitutes a covered work. This License acknowledges your |
|||
rights of fair use or other equivalent, as provided by copyright law. |
|||
|
|||
You may make, run and propagate covered works that you do not |
|||
convey, without conditions so long as your license otherwise remains |
|||
in force. You may convey covered works to others for the sole purpose |
|||
of having them make modifications exclusively for you, or provide you |
|||
with facilities for running those works, provided that you comply with |
|||
the terms of this License in conveying all material for which you do |
|||
not control copyright. Those thus making or running the covered works |
|||
for you must do so exclusively on your behalf, under your direction |
|||
and control, on terms that prohibit them from making any copies of |
|||
your copyrighted material outside their relationship with you. |
|||
|
|||
Conveying under any other circumstances is permitted solely under |
|||
the conditions stated below. Sublicensing is not allowed; section 10 |
|||
makes it unnecessary. |
|||
|
|||
3. Protecting Users' Legal Rights From Anti-Circumvention Law. |
|||
|
|||
No covered work shall be deemed part of an effective technological |
|||
measure under any applicable law fulfilling obligations under article |
|||
11 of the WIPO copyright treaty adopted on 20 December 1996, or |
|||
similar laws prohibiting or restricting circumvention of such |
|||
measures. |
|||
|
|||
When you convey a covered work, you waive any legal power to forbid |
|||
circumvention of technological measures to the extent such circumvention |
|||
is effected by exercising rights under this License with respect to |
|||
the covered work, and you disclaim any intention to limit operation or |
|||
modification of the work as a means of enforcing, against the work's |
|||
users, your or third parties' legal rights to forbid circumvention of |
|||
technological measures. |
|||
|
|||
4. Conveying Verbatim Copies. |
|||
|
|||
You may convey verbatim copies of the Program's source code as you |
|||
receive it, in any medium, provided that you conspicuously and |
|||
appropriately publish on each copy an appropriate copyright notice; |
|||
keep intact all notices stating that this License and any |
|||
non-permissive terms added in accord with section 7 apply to the code; |
|||
keep intact all notices of the absence of any warranty; and give all |
|||
recipients a copy of this License along with the Program. |
|||
|
|||
You may charge any price or no price for each copy that you convey, |
|||
and you may offer support or warranty protection for a fee. |
|||
|
|||
5. Conveying Modified Source Versions. |
|||
|
|||
You may convey a work based on the Program, or the modifications to |
|||
produce it from the Program, in the form of source code under the |
|||
terms of section 4, provided that you also meet all of these conditions: |
|||
|
|||
a) The work must carry prominent notices stating that you modified |
|||
it, and giving a relevant date. |
|||
|
|||
b) The work must carry prominent notices stating that it is |
|||
released under this License and any conditions added under section |
|||
7. This requirement modifies the requirement in section 4 to |
|||
"keep intact all notices". |
|||
|
|||
c) You must license the entire work, as a whole, under this |
|||
License to anyone who comes into possession of a copy. This |
|||
License will therefore apply, along with any applicable section 7 |
|||
additional terms, to the whole of the work, and all its parts, |
|||
regardless of how they are packaged. This License gives no |
|||
permission to license the work in any other way, but it does not |
|||
invalidate such permission if you have separately received it. |
|||
|
|||
d) If the work has interactive user interfaces, each must display |
|||
Appropriate Legal Notices; however, if the Program has interactive |
|||
interfaces that do not display Appropriate Legal Notices, your |
|||
work need not make them do so. |
|||
|
|||
A compilation of a covered work with other separate and independent |
|||
works, which are not by their nature extensions of the covered work, |
|||
and which are not combined with it such as to form a larger program, |
|||
in or on a volume of a storage or distribution medium, is called an |
|||
"aggregate" if the compilation and its resulting copyright are not |
|||
used to limit the access or legal rights of the compilation's users |
|||
beyond what the individual works permit. Inclusion of a covered work |
|||
in an aggregate does not cause this License to apply to the other |
|||
parts of the aggregate. |
|||
|
|||
6. Conveying Non-Source Forms. |
|||
|
|||
You may convey a covered work in object code form under the terms |
|||
of sections 4 and 5, provided that you also convey the |
|||
machine-readable Corresponding Source under the terms of this License, |
|||
in one of these ways: |
|||
|
|||
a) Convey the object code in, or embodied in, a physical product |
|||
(including a physical distribution medium), accompanied by the |
|||
Corresponding Source fixed on a durable physical medium |
|||
customarily used for software interchange. |
|||
|
|||
b) Convey the object code in, or embodied in, a physical product |
|||
(including a physical distribution medium), accompanied by a |
|||
written offer, valid for at least three years and valid for as |
|||
long as you offer spare parts or customer support for that product |
|||
model, to give anyone who possesses the object code either (1) a |
|||
copy of the Corresponding Source for all the software in the |
|||
product that is covered by this License, on a durable physical |
|||
medium customarily used for software interchange, for a price no |
|||
more than your reasonable cost of physically performing this |
|||
conveying of source, or (2) access to copy the |
|||
Corresponding Source from a network server at no charge. |
|||
|
|||
c) Convey individual copies of the object code with a copy of the |
|||
written offer to provide the Corresponding Source. This |
|||
alternative is allowed only occasionally and noncommercially, and |
|||
only if you received the object code with such an offer, in accord |
|||
with subsection 6b. |
|||
|
|||
d) Convey the object code by offering access from a designated |
|||
place (gratis or for a charge), and offer equivalent access to the |
|||
Corresponding Source in the same way through the same place at no |
|||
further charge. You need not require recipients to copy the |
|||
Corresponding Source along with the object code. If the place to |
|||
copy the object code is a network server, the Corresponding Source |
|||
may be on a different server (operated by you or a third party) |
|||
that supports equivalent copying facilities, provided you maintain |
|||
clear directions next to the object code saying where to find the |
|||
Corresponding Source. Regardless of what server hosts the |
|||
Corresponding Source, you remain obligated to ensure that it is |
|||
available for as long as needed to satisfy these requirements. |
|||
|
|||
e) Convey the object code using peer-to-peer transmission, provided |
|||
you inform other peers where the object code and Corresponding |
|||
Source of the work are being offered to the general public at no |
|||
charge under subsection 6d. |
|||
|
|||
A separable portion of the object code, whose source code is excluded |
|||
from the Corresponding Source as a System Library, need not be |
|||
included in conveying the object code work. |
|||
|
|||
A "User Product" is either (1) a "consumer product", which means any |
|||
tangible personal property which is normally used for personal, family, |
|||
or household purposes, or (2) anything designed or sold for incorporation |
|||
into a dwelling. In determining whether a product is a consumer product, |
|||
doubtful cases shall be resolved in favor of coverage. For a particular |
|||
product received by a particular user, "normally used" refers to a |
|||
typical or common use of that class of product, regardless of the status |
|||
of the particular user or of the way in which the particular user |
|||
actually uses, or expects or is expected to use, the product. A product |
|||
is a consumer product regardless of whether the product has substantial |
|||
commercial, industrial or non-consumer uses, unless such uses represent |
|||
the only significant mode of use of the product. |
|||
|
|||
"Installation Information" for a User Product means any methods, |
|||
procedures, authorization keys, or other information required to install |
|||
and execute modified versions of a covered work in that User Product from |
|||
a modified version of its Corresponding Source. The information must |
|||
suffice to ensure that the continued functioning of the modified object |
|||
code is in no case prevented or interfered with solely because |
|||
modification has been made. |
|||
|
|||
If you convey an object code work under this section in, or with, or |
|||
specifically for use in, a User Product, and the conveying occurs as |
|||
part of a transaction in which the right of possession and use of the |
|||
User Product is transferred to the recipient in perpetuity or for a |
|||
fixed term (regardless of how the transaction is characterized), the |
|||
Corresponding Source conveyed under this section must be accompanied |
|||
by the Installation Information. But this requirement does not apply |
|||
if neither you nor any third party retains the ability to install |
|||
modified object code on the User Product (for example, the work has |
|||
been installed in ROM). |
|||
|
|||
The requirement to provide Installation Information does not include a |
|||
requirement to continue to provide support service, warranty, or updates |
|||
for a work that has been modified or installed by the recipient, or for |
|||
the User Product in which it has been modified or installed. Access to a |
|||
network may be denied when the modification itself materially and |
|||
adversely affects the operation of the network or violates the rules and |
|||
protocols for communication across the network. |
|||
|
|||
Corresponding Source conveyed, and Installation Information provided, |
|||
in accord with this section must be in a format that is publicly |
|||
documented (and with an implementation available to the public in |
|||
source code form), and must require no special password or key for |
|||
unpacking, reading or copying. |
|||
|
|||
7. Additional Terms. |
|||
|
|||
"Additional permissions" are terms that supplement the terms of this |
|||
License by making exceptions from one or more of its conditions. |
|||
Additional permissions that are applicable to the entire Program shall |
|||
be treated as though they were included in this License, to the extent |
|||
that they are valid under applicable law. If additional permissions |
|||
apply only to part of the Program, that part may be used separately |
|||
under those permissions, but the entire Program remains governed by |
|||
this License without regard to the additional permissions. |
|||
|
|||
When you convey a copy of a covered work, you may at your option |
|||
remove any additional permissions from that copy, or from any part of |
|||
it. (Additional permissions may be written to require their own |
|||
removal in certain cases when you modify the work.) You may place |
|||
additional permissions on material, added by you to a covered work, |
|||
for which you have or can give appropriate copyright permission. |
|||
|
|||
Notwithstanding any other provision of this License, for material you |
|||
add to a covered work, you may (if authorized by the copyright holders of |
|||
that material) supplement the terms of this License with terms: |
|||
|
|||
a) Disclaiming warranty or limiting liability differently from the |
|||
terms of sections 15 and 16 of this License; or |
|||
|
|||
b) Requiring preservation of specified reasonable legal notices or |
|||
author attributions in that material or in the Appropriate Legal |
|||
Notices displayed by works containing it; or |
|||
|
|||
c) Prohibiting misrepresentation of the origin of that material, or |
|||
requiring that modified versions of such material be marked in |
|||
reasonable ways as different from the original version; or |
|||
|
|||
d) Limiting the use for publicity purposes of names of licensors or |
|||
authors of the material; or |
|||
|
|||
e) Declining to grant rights under trademark law for use of some |
|||
trade names, trademarks, or service marks; or |
|||
|
|||
f) Requiring indemnification of licensors and authors of that |
|||
material by anyone who conveys the material (or modified versions of |
|||
it) with contractual assumptions of liability to the recipient, for |
|||
any liability that these contractual assumptions directly impose on |
|||
those licensors and authors. |
|||
|
|||
All other non-permissive additional terms are considered "further |
|||
restrictions" within the meaning of section 10. If the Program as you |
|||
received it, or any part of it, contains a notice stating that it is |
|||
governed by this License along with a term that is a further |
|||
restriction, you may remove that term. If a license document contains |
|||
a further restriction but permits relicensing or conveying under this |
|||
License, you may add to a covered work material governed by the terms |
|||
of that license document, provided that the further restriction does |
|||
not survive such relicensing or conveying. |
|||
|
|||
If you add terms to a covered work in accord with this section, you |
|||
must place, in the relevant source files, a statement of the |
|||
additional terms that apply to those files, or a notice indicating |
|||
where to find the applicable terms. |
|||
|
|||
Additional terms, permissive or non-permissive, may be stated in the |
|||
form of a separately written license, or stated as exceptions; |
|||
the above requirements apply either way. |
|||
|
|||
8. Termination. |
|||
|
|||
You may not propagate or modify a covered work except as expressly |
|||
provided under this License. Any attempt otherwise to propagate or |
|||
modify it is void, and will automatically terminate your rights under |
|||
this License (including any patent licenses granted under the third |
|||
paragraph of section 11). |
|||
|
|||
However, if you cease all violation of this License, then your |
|||
license from a particular copyright holder is reinstated (a) |
|||
provisionally, unless and until the copyright holder explicitly and |
|||
finally terminates your license, and (b) permanently, if the copyright |
|||
holder fails to notify you of the violation by some reasonable means |
|||
prior to 60 days after the cessation. |
|||
|
|||
Moreover, your license from a particular copyright holder is |
|||
reinstated permanently if the copyright holder notifies you of the |
|||
violation by some reasonable means, this is the first time you have |
|||
received notice of violation of this License (for any work) from that |
|||
copyright holder, and you cure the violation prior to 30 days after |
|||
your receipt of the notice. |
|||
|
|||
Termination of your rights under this section does not terminate the |
|||
licenses of parties who have received copies or rights from you under |
|||
this License. If your rights have been terminated and not permanently |
|||
reinstated, you do not qualify to receive new licenses for the same |
|||
material under section 10. |
|||
|
|||
9. Acceptance Not Required for Having Copies. |
|||
|
|||
You are not required to accept this License in order to receive or |
|||
run a copy of the Program. Ancillary propagation of a covered work |
|||
occurring solely as a consequence of using peer-to-peer transmission |
|||
to receive a copy likewise does not require acceptance. However, |
|||
nothing other than this License grants you permission to propagate or |
|||
modify any covered work. These actions infringe copyright if you do |
|||
not accept this License. Therefore, by modifying or propagating a |
|||
covered work, you indicate your acceptance of this License to do so. |
|||
|
|||
10. Automatic Licensing of Downstream Recipients. |
|||
|
|||
Each time you convey a covered work, the recipient automatically |
|||
receives a license from the original licensors, to run, modify and |
|||
propagate that work, subject to this License. You are not responsible |
|||
for enforcing compliance by third parties with this License. |
|||
|
|||
An "entity transaction" is a transaction transferring control of an |
|||
organization, or substantially all assets of one, or subdividing an |
|||
organization, or merging organizations. If propagation of a covered |
|||
work results from an entity transaction, each party to that |
|||
transaction who receives a copy of the work also receives whatever |
|||
licenses to the work the party's predecessor in interest had or could |
|||
give under the previous paragraph, plus a right to possession of the |
|||
Corresponding Source of the work from the predecessor in interest, if |
|||
the predecessor has it or can get it with reasonable efforts. |
|||
|
|||
You may not impose any further restrictions on the exercise of the |
|||
rights granted or affirmed under this License. For example, you may |
|||
not impose a license fee, royalty, or other charge for exercise of |
|||
rights granted under this License, and you may not initiate litigation |
|||
(including a cross-claim or counterclaim in a lawsuit) alleging that |
|||
any patent claim is infringed by making, using, selling, offering for |
|||
sale, or importing the Program or any portion of it. |
|||
|
|||
11. Patents. |
|||
|
|||
A "contributor" is a copyright holder who authorizes use under this |
|||
License of the Program or a work on which the Program is based. The |
|||
work thus licensed is called the contributor's "contributor version". |
|||
|
|||
A contributor's "essential patent claims" are all patent claims |
|||
owned or controlled by the contributor, whether already acquired or |
|||
hereafter acquired, that would be infringed by some manner, permitted |
|||
by this License, of making, using, or selling its contributor version, |
|||
but do not include claims that would be infringed only as a |
|||
consequence of further modification of the contributor version. For |
|||
purposes of this definition, "control" includes the right to grant |
|||
patent sublicenses in a manner consistent with the requirements of |
|||
this License. |
|||
|
|||
Each contributor grants you a non-exclusive, worldwide, royalty-free |
|||
patent license under the contributor's essential patent claims, to |
|||
make, use, sell, offer for sale, import and otherwise run, modify and |
|||
propagate the contents of its contributor version. |
|||
|
|||
In the following three paragraphs, a "patent license" is any express |
|||
agreement or commitment, however denominated, not to enforce a patent |
|||
(such as an express permission to practice a patent or covenant not to |
|||
sue for patent infringement). To "grant" such a patent license to a |
|||
party means to make such an agreement or commitment not to enforce a |
|||
patent against the party. |
|||
|
|||
If you convey a covered work, knowingly relying on a patent license, |
|||
and the Corresponding Source of the work is not available for anyone |
|||
to copy, free of charge and under the terms of this License, through a |
|||
publicly available network server or other readily accessible means, |
|||
then you must either (1) cause the Corresponding Source to be so |
|||
available, or (2) arrange to deprive yourself of the benefit of the |
|||
patent license for this particular work, or (3) arrange, in a manner |
|||
consistent with the requirements of this License, to extend the patent |
|||
license to downstream recipients. "Knowingly relying" means you have |
|||
actual knowledge that, but for the patent license, your conveying the |
|||
covered work in a country, or your recipient's use of the covered work |
|||
in a country, would infringe one or more identifiable patents in that |
|||
country that you have reason to believe are valid. |
|||
|
|||
If, pursuant to or in connection with a single transaction or |
|||
arrangement, you convey, or propagate by procuring conveyance of, a |
|||
covered work, and grant a patent license to some of the parties |
|||
receiving the covered work authorizing them to use, propagate, modify |
|||
or convey a specific copy of the covered work, then the patent license |
|||
you grant is automatically extended to all recipients of the covered |
|||
work and works based on it. |
|||
|
|||
A patent license is "discriminatory" if it does not include within |
|||
the scope of its coverage, prohibits the exercise of, or is |
|||
conditioned on the non-exercise of one or more of the rights that are |
|||
specifically granted under this License. You may not convey a covered |
|||
work if you are a party to an arrangement with a third party that is |
|||
in the business of distributing software, under which you make payment |
|||
to the third party based on the extent of your activity of conveying |
|||
the work, and under which the third party grants, to any of the |
|||
parties who would receive the covered work from you, a discriminatory |
|||
patent license (a) in connection with copies of the covered work |
|||
conveyed by you (or copies made from those copies), or (b) primarily |
|||
for and in connection with specific products or compilations that |
|||
contain the covered work, unless you entered into that arrangement, |
|||
or that patent license was granted, prior to 28 March 2007. |
|||
|
|||
Nothing in this License shall be construed as excluding or limiting |
|||
any implied license or other defenses to infringement that may |
|||
otherwise be available to you under applicable patent law. |
|||
|
|||
12. No Surrender of Others' Freedom. |
|||
|
|||
If conditions are imposed on you (whether by court order, agreement or |
|||
otherwise) that contradict the conditions of this License, they do not |
|||
excuse you from the conditions of this License. If you cannot convey a |
|||
covered work so as to satisfy simultaneously your obligations under this |
|||
License and any other pertinent obligations, then as a consequence you may |
|||
not convey it at all. For example, if you agree to terms that obligate you |
|||
to collect a royalty for further conveying from those to whom you convey |
|||
the Program, the only way you could satisfy both those terms and this |
|||
License would be to refrain entirely from conveying the Program. |
|||
|
|||
13. Use with the GNU Affero General Public License. |
|||
|
|||
Notwithstanding any other provision of this License, you have |
|||
permission to link or combine any covered work with a work licensed |
|||
under version 3 of the GNU Affero General Public License into a single |
|||
combined work, and to convey the resulting work. The terms of this |
|||
License will continue to apply to the part which is the covered work, |
|||
but the special requirements of the GNU Affero General Public License, |
|||
section 13, concerning interaction through a network will apply to the |
|||
combination as such. |
|||
|
|||
14. Revised Versions of this License. |
|||
|
|||
The Free Software Foundation may publish revised and/or new versions of |
|||
the GNU General Public License from time to time. Such new versions will |
|||
be similar in spirit to the present version, but may differ in detail to |
|||
address new problems or concerns. |
|||
|
|||
Each version is given a distinguishing version number. If the |
|||
Program specifies that a certain numbered version of the GNU General |
|||
Public License "or any later version" applies to it, you have the |
|||
option of following the terms and conditions either of that numbered |
|||
version or of any later version published by the Free Software |
|||
Foundation. If the Program does not specify a version number of the |
|||
GNU General Public License, you may choose any version ever published |
|||
by the Free Software Foundation. |
|||
|
|||
If the Program specifies that a proxy can decide which future |
|||
versions of the GNU General Public License can be used, that proxy's |
|||
public statement of acceptance of a version permanently authorizes you |
|||
to choose that version for the Program. |
|||
|
|||
Later license versions may give you additional or different |
|||
permissions. However, no additional obligations are imposed on any |
|||
author or copyright holder as a result of your choosing to follow a |
|||
later version. |
|||
|
|||
15. Disclaimer of Warranty. |
|||
|
|||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY |
|||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT |
|||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY |
|||
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, |
|||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
|||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM |
|||
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF |
|||
ALL NECESSARY SERVICING, REPAIR OR CORRECTION. |
|||
|
|||
16. Limitation of Liability. |
|||
|
|||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING |
|||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS |
|||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY |
|||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE |
|||
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF |
|||
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD |
|||
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), |
|||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF |
|||
SUCH DAMAGES. |
|||
|
|||
17. Interpretation of Sections 15 and 16. |
|||
|
|||
If the disclaimer of warranty and limitation of liability provided |
|||
above cannot be given local legal effect according to their terms, |
|||
reviewing courts shall apply local law that most closely approximates |
|||
an absolute waiver of all civil liability in connection with the |
|||
Program, unless a warranty or assumption of liability accompanies a |
|||
copy of the Program in return for a fee. |
|||
|
|||
END OF TERMS AND CONDITIONS |
|||
|
|||
How to Apply These Terms to Your New Programs |
|||
|
|||
If you develop a new program, and you want it to be of the greatest |
|||
possible use to the public, the best way to achieve this is to make it |
|||
free software which everyone can redistribute and change under these terms. |
|||
|
|||
To do so, attach the following notices to the program. It is safest |
|||
to attach them to the start of each source file to most effectively |
|||
state the exclusion of warranty; and each file should have at least |
|||
the "copyright" line and a pointer to where the full notice is found. |
|||
|
|||
<one line to give the program's name and a brief idea of what it does.> |
|||
Copyright (C) <year> <name of author> |
|||
|
|||
This program is free software: you can redistribute it and/or modify |
|||
it under the terms of the GNU General Public License as published by |
|||
the Free Software Foundation, either version 3 of the License, or |
|||
(at your option) any later version. |
|||
|
|||
This program is distributed in the hope that it will be useful, |
|||
but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
GNU General Public License for more details. |
|||
|
|||
You should have received a copy of the GNU General Public License |
|||
along with this program. If not, see <http://www.gnu.org/licenses/>. |
|||
|
|||
Also add information on how to contact you by electronic and paper mail. |
|||
|
|||
If the program does terminal interaction, make it output a short |
|||
notice like this when it starts in an interactive mode: |
|||
|
|||
<program> Copyright (C) <year> <name of author> |
|||
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. |
|||
This is free software, and you are welcome to redistribute it |
|||
under certain conditions; type `show c' for details. |
|||
|
|||
The hypothetical commands `show w' and `show c' should show the appropriate |
|||
parts of the General Public License. Of course, your program's commands |
|||
might be different; for a GUI interface, you would use an "about box". |
|||
|
|||
You should also get your employer (if you work as a programmer) or school, |
|||
if any, to sign a "copyright disclaimer" for the program, if necessary. |
|||
For more information on this, and how to apply and follow the GNU GPL, see |
|||
<http://www.gnu.org/licenses/>. |
|||
|
|||
The GNU General Public License does not permit incorporating your program |
|||
into proprietary programs. If your program is a subroutine library, you |
|||
may consider it more useful to permit linking proprietary applications with |
|||
the library. If this is what you want to do, use the GNU Lesser General |
|||
Public License instead of this License. But first, please read |
|||
<http://www.gnu.org/philosophy/why-not-lgpl.html>. |
2932
resources/3rdparty/glpk-4.57/ChangeLog
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
@ -0,0 +1,209 @@ |
|||
INSTALLING GLPK ON YOUR COMPUTER |
|||
******************************** |
|||
|
|||
Unpacking the distribution file |
|||
------------------------------- |
|||
The GLPK package (like all other GNU software) is distributed in the |
|||
form of a packed archive. It is one file named `glpk-X.Y.tar.gz', where |
|||
`X' is the major version number and `Y' is the minor version number; |
|||
for example, the archive name might be `glpk-4.15.tar.gz'. |
|||
|
|||
In order to prepare the distribution for installation you should: |
|||
|
|||
1. Copy the GLPK distribution file to a working directory. |
|||
|
|||
2. Unpack the distribution file with the following command: |
|||
|
|||
gzip -d glpk-X.Y.tar.gz |
|||
|
|||
After unpacking the distribution file is automatically renamed to |
|||
`glpk-X.Y.tar'. |
|||
|
|||
3. Unarchive the distribution file with the following command: |
|||
|
|||
tar -x < glpk-X.Y.tar |
|||
|
|||
It automatically creates the subdirectory `glpk-X.Y' containing the |
|||
GLPK distribution. |
|||
|
|||
Configuring the package |
|||
----------------------- |
|||
After unpacking and unarchiving the GLPK distribution you should |
|||
configure the package, i.e. automatically tune it for your platform. |
|||
|
|||
Normally, you should just `cd' to the directory `glpk-X.Y' and run the |
|||
`configure' script, e.g. |
|||
|
|||
./configure |
|||
|
|||
The `configure' shell script attempts to guess correct values for |
|||
various system-dependent variables used during compilation. It uses |
|||
those values to create a `Makefile' in each directory of the package. |
|||
It also creates file `config.h' containing platform-dependent |
|||
definitions. Finally, it creates a shell script `config.status' that |
|||
you can run in the future to recreate the current configuration, a file |
|||
`config.cache' that saves the results of its tests to speed up |
|||
reconfiguring, and a file `config.log' containing compiler output |
|||
(useful mainly for debugging `configure'). |
|||
|
|||
Running `configure' takes about a few seconds. While it is running, it |
|||
displays some messages that tell you what it is doing. If you don't want |
|||
to see the messages, run `configure' with its standard output redirected |
|||
to `dev/null'; for example, `./configure > /dev/null'. |
|||
|
|||
By default both static and shared versions of the GLPK library will be |
|||
compiled. Compilation of the shared librariy can be turned off by |
|||
specifying the `--disable-shared' option to `configure', e.g. |
|||
|
|||
./configure --disable-shared |
|||
|
|||
If you encounter problems building the library try using the above |
|||
option, because some platforms do not support shared libraries. |
|||
|
|||
The GLPK package has some optional features listed below. By default |
|||
all these features are disabled. To enable a feature the corresponding |
|||
option should be passed to the configure script. |
|||
|
|||
--with-gmp Enable using the GNU MP bignum library |
|||
|
|||
This feature allows the exact simplex solver to use the GNU MP |
|||
bignum library. If it is disabled, the exact simplex solver uses the |
|||
GLPK bignum module, which provides the same functionality as GNU MP, |
|||
however, it is much less efficient. |
|||
|
|||
For details about the GNU MP bignum library see its web page at |
|||
<http://gmplib.org/>. |
|||
|
|||
--with-zlib Enable using the zlib data compression library |
|||
|
|||
This feature allows GLPK API routines and the stand-alone solver to |
|||
read and write compressed data files performing compression and |
|||
decompression "on the fly" (compressed data files are recognized by |
|||
suffix `.gz' in the file name). It may be useful in case of large |
|||
MPS files to save the disk space. |
|||
|
|||
For details about the zlib compression library see its web page at |
|||
<http://www.zlib.net/>. |
|||
|
|||
--enable-dl The same as --enable-dl=ltdl |
|||
--enable-dl=ltdl Enable shared library support (GNU) |
|||
--enable-dl=dlfcn Enable shared library support (POSIX) |
|||
|
|||
Currently this feature is only needed to provide dynamic linking to |
|||
ODBC and MySQL shared libraries (see below). |
|||
|
|||
For details about the GNU shared library support see the manual at |
|||
<http://www.gnu.org/software/libtool/manual/>. |
|||
|
|||
--enable-odbc Enable using ODBC table driver (libiodbc) |
|||
--enable-odbc=unix Enable using ODBC table driver (libodbc) |
|||
|
|||
This feature allows transmitting data between MathProg model objects |
|||
and relational databases accessed through ODBC. |
|||
|
|||
For more details about this feature see the supplement "Using Data |
|||
Tables in the GNU MathProg Modeling Language" (doc/tables.*). |
|||
|
|||
--enable-mysql Enable using MySQL table driver (libmysql) |
|||
|
|||
This feature allows transmitting data between MathProg model objects |
|||
and MySQL relational databases. |
|||
|
|||
For more details about this feature see the supplement "Using Data |
|||
Tables in the GNU MathProg Modeling Language" (doc/tables.*). |
|||
|
|||
Compiling the package |
|||
--------------------- |
|||
Normally, you can compile (build) the package by typing the command: |
|||
|
|||
make |
|||
|
|||
It reads `Makefile' generated by `configure' and performs all necessary |
|||
jobs. |
|||
|
|||
If you want, you can override the `make' variables CFLAGS and LDFLAGS |
|||
like this: |
|||
|
|||
make CFLAGS=-O2 LDFLAGS=-s |
|||
|
|||
To compile the package in a different directory from the one containing |
|||
the source code, you must use a version of `make' that supports `VPATH' |
|||
variable, such as GNU `make'. `cd' to the directory where you want the |
|||
object files and executables to go and run the `configure' script. |
|||
`configure' automatically checks for the source code in the directory |
|||
that `configure' is in and in `..'. If for some reason `configure' is |
|||
not in the source code directory that you are configuring, then it will |
|||
report that it can't find the source code. In that case, run `configure' |
|||
with the option `--srcdir=DIR', where DIR is the directory that contains |
|||
the source code. |
|||
|
|||
Some systems require unusual options for compilation or linking that |
|||
the `configure' script does not know about. You can give `configure' |
|||
initial values for variables by setting them in the environment. Using |
|||
a Bourne-compatible shell, you can do that on the command line like |
|||
this: |
|||
|
|||
CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure |
|||
|
|||
Or on systems that have the `env' program, you can do it like this: |
|||
|
|||
env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure |
|||
|
|||
Here are the `make' variables that you might want to override with |
|||
environment variables when running `configure'. |
|||
|
|||
For these variables, any value given in the environment overrides the |
|||
value that `configure' would choose: |
|||
|
|||
CC: C compiler program. The default is `cc'. |
|||
|
|||
INSTALL: Program used to install files. The default value is `install' |
|||
if you have it, otherwise `cp'. |
|||
|
|||
For these variables, any value given in the environment is added to the |
|||
value that `configure' chooses: |
|||
|
|||
DEFS: Configuration options, in the form `-Dfoo -Dbar ...'. |
|||
|
|||
LIBS: Libraries to link with, in the form `-lfoo -lbar ...'. |
|||
|
|||
Checking the package |
|||
-------------------- |
|||
To check the package, i.e. to run some tests included in the package, |
|||
you can use the following command: |
|||
|
|||
make check |
|||
|
|||
Installing the package |
|||
---------------------- |
|||
Normally, to install the GLPK package you should type the following |
|||
command: |
|||
|
|||
make install |
|||
|
|||
By default, `make install' will install the package's files in |
|||
`usr/local/bin', `usr/local/lib', etc. You can specify an installation |
|||
prefix other than `/usr/local' by giving `configure' the option |
|||
`--prefix=PATH'. Alternately, you can do so by consistently giving a |
|||
value for the `prefix' variable when you run `make', e.g. |
|||
|
|||
make prefix=/usr/gnu |
|||
make prefix=/usr/gnu install |
|||
|
|||
After installing you can remove the program binaries and object files |
|||
from the source directory by typing `make clean'. To remove all files |
|||
that `configure' created (`Makefile', `config.status', etc.), just type |
|||
`make distclean'. |
|||
|
|||
The file `configure.ac' is used to create `configure' by a program |
|||
called `autoconf'. You only need it if you want to remake `configure' |
|||
using a newer version of `autoconf'. |
|||
|
|||
Uninstalling the package |
|||
------------------------ |
|||
To uninstall the GLPK package, i.e. to remove all the package's files |
|||
from the system places, you can use the following command: |
|||
|
|||
make uninstall |
|||
|
|||
======================================================================== |
@ -0,0 +1,7 @@ |
|||
## Process this file with automake to produce Makefile.in ##
|
|||
|
|||
ACLOCAL_AMFLAGS=-I m4 |
|||
|
|||
SUBDIRS = src examples |
|||
|
|||
## eof ##
|
@ -0,0 +1,759 @@ |
|||
# Makefile.in generated by automake 1.12.5 from Makefile.am.
|
|||
# @configure_input@
|
|||
|
|||
# Copyright (C) 1994-2012 Free Software Foundation, Inc.
|
|||
|
|||
# This Makefile.in is free software; the Free Software Foundation
|
|||
# gives unlimited permission to copy and/or distribute it,
|
|||
# with or without modifications, as long as this notice is preserved.
|
|||
|
|||
# This program is distributed in the hope that it will be useful,
|
|||
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
|||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
|||
# PARTICULAR PURPOSE.
|
|||
|
|||
@SET_MAKE@ |
|||
VPATH = @srcdir@ |
|||
am__make_dryrun = \
|
|||
{ \
|
|||
am__dry=no; \
|
|||
case $$MAKEFLAGS in \
|
|||
*\\[\ \ ]*) \
|
|||
echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \
|
|||
| grep '^AM OK$$' >/dev/null || am__dry=yes;; \
|
|||
*) \
|
|||
for am__flg in $$MAKEFLAGS; do \
|
|||
case $$am__flg in \
|
|||
*=*|--*) ;; \
|
|||
*n*) am__dry=yes; break;; \
|
|||
esac; \
|
|||
done;; \
|
|||
esac; \
|
|||
test $$am__dry = yes; \
|
|||
} |
|||
pkgdatadir = $(datadir)/@PACKAGE@ |
|||
pkgincludedir = $(includedir)/@PACKAGE@ |
|||
pkglibdir = $(libdir)/@PACKAGE@ |
|||
pkglibexecdir = $(libexecdir)/@PACKAGE@ |
|||
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd |
|||
install_sh_DATA = $(install_sh) -c -m 644 |
|||
install_sh_PROGRAM = $(install_sh) -c |
|||
install_sh_SCRIPT = $(install_sh) -c |
|||
INSTALL_HEADER = $(INSTALL_DATA) |
|||
transform = $(program_transform_name) |
|||
NORMAL_INSTALL = : |
|||
PRE_INSTALL = : |
|||
POST_INSTALL = : |
|||
NORMAL_UNINSTALL = : |
|||
PRE_UNINSTALL = : |
|||
POST_UNINSTALL = : |
|||
build_triplet = @build@ |
|||
host_triplet = @host@ |
|||
subdir = . |
|||
DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
|
|||
$(srcdir)/Makefile.in $(srcdir)/config.h.in \
|
|||
$(top_srcdir)/configure AUTHORS COPYING ChangeLog INSTALL NEWS \
|
|||
THANKS config.guess config.sub install-sh ltmain.sh missing |
|||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 |
|||
am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
|
|||
$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
|
|||
$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
|
|||
$(top_srcdir)/configure.ac |
|||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
|||
$(ACLOCAL_M4) |
|||
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
|
|||
configure.lineno config.status.lineno |
|||
mkinstalldirs = $(install_sh) -d |
|||
CONFIG_HEADER = config.h |
|||
CONFIG_CLEAN_FILES = |
|||
CONFIG_CLEAN_VPATH_FILES = |
|||
SOURCES = |
|||
DIST_SOURCES = |
|||
RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
|
|||
html-recursive info-recursive install-data-recursive \
|
|||
install-dvi-recursive install-exec-recursive \
|
|||
install-html-recursive install-info-recursive \
|
|||
install-pdf-recursive install-ps-recursive install-recursive \
|
|||
installcheck-recursive installdirs-recursive pdf-recursive \
|
|||
ps-recursive uninstall-recursive |
|||
am__can_run_installinfo = \
|
|||
case $$AM_UPDATE_INFO_DIR in \
|
|||
n|no|NO) false;; \
|
|||
*) (install-info --version) >/dev/null 2>&1;; \
|
|||
esac |
|||
RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
|
|||
distclean-recursive maintainer-clean-recursive |
|||
AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
|
|||
$(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
|
|||
cscope distdir dist dist-all distcheck |
|||
ETAGS = etags |
|||
CTAGS = ctags |
|||
CSCOPE = cscope |
|||
DIST_SUBDIRS = $(SUBDIRS) |
|||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) |
|||
distdir = $(PACKAGE)-$(VERSION) |
|||
top_distdir = $(distdir) |
|||
am__remove_distdir = \
|
|||
if test -d "$(distdir)"; then \
|
|||
find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \
|
|||
&& rm -rf "$(distdir)" \
|
|||
|| { sleep 5 && rm -rf "$(distdir)"; }; \
|
|||
else :; fi |
|||
am__post_remove_distdir = $(am__remove_distdir) |
|||
am__relativize = \
|
|||
dir0=`pwd`; \
|
|||
sed_first='s,^\([^/]*\)/.*$$,\1,'; \
|
|||
sed_rest='s,^[^/]*/*,,'; \
|
|||
sed_last='s,^.*/\([^/]*\)$$,\1,'; \
|
|||
sed_butlast='s,/*[^/]*$$,,'; \
|
|||
while test -n "$$dir1"; do \
|
|||
first=`echo "$$dir1" | sed -e "$$sed_first"`; \
|
|||
if test "$$first" != "."; then \
|
|||
if test "$$first" = ".."; then \
|
|||
dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
|
|||
dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
|
|||
else \
|
|||
first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
|
|||
if test "$$first2" = "$$first"; then \
|
|||
dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
|
|||
else \
|
|||
dir2="../$$dir2"; \
|
|||
fi; \
|
|||
dir0="$$dir0"/"$$first"; \
|
|||
fi; \
|
|||
fi; \
|
|||
dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
|
|||
done; \
|
|||
reldir="$$dir2" |
|||
DIST_ARCHIVES = $(distdir).tar.gz |
|||
GZIP_ENV = --best |
|||
DIST_TARGETS = dist-gzip |
|||
distuninstallcheck_listfiles = find . -type f -print |
|||
am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \
|
|||
| sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' |
|||
distcleancheck_listfiles = find . -type f -print |
|||
ACLOCAL = @ACLOCAL@ |
|||
AMTAR = @AMTAR@ |
|||
AR = @AR@ |
|||
AUTOCONF = @AUTOCONF@ |
|||
AUTOHEADER = @AUTOHEADER@ |
|||
AUTOMAKE = @AUTOMAKE@ |
|||
AWK = @AWK@ |
|||
CC = @CC@ |
|||
CCDEPMODE = @CCDEPMODE@ |
|||
CFLAGS = @CFLAGS@ |
|||
CPP = @CPP@ |
|||
CPPFLAGS = @CPPFLAGS@ |
|||
CYGPATH_W = @CYGPATH_W@ |
|||
DEFS = @DEFS@ |
|||
DEPDIR = @DEPDIR@ |
|||
DLLTOOL = @DLLTOOL@ |
|||
DSYMUTIL = @DSYMUTIL@ |
|||
DUMPBIN = @DUMPBIN@ |
|||
ECHO_C = @ECHO_C@ |
|||
ECHO_N = @ECHO_N@ |
|||
ECHO_T = @ECHO_T@ |
|||
EGREP = @EGREP@ |
|||
EXEEXT = @EXEEXT@ |
|||
FGREP = @FGREP@ |
|||
GREP = @GREP@ |
|||
INSTALL = @INSTALL@ |
|||
INSTALL_DATA = @INSTALL_DATA@ |
|||
INSTALL_PROGRAM = @INSTALL_PROGRAM@ |
|||
INSTALL_SCRIPT = @INSTALL_SCRIPT@ |
|||
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ |
|||
LD = @LD@ |
|||
LDFLAGS = @LDFLAGS@ |
|||
LIBOBJS = @LIBOBJS@ |
|||
LIBS = @LIBS@ |
|||
LIBTOOL = @LIBTOOL@ |
|||
LIPO = @LIPO@ |
|||
LN_S = @LN_S@ |
|||
LTLIBOBJS = @LTLIBOBJS@ |
|||
MAKEINFO = @MAKEINFO@ |
|||
MANIFEST_TOOL = @MANIFEST_TOOL@ |
|||
MKDIR_P = @MKDIR_P@ |
|||
NM = @NM@ |
|||
NMEDIT = @NMEDIT@ |
|||
OBJDUMP = @OBJDUMP@ |
|||
OBJEXT = @OBJEXT@ |
|||
OTOOL = @OTOOL@ |
|||
OTOOL64 = @OTOOL64@ |
|||
PACKAGE = @PACKAGE@ |
|||
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ |
|||
PACKAGE_NAME = @PACKAGE_NAME@ |
|||
PACKAGE_STRING = @PACKAGE_STRING@ |
|||
PACKAGE_TARNAME = @PACKAGE_TARNAME@ |
|||
PACKAGE_URL = @PACKAGE_URL@ |
|||
PACKAGE_VERSION = @PACKAGE_VERSION@ |
|||
PATH_SEPARATOR = @PATH_SEPARATOR@ |
|||
RANLIB = @RANLIB@ |
|||
SED = @SED@ |
|||
SET_MAKE = @SET_MAKE@ |
|||
SHELL = @SHELL@ |
|||
STRIP = @STRIP@ |
|||
VERSION = @VERSION@ |
|||
abs_builddir = @abs_builddir@ |
|||
abs_srcdir = @abs_srcdir@ |
|||
abs_top_builddir = @abs_top_builddir@ |
|||
abs_top_srcdir = @abs_top_srcdir@ |
|||
ac_ct_AR = @ac_ct_AR@ |
|||
ac_ct_CC = @ac_ct_CC@ |
|||
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ |
|||
am__include = @am__include@ |
|||
am__leading_dot = @am__leading_dot@ |
|||
am__quote = @am__quote@ |
|||
am__tar = @am__tar@ |
|||
am__untar = @am__untar@ |
|||
bindir = @bindir@ |
|||
build = @build@ |
|||
build_alias = @build_alias@ |
|||
build_cpu = @build_cpu@ |
|||
build_os = @build_os@ |
|||
build_vendor = @build_vendor@ |
|||
builddir = @builddir@ |
|||
datadir = @datadir@ |
|||
datarootdir = @datarootdir@ |
|||
docdir = @docdir@ |
|||
dvidir = @dvidir@ |
|||
exec_prefix = @exec_prefix@ |
|||
host = @host@ |
|||
host_alias = @host_alias@ |
|||
host_cpu = @host_cpu@ |
|||
host_os = @host_os@ |
|||
host_vendor = @host_vendor@ |
|||
htmldir = @htmldir@ |
|||
includedir = @includedir@ |
|||
infodir = @infodir@ |
|||
install_sh = @install_sh@ |
|||
libdir = @libdir@ |
|||
libexecdir = @libexecdir@ |
|||
localedir = @localedir@ |
|||
localstatedir = @localstatedir@ |
|||
mandir = @mandir@ |
|||
mkdir_p = @mkdir_p@ |
|||
oldincludedir = @oldincludedir@ |
|||
pdfdir = @pdfdir@ |
|||
prefix = @prefix@ |
|||
program_transform_name = @program_transform_name@ |
|||
psdir = @psdir@ |
|||
sbindir = @sbindir@ |
|||
sharedstatedir = @sharedstatedir@ |
|||
srcdir = @srcdir@ |
|||
sysconfdir = @sysconfdir@ |
|||
target_alias = @target_alias@ |
|||
top_build_prefix = @top_build_prefix@ |
|||
top_builddir = @top_builddir@ |
|||
top_srcdir = @top_srcdir@ |
|||
ACLOCAL_AMFLAGS = -I m4 |
|||
SUBDIRS = src examples |
|||
all: config.h |
|||
$(MAKE) $(AM_MAKEFLAGS) all-recursive |
|||
|
|||
.SUFFIXES: |
|||
am--refresh: Makefile |
|||
@: |
|||
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) |
|||
@for dep in $?; do \
|
|||
case '$(am__configure_deps)' in \
|
|||
*$$dep*) \
|
|||
echo ' cd $(srcdir) && $(AUTOMAKE) --gnu'; \
|
|||
$(am__cd) $(srcdir) && $(AUTOMAKE) --gnu \
|
|||
&& exit 0; \
|
|||
exit 1;; \
|
|||
esac; \
|
|||
done; \
|
|||
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \
|
|||
$(am__cd) $(top_srcdir) && \
|
|||
$(AUTOMAKE) --gnu Makefile |
|||
.PRECIOUS: Makefile |
|||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status |
|||
@case '$?' in \
|
|||
*config.status*) \
|
|||
echo ' $(SHELL) ./config.status'; \
|
|||
$(SHELL) ./config.status;; \
|
|||
*) \
|
|||
echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
|
|||
cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
|
|||
esac; |
|||
|
|||
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) |
|||
$(SHELL) ./config.status --recheck |
|||
|
|||
$(top_srcdir)/configure: $(am__configure_deps) |
|||
$(am__cd) $(srcdir) && $(AUTOCONF) |
|||
$(ACLOCAL_M4): $(am__aclocal_m4_deps) |
|||
$(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) |
|||
$(am__aclocal_m4_deps): |
|||
|
|||
config.h: stamp-h1 |
|||
@if test ! -f $@; then rm -f stamp-h1; else :; fi |
|||
@if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) stamp-h1; else :; fi |
|||
|
|||
stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status |
|||
@rm -f stamp-h1 |
|||
cd $(top_builddir) && $(SHELL) ./config.status config.h |
|||
$(srcdir)/config.h.in: $(am__configure_deps) |
|||
($(am__cd) $(top_srcdir) && $(AUTOHEADER)) |
|||
rm -f stamp-h1 |
|||
touch $@ |
|||
|
|||
distclean-hdr: |
|||
-rm -f config.h stamp-h1 |
|||
|
|||
mostlyclean-libtool: |
|||
-rm -f *.lo |
|||
|
|||
clean-libtool: |
|||
-rm -rf .libs _libs |
|||
|
|||
distclean-libtool: |
|||
-rm -f libtool config.lt |
|||
|
|||
# This directory's subdirectories are mostly independent; you can cd
|
|||
# into them and run 'make' without going through this Makefile.
|
|||
# To change the values of 'make' variables: instead of editing Makefiles,
|
|||
# (1) if the variable is set in 'config.status', edit 'config.status'
|
|||
# (which will cause the Makefiles to be regenerated when you run 'make');
|
|||
# (2) otherwise, pass the desired values on the 'make' command line.
|
|||
$(RECURSIVE_TARGETS) $(RECURSIVE_CLEAN_TARGETS): |
|||
@fail= failcom='exit 1'; \
|
|||
for f in x $$MAKEFLAGS; do \
|
|||
case $$f in \
|
|||
*=* | --[!k]*);; \
|
|||
*k*) failcom='fail=yes';; \
|
|||
esac; \
|
|||
done; \
|
|||
dot_seen=no; \
|
|||
target=`echo $@ | sed s/-recursive//`; \
|
|||
case "$@" in \
|
|||
distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
|
|||
*) list='$(SUBDIRS)' ;; \
|
|||
esac; \
|
|||
for subdir in $$list; do \
|
|||
echo "Making $$target in $$subdir"; \
|
|||
if test "$$subdir" = "."; then \
|
|||
dot_seen=yes; \
|
|||
local_target="$$target-am"; \
|
|||
else \
|
|||
local_target="$$target"; \
|
|||
fi; \
|
|||
($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|
|||
|| eval $$failcom; \
|
|||
done; \
|
|||
if test "$$dot_seen" = "no"; then \
|
|||
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
|
|||
fi; test -z "$$fail" |
|||
tags-recursive: |
|||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
|||
test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
|
|||
done |
|||
ctags-recursive: |
|||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
|||
test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
|
|||
done |
|||
cscopelist-recursive: |
|||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
|||
test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) cscopelist); \
|
|||
done |
|||
|
|||
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) |
|||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
|||
unique=`for i in $$list; do \
|
|||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
|||
done | \
|
|||
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
|
|||
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
|||
mkid -fID $$unique |
|||
tags: TAGS |
|||
|
|||
TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ |
|||
$(TAGS_FILES) $(LISP) |
|||
set x; \
|
|||
here=`pwd`; \
|
|||
if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
|
|||
include_option=--etags-include; \
|
|||
empty_fix=.; \
|
|||
else \
|
|||
include_option=--include; \
|
|||
empty_fix=; \
|
|||
fi; \
|
|||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
|||
if test "$$subdir" = .; then :; else \
|
|||
test ! -f $$subdir/TAGS || \
|
|||
set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
|
|||
fi; \
|
|||
done; \
|
|||
list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
|
|||
unique=`for i in $$list; do \
|
|||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
|||
done | \
|
|||
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
|
|||
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
|||
shift; \
|
|||
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
|
|||
test -n "$$unique" || unique=$$empty_fix; \
|
|||
if test $$# -gt 0; then \ |
|||
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
|||
"$$@" $$unique; \
|
|||
else \
|
|||
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
|||
$$unique; \
|
|||
fi; \
|
|||
fi |
|||
ctags: CTAGS |
|||
CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ |
|||
$(TAGS_FILES) $(LISP) |
|||
list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
|
|||
unique=`for i in $$list; do \
|
|||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
|||
done | \
|
|||
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
|
|||
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
|||
test -z "$(CTAGS_ARGS)$$unique" \
|
|||
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
|
|||
$$unique |
|||
|
|||
GTAGS: |
|||
here=`$(am__cd) $(top_builddir) && pwd` \
|
|||
&& $(am__cd) $(top_srcdir) \
|
|||
&& gtags -i $(GTAGS_ARGS) "$$here" |
|||
|
|||
cscope: cscope.files |
|||
test ! -s cscope.files \
|
|||
|| $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS) |
|||
|
|||
clean-cscope: |
|||
-rm -f cscope.files |
|||
|
|||
cscope.files: clean-cscope cscopelist-recursive cscopelist |
|||
|
|||
cscopelist: cscopelist-recursive $(HEADERS) $(SOURCES) $(LISP) |
|||
list='$(SOURCES) $(HEADERS) $(LISP)'; \
|
|||
case "$(srcdir)" in \
|
|||
[\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
|
|||
*) sdir=$(subdir)/$(srcdir) ;; \
|
|||
esac; \
|
|||
for i in $$list; do \
|
|||
if test -f "$$i"; then \
|
|||
echo "$(subdir)/$$i"; \
|
|||
else \
|
|||
echo "$$sdir/$$i"; \
|
|||
fi; \
|
|||
done >> $(top_builddir)/cscope.files |
|||
|
|||
distclean-tags: |
|||
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags |
|||
-rm -f cscope.out cscope.in.out cscope.po.out cscope.files |
|||
|
|||
distdir: $(DISTFILES) |
|||
$(am__remove_distdir) |
|||
test -d "$(distdir)" || mkdir "$(distdir)" |
|||
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
|||
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
|||
list='$(DISTFILES)'; \
|
|||
dist_files=`for file in $$list; do echo $$file; done | \
|
|||
sed -e "s|^$$srcdirstrip/||;t" \
|
|||
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
|
|||
case $$dist_files in \
|
|||
*/*) $(MKDIR_P) `echo "$$dist_files" | \
|
|||
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
|
|||
sort -u` ;; \
|
|||
esac; \
|
|||
for file in $$dist_files; do \
|
|||
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
|
|||
if test -d $$d/$$file; then \
|
|||
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
|
|||
if test -d "$(distdir)/$$file"; then \
|
|||
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
|
|||
fi; \
|
|||
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
|
|||
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
|
|||
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
|
|||
fi; \
|
|||
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
|
|||
else \
|
|||
test -f "$(distdir)/$$file" \
|
|||
|| cp -p $$d/$$file "$(distdir)/$$file" \
|
|||
|| exit 1; \
|
|||
fi; \
|
|||
done |
|||
@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
|
|||
if test "$$subdir" = .; then :; else \
|
|||
$(am__make_dryrun) \
|
|||
|| test -d "$(distdir)/$$subdir" \
|
|||
|| $(MKDIR_P) "$(distdir)/$$subdir" \
|
|||
|| exit 1; \
|
|||
dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
|
|||
$(am__relativize); \
|
|||
new_distdir=$$reldir; \
|
|||
dir1=$$subdir; dir2="$(top_distdir)"; \
|
|||
$(am__relativize); \
|
|||
new_top_distdir=$$reldir; \
|
|||
echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
|
|||
echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
|
|||
($(am__cd) $$subdir && \
|
|||
$(MAKE) $(AM_MAKEFLAGS) \
|
|||
top_distdir="$$new_top_distdir" \
|
|||
distdir="$$new_distdir" \
|
|||
am__remove_distdir=: \
|
|||
am__skip_length_check=: \
|
|||
am__skip_mode_fix=: \
|
|||
distdir) \
|
|||
|| exit 1; \
|
|||
fi; \
|
|||
done |
|||
-test -n "$(am__skip_mode_fix)" \
|
|||
|| find "$(distdir)" -type d ! -perm -755 \
|
|||
-exec chmod u+rwx,go+rx {} \; -o \
|
|||
! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
|
|||
! -type d ! -perm -400 -exec chmod a+r {} \; -o \
|
|||
! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
|
|||
|| chmod -R a+r "$(distdir)" |
|||
dist-gzip: distdir |
|||
tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz |
|||
$(am__post_remove_distdir) |
|||
|
|||
dist-bzip2: distdir |
|||
tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 |
|||
$(am__post_remove_distdir) |
|||
|
|||
dist-lzip: distdir |
|||
tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz |
|||
$(am__post_remove_distdir) |
|||
|
|||
dist-xz: distdir |
|||
tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz |
|||
$(am__post_remove_distdir) |
|||
|
|||
dist-tarZ: distdir |
|||
tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z |
|||
$(am__post_remove_distdir) |
|||
|
|||
dist-shar: distdir |
|||
shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz |
|||
$(am__post_remove_distdir) |
|||
|
|||
dist-zip: distdir |
|||
-rm -f $(distdir).zip |
|||
zip -rq $(distdir).zip $(distdir) |
|||
$(am__post_remove_distdir) |
|||
|
|||
dist dist-all: |
|||
$(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:' |
|||
$(am__post_remove_distdir) |
|||
|
|||
# This target untars the dist file and tries a VPATH configuration. Then
|
|||
# it guarantees that the distribution is self-contained by making another
|
|||
# tarfile.
|
|||
distcheck: dist |
|||
case '$(DIST_ARCHIVES)' in \
|
|||
*.tar.gz*) \
|
|||
GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\
|
|||
*.tar.bz2*) \
|
|||
bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
|
|||
*.tar.lz*) \
|
|||
lzip -dc $(distdir).tar.lz | $(am__untar) ;;\
|
|||
*.tar.xz*) \
|
|||
xz -dc $(distdir).tar.xz | $(am__untar) ;;\
|
|||
*.tar.Z*) \
|
|||
uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
|
|||
*.shar.gz*) \
|
|||
GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\
|
|||
*.zip*) \
|
|||
unzip $(distdir).zip ;;\
|
|||
esac |
|||
chmod -R a-w $(distdir) |
|||
chmod u+w $(distdir) |
|||
mkdir $(distdir)/_build $(distdir)/_inst |
|||
chmod a-w $(distdir) |
|||
test -d $(distdir)/_build || exit 0; \
|
|||
dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
|
|||
&& dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
|
|||
&& am__cwd=`pwd` \
|
|||
&& $(am__cd) $(distdir)/_build \
|
|||
&& ../configure --srcdir=.. --prefix="$$dc_install_base" \
|
|||
$(AM_DISTCHECK_CONFIGURE_FLAGS) \
|
|||
$(DISTCHECK_CONFIGURE_FLAGS) \
|
|||
&& $(MAKE) $(AM_MAKEFLAGS) \
|
|||
&& $(MAKE) $(AM_MAKEFLAGS) dvi \
|
|||
&& $(MAKE) $(AM_MAKEFLAGS) check \
|
|||
&& $(MAKE) $(AM_MAKEFLAGS) install \
|
|||
&& $(MAKE) $(AM_MAKEFLAGS) installcheck \
|
|||
&& $(MAKE) $(AM_MAKEFLAGS) uninstall \
|
|||
&& $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \
|
|||
distuninstallcheck \
|
|||
&& chmod -R a-w "$$dc_install_base" \
|
|||
&& ({ \
|
|||
(cd ../.. && umask 077 && mkdir "$$dc_destdir") \
|
|||
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
|
|||
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
|
|||
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
|
|||
distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
|
|||
} || { rm -rf "$$dc_destdir"; exit 1; }) \
|
|||
&& rm -rf "$$dc_destdir" \
|
|||
&& $(MAKE) $(AM_MAKEFLAGS) dist \
|
|||
&& rm -rf $(DIST_ARCHIVES) \
|
|||
&& $(MAKE) $(AM_MAKEFLAGS) distcleancheck \
|
|||
&& cd "$$am__cwd" \
|
|||
|| exit 1 |
|||
$(am__post_remove_distdir) |
|||
@(echo "$(distdir) archives ready for distribution: "; \
|
|||
list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
|
|||
sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' |
|||
distuninstallcheck: |
|||
@test -n '$(distuninstallcheck_dir)' || { \
|
|||
echo 'ERROR: trying to run $@ with an empty' \
|
|||
'$$(distuninstallcheck_dir)' >&2; \
|
|||
exit 1; \
|
|||
}; \
|
|||
$(am__cd) '$(distuninstallcheck_dir)' || { \
|
|||
echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \
|
|||
exit 1; \
|
|||
}; \
|
|||
test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \
|
|||
|| { echo "ERROR: files left after uninstall:" ; \
|
|||
if test -n "$(DESTDIR)"; then \
|
|||
echo " (check DESTDIR support)"; \
|
|||
fi ; \
|
|||
$(distuninstallcheck_listfiles) ; \
|
|||
exit 1; } >&2 |
|||
distcleancheck: distclean |
|||
@if test '$(srcdir)' = . ; then \
|
|||
echo "ERROR: distcleancheck can only run from a VPATH build" ; \
|
|||
exit 1 ; \
|
|||
fi |
|||
@test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
|
|||
|| { echo "ERROR: files left in build directory after distclean:" ; \
|
|||
$(distcleancheck_listfiles) ; \
|
|||
exit 1; } >&2 |
|||
check-am: all-am |
|||
check: check-recursive |
|||
all-am: Makefile config.h |
|||
installdirs: installdirs-recursive |
|||
installdirs-am: |
|||
install: install-recursive |
|||
install-exec: install-exec-recursive |
|||
install-data: install-data-recursive |
|||
uninstall: uninstall-recursive |
|||
|
|||
install-am: all-am |
|||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am |
|||
|
|||
installcheck: installcheck-recursive |
|||
install-strip: |
|||
if test -z '$(STRIP)'; then \
|
|||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
|||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
|||
install; \
|
|||
else \
|
|||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
|||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
|||
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
|
|||
fi |
|||
mostlyclean-generic: |
|||
|
|||
clean-generic: |
|||
|
|||
distclean-generic: |
|||
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) |
|||
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) |
|||
|
|||
maintainer-clean-generic: |
|||
@echo "This command is intended for maintainers to use" |
|||
@echo "it deletes files that may require special tools to rebuild." |
|||
clean: clean-recursive |
|||
|
|||
clean-am: clean-generic clean-libtool mostlyclean-am |
|||
|
|||
distclean: distclean-recursive |
|||
-rm -f $(am__CONFIG_DISTCLEAN_FILES) |
|||
-rm -f Makefile |
|||
distclean-am: clean-am distclean-generic distclean-hdr \ |
|||
distclean-libtool distclean-tags |
|||
|
|||
dvi: dvi-recursive |
|||
|
|||
dvi-am: |
|||
|
|||
html: html-recursive |
|||
|
|||
html-am: |
|||
|
|||
info: info-recursive |
|||
|
|||
info-am: |
|||
|
|||
install-data-am: |
|||
|
|||
install-dvi: install-dvi-recursive |
|||
|
|||
install-dvi-am: |
|||
|
|||
install-exec-am: |
|||
|
|||
install-html: install-html-recursive |
|||
|
|||
install-html-am: |
|||
|
|||
install-info: install-info-recursive |
|||
|
|||
install-info-am: |
|||
|
|||
install-man: |
|||
|
|||
install-pdf: install-pdf-recursive |
|||
|
|||
install-pdf-am: |
|||
|
|||
install-ps: install-ps-recursive |
|||
|
|||
install-ps-am: |
|||
|
|||
installcheck-am: |
|||
|
|||
maintainer-clean: maintainer-clean-recursive |
|||
-rm -f $(am__CONFIG_DISTCLEAN_FILES) |
|||
-rm -rf $(top_srcdir)/autom4te.cache |
|||
-rm -f Makefile |
|||
maintainer-clean-am: distclean-am maintainer-clean-generic |
|||
|
|||
mostlyclean: mostlyclean-recursive |
|||
|
|||
mostlyclean-am: mostlyclean-generic mostlyclean-libtool |
|||
|
|||
pdf: pdf-recursive |
|||
|
|||
pdf-am: |
|||
|
|||
ps: ps-recursive |
|||
|
|||
ps-am: |
|||
|
|||
uninstall-am: |
|||
|
|||
.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all \ |
|||
cscopelist-recursive ctags-recursive install-am install-strip \
|
|||
tags-recursive |
|||
|
|||
.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ |
|||
all all-am am--refresh check check-am clean clean-cscope \
|
|||
clean-generic clean-libtool cscope cscopelist \
|
|||
cscopelist-recursive ctags ctags-recursive dist dist-all \
|
|||
dist-bzip2 dist-gzip dist-lzip dist-shar dist-tarZ dist-xz \
|
|||
dist-zip distcheck distclean distclean-generic distclean-hdr \
|
|||
distclean-libtool distclean-tags distcleancheck distdir \
|
|||
distuninstallcheck dvi dvi-am html html-am info info-am \
|
|||
install install-am install-data install-data-am install-dvi \
|
|||
install-dvi-am install-exec install-exec-am install-html \
|
|||
install-html-am install-info install-info-am install-man \
|
|||
install-pdf install-pdf-am install-ps install-ps-am \
|
|||
install-strip installcheck installcheck-am installdirs \
|
|||
installdirs-am maintainer-clean maintainer-clean-generic \
|
|||
mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
|
|||
ps ps-am tags tags-recursive uninstall uninstall-am |
|||
|
|||
|
|||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
|||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
|||
.NOEXPORT: |
1841
resources/3rdparty/glpk-4.57/NEWS
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
@ -0,0 +1,39 @@ |
|||
Olga K. gewidmet |
|||
|
|||
GLPK (GNU Linear Programming Kit) Version 4.57 |
|||
|
|||
Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, |
|||
2009, 2010, 2011, 2013, 2014, 2015 Andrew Makhorin, Department for |
|||
Applied Informatics, Moscow Aviation Institute, Moscow, Russia. All |
|||
rights reserved. E-mail: <mao@gnu.org>. |
|||
|
|||
GLPK is part of the GNU Project released under the aegis of GNU. |
|||
|
|||
GLPK is free software: you can redistribute it and/or modify it |
|||
under the terms of the GNU General Public License as published by the |
|||
Free Software Foundation, either version 3 of the License, or (at your |
|||
option) any later version. |
|||
|
|||
See the file COPYING for the GNU General Public License. |
|||
|
|||
See the file INSTALL for compilation and installation instructions. |
|||
|
|||
The GLPK package is a set of routines written in ANSI C and organized |
|||
in the form of a callable library. This package is intended for solving |
|||
large-scale linear programming (LP), mixed integer linear programming |
|||
(MIP), and other related problems. |
|||
|
|||
The GLPK package includes the following main components: |
|||
|
|||
* implementation of the simplex method; |
|||
* implementation of the exact simplex method based on bignum (rational) |
|||
arithmetic; |
|||
* implementation of the primal-dual interior-point method; |
|||
* implementation of the branch-and-cut method; |
|||
* application program interface (API); |
|||
* GNU MathProg modeling language (a subset of AMPL); |
|||
* GLPSOL, a stand-alone LP/MIP solver. |
|||
|
|||
See GLPK webpage <http://www.gnu.org/software/glpk/glpk.html>. |
|||
|
|||
Please report bugs to <bug-glpk@gnu.org>. |
@ -0,0 +1,223 @@ |
|||
Achim Gaedke <achim.gaedke@gmail.com> for bug report. |
|||
|
|||
Alexandre Oliva <oliva@lsd.ic.unicamp.br> for bug report. |
|||
|
|||
Andre Girard <andre@inrs-emt.uquebec.ca> for bug report. |
|||
|
|||
Andrew Hamilton-Wright <andrewhw@ieee.org> for bug report. |
|||
|
|||
Andrew Hood <ajhood@fl.net.au> for bug report. |
|||
|
|||
Anne-Laurence Putz <anne-laurence.putz@eurodecision.com> for bug |
|||
report. |
|||
|
|||
Anton Voropaev <anton.n.voropaev@gmail.com> for bug and typo report. |
|||
|
|||
Axel Simon <Axel.Simon@ens.fr> for bug report. |
|||
|
|||
Bernhard Schmidt <schmidt@math.uni-augsburg.de> for bug report. |
|||
|
|||
Boris Wirtz <Boris.Wirtz@uni-oldenburg.de> for bug report. |
|||
|
|||
Brady Hunsaker <hunsaker@engr.pitt.edu> for contribution of a routine |
|||
for bounds sensitivity analysis. |
|||
|
|||
Brady Hunsaker <hunsaker@engr.pitt.edu> for some suggestions concerning |
|||
MIP routines. |
|||
|
|||
Brian Gladman <brg@gladman.plus.com> for suggestion. |
|||
|
|||
Cameron Kellough <Cameron.Kellough@sri.com> for bug report. |
|||
|
|||
Carlo Baldassi <carlobaldassi@gmail.com> for bug report. |
|||
|
|||
Cedric[FR] <fox2113@wanadoo.fr> for bug report. |
|||
|
|||
Charles Brixko <charles.brixko@voo.be> for bug report. |
|||
|
|||
Chris Matrakidis <cmatraki@gmail.com> for suggestion. |
|||
|
|||
Chris Rosebrugh <cpr@pobox.com> for contribution of a new version of |
|||
GLPK JNI (Java Native Interface). |
|||
|
|||
Christophe Caron <caron@diamant.jouy.inra.fr> for bug report. |
|||
|
|||
David T. Price <dtprice@speakeasy.net> for bug report. |
|||
|
|||
Dennis Schridde <devurandom@gmx.net> for bug report. |
|||
|
|||
Enric Rodriguez <erodri@lsi.upc.edu> for bug report. |
|||
|
|||
Flavio Keidi Miyazawa <fkm@ic.unicamp.br> for bug report. |
|||
|
|||
Gabriel Hackebeil <gabehack@gmail.com> for bug report. |
|||
|
|||
Giles Thompson <gwpt1@cus.cam.ac.uk> for bug report. |
|||
|
|||
Giorgio Sartor <0gioker0@gmail.com> for contribution of routines that |
|||
implement the proximity search heuristic for MIP. |
|||
|
|||
Graham Rockwell <bionomicron@gmail.com> for bug report. |
|||
|
|||
Hans Schwengeler <Hans.Schwengeler@unibas.ch> for bug report. |
|||
|
|||
Harley Mackenzie <hjm@bigpond.com> for contribution of GLPK FAQ. |
|||
|
|||
Dr. Harley Mackenzie <hjm@hardsoftware.com> for two example MathProg |
|||
models (curve fitting problem). |
|||
|
|||
Heinrich Schuchardt <heinrich.schuchardt@gmx.de> for contribution of |
|||
makefiles and testing the package under 64-bit Windows. |
|||
|
|||
Heinrich Schuchardt <heinrich.schuchardt@gmx.de> for contribution of |
|||
two MathProg table drivers for iODBC and MySQL. |
|||
|
|||
Heinrich Schuchardt <heinrich.schuchardt@gmx.de> for some patches for |
|||
the MathProg translator. |
|||
|
|||
Heinrich Schuchardt <xypron.glpk@gmx.de> for testing the package on |
|||
32- and 64-bit MS Windows platforms. |
|||
|
|||
Ivan Luzzi <iluzzi@libero.it> for comments concerning CPLEX LP format. |
|||
|
|||
Ivo van Baren <i.van.baren@freeler.nl> for contribution of GLPK DELI |
|||
(Delphi Interface). |
|||
|
|||
Jan Engelhardt <jengelh@inai.de> for some suggestions. |
|||
|
|||
Jeffrey Kantor <Kantor.1@nd.edu> for reporting typos in the MathProg |
|||
language reference. |
|||
|
|||
Jeroen Demeyer <jdemeyer@cage.ugent.be> for suggestion. |
|||
|
|||
Jiri Spitz <jiri.spitz@telecom.cz> for bug report. |
|||
|
|||
Joey Rios <joeylrios@hotmail.com> for some suggestions. |
|||
|
|||
Jonathan Senning <Jonathan.Senning@gordon.edu> for bug report. |
|||
|
|||
Karel Zimmermann <kzimm@diamant.jouy.inra.fr> for bug report. |
|||
|
|||
Kelly Westbrooks <kellywestbrooks@yahoo.com> for suggestions. |
|||
|
|||
Kendall Demaree <kendal.demaree@verizon.net> for bug report. |
|||
|
|||
Kjell Eikland <kjell.eikland@broadpark.no> for bug report. |
|||
|
|||
Larry D'Agostino <Larry.D'Agostino@gmacrescap.com> for example model in |
|||
MathProg. |
|||
|
|||
Luiz Bettoni <bettoni@cpgei.ct.utfpr.edu.br> for some suggestions. |
|||
|
|||
Marco Atzeri <marco.atzeri@gmail.com> for bug report. |
|||
|
|||
Marco Atzeri <marco_atzeri@yahoo.it> for bug report. |
|||
|
|||
Mark Meketon <Marc.Meketon@oliverwyman.com> for bug report. |
|||
|
|||
Markus Pilz <pilz@cs.uni-bonn.de> for bug report. |
|||
|
|||
Martin Jacob <mj@bahntechnik.de> for bug report. |
|||
|
|||
Minh Ha Duong <haduong@centre-cired.fr> for fixing doc typos. |
|||
|
|||
Morten Welinder <terra@diku.dk> for bug report. |
|||
|
|||
Morten Welinder <terra@gnu.org> for bug report. |
|||
|
|||
Nelson H. F. Beebe <beebe@math.utah.edu> for bug report. |
|||
|
|||
Nicolo Giorgetti <giorgetti@dii.unisi.it> for contribution of GLPKMEX, |
|||
a Matlab MEX interface. |
|||
|
|||
Niels Klitgord <niels@bu.edu> for bug report. |
|||
|
|||
Nigel Galloway <Nigel_Galloway@operamail.com> for an example MathProg |
|||
model. |
|||
|
|||
Nigel Galloway <Nigel_Galloway@operamail.com> for an example program |
|||
in C#. |
|||
|
|||
Nigel Galloway <nigel_galloway@operamail.com> for bug report. |
|||
|
|||
Nigel Galloway <nigel_galloway@operamail.com> for example models in |
|||
MathProg. |
|||
|
|||
Noli Sicad <nsicad@gmail.com> for testing glpk under Mac OS. |
|||
|
|||
Noli Sicad <nsicad@gmail.com> for example model in MathProg. |
|||
|
|||
Olivier <odwl@skynet.be> for bug report. |
|||
|
|||
Oscar Gustafsson <oscarg@isy.liu.se> for contribution of a routine to |
|||
write data in OPB (pseudo boolean) format. |
|||
|
|||
Pablo Yapura <ypf@agro.unlp.edu.ar> for translation the document |
|||
"Modeling Language GNU MathProg" to Spanish. |
|||
|
|||
Pedro P. Wong <d00604@taipower.com.tw> for bug report. |
|||
|
|||
Peter T. Breuer <ptb@inv.it.uc3m.es> for bug report. |
|||
|
|||
Peter A. Huegler <phuegler@bsco.com> for bug report. |
|||
|
|||
Peter Ingerfeld <peter.ingerfeld@mops-optimizer.com> for bug report. |
|||
|
|||
Peter Lee <plee@kinggee.com.au> for example LP model and bug report. |
|||
|
|||
Pietro Scionti <pietro.scionti@archinet.it> for report typos found in |
|||
the reference manual. |
|||
|
|||
Rafael Laboissiere <rafael@debian.org> for useful advices concerning |
|||
shared library support under GNU/Linux. |
|||
|
|||
Raniere Gaia Costa da Silva for bug report. |
|||
|
|||
Remy Roy <remyroyster@gmail.com> for bug report. |
|||
|
|||
Robbie Morrison <robbie@actrix.co.nz> for correcting the glpk manual. |
|||
|
|||
Robert Wood <rgwood01@cox.net> for example model in MathProg. |
|||
|
|||
Roberto Bagnara <bagnara@cs.unipr.it> (Department of Mathematics, |
|||
University of Parma, Italy) for bug report. |
|||
|
|||
Sami Farin <sfarin@ratol.fi> for bug report. |
|||
|
|||
Sebastian Nowozin <nowozin@gmail.com> for example models in MathProg. |
|||
|
|||
Sebastien Briais <sbriais@free.fr> for bug report. |
|||
|
|||
Sebastien de Menten <sdementen@hotmail.com> for bug report. |
|||
|
|||
Sebastien Villemot <sebastien@debian.org> for bug report. |
|||
|
|||
Stefan Vigerske <stefan@math.hu-berlin.de> for bug report. |
|||
|
|||
Stefan Vigerske <stefan@vigerske.de> for bug report. |
|||
|
|||
Sylvain Fournier for bug report. |
|||
|
|||
Thomas Kahle <tom111@gmx.de> for some suggestions. |
|||
|
|||
Uday Venkatadri <Uday.Venkatadri@dal.ca> for bug report. |
|||
|
|||
Vijay Patil <vijay.patil@gmail.com> for testing the package under |
|||
Windows XP. |
|||
|
|||
Vlahos Kiriakos <Kiriakos.Vlahos@gs.com> for bug report. |
|||
|
|||
Xypron <xypron.glpk@gmx.de> for bug fixing and some improvments in the |
|||
FPUMP module. |
|||
|
|||
Xypron <xypron.glpk@gmx.de> for bug patch. |
|||
|
|||
Xypron <xypron.glpk@gmx.de> for contribution and testing batch scripts |
|||
to build Glpk with MS Visual Studio 2010. |
|||
|
|||
Xypron <xypron.glpk@gmx.de> for improving the SQL table driver. |
|||
|
|||
Xypron <xypron.glpk@gmx.de> for testing GLPK on 64-bit platforms and |
|||
for maintaining Windows versions of the package. |
|||
|
|||
Yuri Victorovich <yuri@gjt.org> for contribution of GLPK Java binding. |
@ -0,0 +1,949 @@ |
|||
# generated automatically by aclocal 1.12.5 -*- Autoconf -*- |
|||
|
|||
# Copyright (C) 1996-2012 Free Software Foundation, Inc. |
|||
|
|||
# This file is free software; the Free Software Foundation |
|||
# gives unlimited permission to copy and/or distribute it, |
|||
# with or without modifications, as long as this notice is preserved. |
|||
|
|||
# This program is distributed in the hope that it will be useful, |
|||
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without |
|||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A |
|||
# PARTICULAR PURPOSE. |
|||
|
|||
m4_ifndef([AC_AUTOCONF_VERSION], |
|||
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl |
|||
m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],, |
|||
[m4_warning([this file was generated for autoconf 2.69. |
|||
You have another version of autoconf. It may work, but is not guaranteed to. |
|||
If you have problems, you may need to regenerate the build system entirely. |
|||
To do so, use the procedure documented by the package, typically 'autoreconf'.])]) |
|||
|
|||
# Copyright (C) 2002-2012 Free Software Foundation, Inc. |
|||
# |
|||
# This file is free software; the Free Software Foundation |
|||
# gives unlimited permission to copy and/or distribute it, |
|||
# with or without modifications, as long as this notice is preserved. |
|||
|
|||
# AM_AUTOMAKE_VERSION(VERSION) |
|||
# ---------------------------- |
|||
# Automake X.Y traces this macro to ensure aclocal.m4 has been |
|||
# generated from the m4 files accompanying Automake X.Y. |
|||
# (This private macro should not be called outside this file.) |
|||
AC_DEFUN([AM_AUTOMAKE_VERSION], |
|||
[am__api_version='1.12' |
|||
dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to |
|||
dnl require some minimum version. Point them to the right macro. |
|||
m4_if([$1], [1.12.5], [], |
|||
[AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl |
|||
]) |
|||
|
|||
# _AM_AUTOCONF_VERSION(VERSION) |
|||
# ----------------------------- |
|||
# aclocal traces this macro to find the Autoconf version. |
|||
# This is a private macro too. Using m4_define simplifies |
|||
# the logic in aclocal, which can simply ignore this definition. |
|||
m4_define([_AM_AUTOCONF_VERSION], []) |
|||
|
|||
# AM_SET_CURRENT_AUTOMAKE_VERSION |
|||
# ------------------------------- |
|||
# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. |
|||
# This function is AC_REQUIREd by AM_INIT_AUTOMAKE. |
|||
AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], |
|||
[AM_AUTOMAKE_VERSION([1.12.5])dnl |
|||
m4_ifndef([AC_AUTOCONF_VERSION], |
|||
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl |
|||
_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) |
|||
|
|||
# AM_AUX_DIR_EXPAND -*- Autoconf -*- |
|||
|
|||
# Copyright (C) 2001-2012 Free Software Foundation, Inc. |
|||
# |
|||
# This file is free software; the Free Software Foundation |
|||
# gives unlimited permission to copy and/or distribute it, |
|||
# with or without modifications, as long as this notice is preserved. |
|||
|
|||
# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets |
|||
# $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to |
|||
# '$srcdir', '$srcdir/..', or '$srcdir/../..'. |
|||
# |
|||
# Of course, Automake must honor this variable whenever it calls a |
|||
# tool from the auxiliary directory. The problem is that $srcdir (and |
|||
# therefore $ac_aux_dir as well) can be either absolute or relative, |
|||
# depending on how configure is run. This is pretty annoying, since |
|||
# it makes $ac_aux_dir quite unusable in subdirectories: in the top |
|||
# source directory, any form will work fine, but in subdirectories a |
|||
# relative path needs to be adjusted first. |
|||
# |
|||
# $ac_aux_dir/missing |
|||
# fails when called from a subdirectory if $ac_aux_dir is relative |
|||
# $top_srcdir/$ac_aux_dir/missing |
|||
# fails if $ac_aux_dir is absolute, |
|||
# fails when called from a subdirectory in a VPATH build with |
|||
# a relative $ac_aux_dir |
|||
# |
|||
# The reason of the latter failure is that $top_srcdir and $ac_aux_dir |
|||
# are both prefixed by $srcdir. In an in-source build this is usually |
|||
# harmless because $srcdir is '.', but things will broke when you |
|||
# start a VPATH build or use an absolute $srcdir. |
|||
# |
|||
# So we could use something similar to $top_srcdir/$ac_aux_dir/missing, |
|||
# iff we strip the leading $srcdir from $ac_aux_dir. That would be: |
|||
# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` |
|||
# and then we would define $MISSING as |
|||
# MISSING="\${SHELL} $am_aux_dir/missing" |
|||
# This will work as long as MISSING is not called from configure, because |
|||
# unfortunately $(top_srcdir) has no meaning in configure. |
|||
# However there are other variables, like CC, which are often used in |
|||
# configure, and could therefore not use this "fixed" $ac_aux_dir. |
|||
# |
|||
# Another solution, used here, is to always expand $ac_aux_dir to an |
|||
# absolute PATH. The drawback is that using absolute paths prevent a |
|||
# configured tree to be moved without reconfiguration. |
|||
|
|||
AC_DEFUN([AM_AUX_DIR_EXPAND], |
|||
[dnl Rely on autoconf to set up CDPATH properly. |
|||
AC_PREREQ([2.50])dnl |
|||
# expand $ac_aux_dir to an absolute path |
|||
am_aux_dir=`cd $ac_aux_dir && pwd` |
|||
]) |
|||
|
|||
# AM_CONDITIONAL -*- Autoconf -*- |
|||
|
|||
# Copyright (C) 1997-2012 Free Software Foundation, Inc. |
|||
# |
|||
# This file is free software; the Free Software Foundation |
|||
# gives unlimited permission to copy and/or distribute it, |
|||
# with or without modifications, as long as this notice is preserved. |
|||
|
|||
# AM_CONDITIONAL(NAME, SHELL-CONDITION) |
|||
# ------------------------------------- |
|||
# Define a conditional. |
|||
AC_DEFUN([AM_CONDITIONAL], |
|||
[AC_PREREQ([2.52])dnl |
|||
m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], |
|||
[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl |
|||
AC_SUBST([$1_TRUE])dnl |
|||
AC_SUBST([$1_FALSE])dnl |
|||
_AM_SUBST_NOTMAKE([$1_TRUE])dnl |
|||
_AM_SUBST_NOTMAKE([$1_FALSE])dnl |
|||
m4_define([_AM_COND_VALUE_$1], [$2])dnl |
|||
if $2; then |
|||
$1_TRUE= |
|||
$1_FALSE='#' |
|||
else |
|||
$1_TRUE='#' |
|||
$1_FALSE= |
|||
fi |
|||
AC_CONFIG_COMMANDS_PRE( |
|||
[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then |
|||
AC_MSG_ERROR([[conditional "$1" was never defined. |
|||
Usually this means the macro was only invoked conditionally.]]) |
|||
fi])]) |
|||
|
|||
# Copyright (C) 1999-2012 Free Software Foundation, Inc. |
|||
# |
|||
# This file is free software; the Free Software Foundation |
|||
# gives unlimited permission to copy and/or distribute it, |
|||
# with or without modifications, as long as this notice is preserved. |
|||
|
|||
|
|||
# There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be |
|||
# written in clear, in which case automake, when reading aclocal.m4, |
|||
# will think it sees a *use*, and therefore will trigger all it's |
|||
# C support machinery. Also note that it means that autoscan, seeing |
|||
# CC etc. in the Makefile, will ask for an AC_PROG_CC use... |
|||
|
|||
|
|||
# _AM_DEPENDENCIES(NAME) |
|||
# ---------------------- |
|||
# See how the compiler implements dependency checking. |
|||
# NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC". |
|||
# We try a few techniques and use that to set a single cache variable. |
|||
# |
|||
# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was |
|||
# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular |
|||
# dependency, and given that the user is not expected to run this macro, |
|||
# just rely on AC_PROG_CC. |
|||
AC_DEFUN([_AM_DEPENDENCIES], |
|||
[AC_REQUIRE([AM_SET_DEPDIR])dnl |
|||
AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl |
|||
AC_REQUIRE([AM_MAKE_INCLUDE])dnl |
|||
AC_REQUIRE([AM_DEP_TRACK])dnl |
|||
|
|||
m4_if([$1], [CC], [depcc="$CC" am_compiler_list=], |
|||
[$1], [CXX], [depcc="$CXX" am_compiler_list=], |
|||
[$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'], |
|||
[$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'], |
|||
[$1], [UPC], [depcc="$UPC" am_compiler_list=], |
|||
[$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'], |
|||
[depcc="$$1" am_compiler_list=]) |
|||
|
|||
AC_CACHE_CHECK([dependency style of $depcc], |
|||
[am_cv_$1_dependencies_compiler_type], |
|||
[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then |
|||
# We make a subdir and do the tests there. Otherwise we can end up |
|||
# making bogus files that we don't know about and never remove. For |
|||
# instance it was reported that on HP-UX the gcc test will end up |
|||
# making a dummy file named 'D' -- because '-MD' means "put the output |
|||
# in D". |
|||
rm -rf conftest.dir |
|||
mkdir conftest.dir |
|||
# Copy depcomp to subdir because otherwise we won't find it if we're |
|||
# using a relative directory. |
|||
cp "$am_depcomp" conftest.dir |
|||
cd conftest.dir |
|||
# We will build objects and dependencies in a subdirectory because |
|||
# it helps to detect inapplicable dependency modes. For instance |
|||
# both Tru64's cc and ICC support -MD to output dependencies as a |
|||
# side effect of compilation, but ICC will put the dependencies in |
|||
# the current directory while Tru64 will put them in the object |
|||
# directory. |
|||
mkdir sub |
|||
|
|||
am_cv_$1_dependencies_compiler_type=none |
|||
if test "$am_compiler_list" = ""; then |
|||
am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` |
|||
fi |
|||
am__universal=false |
|||
m4_case([$1], [CC], |
|||
[case " $depcc " in #( |
|||
*\ -arch\ *\ -arch\ *) am__universal=true ;; |
|||
esac], |
|||
[CXX], |
|||
[case " $depcc " in #( |
|||
*\ -arch\ *\ -arch\ *) am__universal=true ;; |
|||
esac]) |
|||
|
|||
for depmode in $am_compiler_list; do |
|||
# Setup a source with many dependencies, because some compilers |
|||
# like to wrap large dependency lists on column 80 (with \), and |
|||
# we should not choose a depcomp mode which is confused by this. |
|||
# |
|||
# We need to recreate these files for each test, as the compiler may |
|||
# overwrite some of them when testing with obscure command lines. |
|||
# This happens at least with the AIX C compiler. |
|||
: > sub/conftest.c |
|||
for i in 1 2 3 4 5 6; do |
|||
echo '#include "conftst'$i'.h"' >> sub/conftest.c |
|||
# Using ": > sub/conftst$i.h" creates only sub/conftst1.h with |
|||
# Solaris 10 /bin/sh. |
|||
echo '/* dummy */' > sub/conftst$i.h |
|||
done |
|||
echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf |
|||
|
|||
# We check with '-c' and '-o' for the sake of the "dashmstdout" |
|||
# mode. It turns out that the SunPro C++ compiler does not properly |
|||
# handle '-M -o', and we need to detect this. Also, some Intel |
|||
# versions had trouble with output in subdirs. |
|||
am__obj=sub/conftest.${OBJEXT-o} |
|||
am__minus_obj="-o $am__obj" |
|||
case $depmode in |
|||
gcc) |
|||
# This depmode causes a compiler race in universal mode. |
|||
test "$am__universal" = false || continue |
|||
;; |
|||
nosideeffect) |
|||
# After this tag, mechanisms are not by side-effect, so they'll |
|||
# only be used when explicitly requested. |
|||
if test "x$enable_dependency_tracking" = xyes; then |
|||
continue |
|||
else |
|||
break |
|||
fi |
|||
;; |
|||
msvc7 | msvc7msys | msvisualcpp | msvcmsys) |
|||
# This compiler won't grok '-c -o', but also, the minuso test has |
|||
# not run yet. These depmodes are late enough in the game, and |
|||
# so weak that their functioning should not be impacted. |
|||
am__obj=conftest.${OBJEXT-o} |
|||
am__minus_obj= |
|||
;; |
|||
none) break ;; |
|||
esac |
|||
if depmode=$depmode \ |
|||
source=sub/conftest.c object=$am__obj \ |
|||
depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ |
|||
$SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ |
|||
>/dev/null 2>conftest.err && |
|||
grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && |
|||
grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && |
|||
grep $am__obj sub/conftest.Po > /dev/null 2>&1 && |
|||
${MAKE-make} -s -f confmf > /dev/null 2>&1; then |
|||
# icc doesn't choke on unknown options, it will just issue warnings |
|||
# or remarks (even with -Werror). So we grep stderr for any message |
|||
# that says an option was ignored or not supported. |
|||
# When given -MP, icc 7.0 and 7.1 complain thusly: |
|||
# icc: Command line warning: ignoring option '-M'; no argument required |
|||
# The diagnosis changed in icc 8.0: |
|||
# icc: Command line remark: option '-MP' not supported |
|||
if (grep 'ignoring option' conftest.err || |
|||
grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else |
|||
am_cv_$1_dependencies_compiler_type=$depmode |
|||
break |
|||
fi |
|||
fi |
|||
done |
|||
|
|||
cd .. |
|||
rm -rf conftest.dir |
|||
else |
|||
am_cv_$1_dependencies_compiler_type=none |
|||
fi |
|||
]) |
|||
AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) |
|||
AM_CONDITIONAL([am__fastdep$1], [ |
|||
test "x$enable_dependency_tracking" != xno \ |
|||
&& test "$am_cv_$1_dependencies_compiler_type" = gcc3]) |
|||
]) |
|||
|
|||
|
|||
# AM_SET_DEPDIR |
|||
# ------------- |
|||
# Choose a directory name for dependency files. |
|||
# This macro is AC_REQUIREd in _AM_DEPENDENCIES. |
|||
AC_DEFUN([AM_SET_DEPDIR], |
|||
[AC_REQUIRE([AM_SET_LEADING_DOT])dnl |
|||
AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl |
|||
]) |
|||
|
|||
|
|||
# AM_DEP_TRACK |
|||
# ------------ |
|||
AC_DEFUN([AM_DEP_TRACK], |
|||
[AC_ARG_ENABLE([dependency-tracking], [dnl |
|||
AS_HELP_STRING( |
|||
[--enable-dependency-tracking], |
|||
[do not reject slow dependency extractors]) |
|||
AS_HELP_STRING( |
|||
[--disable-dependency-tracking], |
|||
[speeds up one-time build])]) |
|||
if test "x$enable_dependency_tracking" != xno; then |
|||
am_depcomp="$ac_aux_dir/depcomp" |
|||
AMDEPBACKSLASH='\' |
|||
am__nodep='_no' |
|||
fi |
|||
AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) |
|||
AC_SUBST([AMDEPBACKSLASH])dnl |
|||
_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl |
|||
AC_SUBST([am__nodep])dnl |
|||
_AM_SUBST_NOTMAKE([am__nodep])dnl |
|||
]) |
|||
|
|||
# Generate code to set up dependency tracking. -*- Autoconf -*- |
|||
|
|||
# Copyright (C) 1999-2012 Free Software Foundation, Inc. |
|||
# |
|||
# This file is free software; the Free Software Foundation |
|||
# gives unlimited permission to copy and/or distribute it, |
|||
# with or without modifications, as long as this notice is preserved. |
|||
|
|||
|
|||
# _AM_OUTPUT_DEPENDENCY_COMMANDS |
|||
# ------------------------------ |
|||
AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], |
|||
[{ |
|||
# Autoconf 2.62 quotes --file arguments for eval, but not when files |
|||
# are listed without --file. Let's play safe and only enable the eval |
|||
# if we detect the quoting. |
|||
case $CONFIG_FILES in |
|||
*\'*) eval set x "$CONFIG_FILES" ;; |
|||
*) set x $CONFIG_FILES ;; |
|||
esac |
|||
shift |
|||
for mf |
|||
do |
|||
# Strip MF so we end up with the name of the file. |
|||
mf=`echo "$mf" | sed -e 's/:.*$//'` |
|||
# Check whether this is an Automake generated Makefile or not. |
|||
# We used to match only the files named 'Makefile.in', but |
|||
# some people rename them; so instead we look at the file content. |
|||
# Grep'ing the first line is not enough: some people post-process |
|||
# each Makefile.in and add a new line on top of each file to say so. |
|||
# Grep'ing the whole file is not good either: AIX grep has a line |
|||
# limit of 2048, but all sed's we know have understand at least 4000. |
|||
if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then |
|||
dirpart=`AS_DIRNAME("$mf")` |
|||
else |
|||
continue |
|||
fi |
|||
# Extract the definition of DEPDIR, am__include, and am__quote |
|||
# from the Makefile without running 'make'. |
|||
DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` |
|||
test -z "$DEPDIR" && continue |
|||
am__include=`sed -n 's/^am__include = //p' < "$mf"` |
|||
test -z "am__include" && continue |
|||
am__quote=`sed -n 's/^am__quote = //p' < "$mf"` |
|||
# Find all dependency output files, they are included files with |
|||
# $(DEPDIR) in their names. We invoke sed twice because it is the |
|||
# simplest approach to changing $(DEPDIR) to its actual value in the |
|||
# expansion. |
|||
for file in `sed -n " |
|||
s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ |
|||
sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do |
|||
# Make sure the directory exists. |
|||
test -f "$dirpart/$file" && continue |
|||
fdir=`AS_DIRNAME(["$file"])` |
|||
AS_MKDIR_P([$dirpart/$fdir]) |
|||
# echo "creating $dirpart/$file" |
|||
echo '# dummy' > "$dirpart/$file" |
|||
done |
|||
done |
|||
} |
|||
])# _AM_OUTPUT_DEPENDENCY_COMMANDS |
|||
|
|||
|
|||
# AM_OUTPUT_DEPENDENCY_COMMANDS |
|||
# ----------------------------- |
|||
# This macro should only be invoked once -- use via AC_REQUIRE. |
|||
# |
|||
# This code is only required when automatic dependency tracking |
|||
# is enabled. FIXME. This creates each '.P' file that we will |
|||
# need in order to bootstrap the dependency handling code. |
|||
AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], |
|||
[AC_CONFIG_COMMANDS([depfiles], |
|||
[test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], |
|||
[AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) |
|||
]) |
|||
|
|||
# Do all the work for Automake. -*- Autoconf -*- |
|||
|
|||
# Copyright (C) 1996-2012 Free Software Foundation, Inc. |
|||
# |
|||
# This file is free software; the Free Software Foundation |
|||
# gives unlimited permission to copy and/or distribute it, |
|||
# with or without modifications, as long as this notice is preserved. |
|||
|
|||
# This macro actually does too much. Some checks are only needed if |
|||
# your package does certain things. But this isn't really a big deal. |
|||
|
|||
# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) |
|||
# AM_INIT_AUTOMAKE([OPTIONS]) |
|||
# ----------------------------------------------- |
|||
# The call with PACKAGE and VERSION arguments is the old style |
|||
# call (pre autoconf-2.50), which is being phased out. PACKAGE |
|||
# and VERSION should now be passed to AC_INIT and removed from |
|||
# the call to AM_INIT_AUTOMAKE. |
|||
# We support both call styles for the transition. After |
|||
# the next Automake release, Autoconf can make the AC_INIT |
|||
# arguments mandatory, and then we can depend on a new Autoconf |
|||
# release and drop the old call support. |
|||
AC_DEFUN([AM_INIT_AUTOMAKE], |
|||
[AC_PREREQ([2.62])dnl |
|||
dnl Autoconf wants to disallow AM_ names. We explicitly allow |
|||
dnl the ones we care about. |
|||
m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl |
|||
AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl |
|||
AC_REQUIRE([AC_PROG_INSTALL])dnl |
|||
if test "`cd $srcdir && pwd`" != "`pwd`"; then |
|||
# Use -I$(srcdir) only when $(srcdir) != ., so that make's output |
|||
# is not polluted with repeated "-I." |
|||
AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl |
|||
# test to see if srcdir already configured |
|||
if test -f $srcdir/config.status; then |
|||
AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) |
|||
fi |
|||
fi |
|||
|
|||
# test whether we have cygpath |
|||
if test -z "$CYGPATH_W"; then |
|||
if (cygpath --version) >/dev/null 2>/dev/null; then |
|||
CYGPATH_W='cygpath -w' |
|||
else |
|||
CYGPATH_W=echo |
|||
fi |
|||
fi |
|||
AC_SUBST([CYGPATH_W]) |
|||
|
|||
# Define the identity of the package. |
|||
dnl Distinguish between old-style and new-style calls. |
|||
m4_ifval([$2], |
|||
[AC_DIAGNOSE([obsolete], |
|||
[$0: two- and three-arguments forms are deprecated. For more info, see: |
|||
http://www.gnu.org/software/automake/manual/automake.html#Modernize-AM_INIT_AUTOMAKE-invocation]) |
|||
m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl |
|||
AC_SUBST([PACKAGE], [$1])dnl |
|||
AC_SUBST([VERSION], [$2])], |
|||
[_AM_SET_OPTIONS([$1])dnl |
|||
dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. |
|||
m4_if( |
|||
m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]), |
|||
[ok:ok],, |
|||
[m4_fatal([AC_INIT should be called with package and version arguments])])dnl |
|||
AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl |
|||
AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl |
|||
|
|||
_AM_IF_OPTION([no-define],, |
|||
[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package]) |
|||
AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl |
|||
|
|||
# Some tools Automake needs. |
|||
AC_REQUIRE([AM_SANITY_CHECK])dnl |
|||
AC_REQUIRE([AC_ARG_PROGRAM])dnl |
|||
AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}]) |
|||
AM_MISSING_PROG([AUTOCONF], [autoconf]) |
|||
AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}]) |
|||
AM_MISSING_PROG([AUTOHEADER], [autoheader]) |
|||
AM_MISSING_PROG([MAKEINFO], [makeinfo]) |
|||
AC_REQUIRE([AM_PROG_INSTALL_SH])dnl |
|||
AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl |
|||
AC_REQUIRE([AC_PROG_MKDIR_P])dnl |
|||
# For better backward compatibility. To be removed once Automake 1.9.x |
|||
# dies out for good. For more background, see: |
|||
# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html> |
|||
# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html> |
|||
AC_SUBST([mkdir_p], ['$(MKDIR_P)']) |
|||
# We need awk for the "check" target. The system "awk" is bad on |
|||
# some platforms. |
|||
AC_REQUIRE([AC_PROG_AWK])dnl |
|||
AC_REQUIRE([AC_PROG_MAKE_SET])dnl |
|||
AC_REQUIRE([AM_SET_LEADING_DOT])dnl |
|||
_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], |
|||
[_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], |
|||
[_AM_PROG_TAR([v7])])]) |
|||
_AM_IF_OPTION([no-dependencies],, |
|||
[AC_PROVIDE_IFELSE([AC_PROG_CC], |
|||
[_AM_DEPENDENCIES([CC])], |
|||
[m4_define([AC_PROG_CC], |
|||
m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl |
|||
AC_PROVIDE_IFELSE([AC_PROG_CXX], |
|||
[_AM_DEPENDENCIES([CXX])], |
|||
[m4_define([AC_PROG_CXX], |
|||
m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl |
|||
AC_PROVIDE_IFELSE([AC_PROG_OBJC], |
|||
[_AM_DEPENDENCIES([OBJC])], |
|||
[m4_define([AC_PROG_OBJC], |
|||
m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl |
|||
dnl Support for Objective C++ was only introduced in Autoconf 2.65, |
|||
dnl but we still cater to Autoconf 2.62. |
|||
m4_ifdef([AC_PROG_OBJCXX], |
|||
[AC_PROVIDE_IFELSE([AC_PROG_OBJCXX], |
|||
[_AM_DEPENDENCIES([OBJCXX])], |
|||
[m4_define([AC_PROG_OBJCXX], |
|||
m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])])dnl |
|||
]) |
|||
_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl |
|||
dnl The 'parallel-tests' driver may need to know about EXEEXT, so add the |
|||
dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro |
|||
dnl is hooked onto _AC_COMPILER_EXEEXT early, see below. |
|||
AC_CONFIG_COMMANDS_PRE(dnl |
|||
[m4_provide_if([_AM_COMPILER_EXEEXT], |
|||
[AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl |
|||
]) |
|||
|
|||
dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not |
|||
dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further |
|||
dnl mangled by Autoconf and run in a shell conditional statement. |
|||
m4_define([_AC_COMPILER_EXEEXT], |
|||
m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) |
|||
|
|||
|
|||
# When config.status generates a header, we must update the stamp-h file. |
|||
# This file resides in the same directory as the config header |
|||
# that is generated. The stamp files are numbered to have different names. |
|||
|
|||
# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the |
|||
# loop where config.status creates the headers, so we can generate |
|||
# our stamp files there. |
|||
AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], |
|||
[# Compute $1's index in $config_headers. |
|||
_am_arg=$1 |
|||
_am_stamp_count=1 |
|||
for _am_header in $config_headers :; do |
|||
case $_am_header in |
|||
$_am_arg | $_am_arg:* ) |
|||
break ;; |
|||
* ) |
|||
_am_stamp_count=`expr $_am_stamp_count + 1` ;; |
|||
esac |
|||
done |
|||
echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) |
|||
|
|||
# Copyright (C) 2001-2012 Free Software Foundation, Inc. |
|||
# |
|||
# This file is free software; the Free Software Foundation |
|||
# gives unlimited permission to copy and/or distribute it, |
|||
# with or without modifications, as long as this notice is preserved. |
|||
|
|||
# AM_PROG_INSTALL_SH |
|||
# ------------------ |
|||
# Define $install_sh. |
|||
AC_DEFUN([AM_PROG_INSTALL_SH], |
|||
[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl |
|||
if test x"${install_sh}" != xset; then |
|||
case $am_aux_dir in |
|||
*\ * | *\ *) |
|||
install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; |
|||
*) |
|||
install_sh="\${SHELL} $am_aux_dir/install-sh" |
|||
esac |
|||
fi |
|||
AC_SUBST([install_sh])]) |
|||
|
|||
# Copyright (C) 2003-2012 Free Software Foundation, Inc. |
|||
# |
|||
# This file is free software; the Free Software Foundation |
|||
# gives unlimited permission to copy and/or distribute it, |
|||
# with or without modifications, as long as this notice is preserved. |
|||
|
|||
# Check whether the underlying file-system supports filenames |
|||
# with a leading dot. For instance MS-DOS doesn't. |
|||
AC_DEFUN([AM_SET_LEADING_DOT], |
|||
[rm -rf .tst 2>/dev/null |
|||
mkdir .tst 2>/dev/null |
|||
if test -d .tst; then |
|||
am__leading_dot=. |
|||
else |
|||
am__leading_dot=_ |
|||
fi |
|||
rmdir .tst 2>/dev/null |
|||
AC_SUBST([am__leading_dot])]) |
|||
|
|||
# Check to see how 'make' treats includes. -*- Autoconf -*- |
|||
|
|||
# Copyright (C) 2001-2012 Free Software Foundation, Inc. |
|||
# |
|||
# This file is free software; the Free Software Foundation |
|||
# gives unlimited permission to copy and/or distribute it, |
|||
# with or without modifications, as long as this notice is preserved. |
|||
|
|||
# AM_MAKE_INCLUDE() |
|||
# ----------------- |
|||
# Check to see how make treats includes. |
|||
AC_DEFUN([AM_MAKE_INCLUDE], |
|||
[am_make=${MAKE-make} |
|||
cat > confinc << 'END' |
|||
am__doit: |
|||
@echo this is the am__doit target |
|||
.PHONY: am__doit |
|||
END |
|||
# If we don't find an include directive, just comment out the code. |
|||
AC_MSG_CHECKING([for style of include used by $am_make]) |
|||
am__include="#" |
|||
am__quote= |
|||
_am_result=none |
|||
# First try GNU make style include. |
|||
echo "include confinc" > confmf |
|||
# Ignore all kinds of additional output from 'make'. |
|||
case `$am_make -s -f confmf 2> /dev/null` in #( |
|||
*the\ am__doit\ target*) |
|||
am__include=include |
|||
am__quote= |
|||
_am_result=GNU |
|||
;; |
|||
esac |
|||
# Now try BSD make style include. |
|||
if test "$am__include" = "#"; then |
|||
echo '.include "confinc"' > confmf |
|||
case `$am_make -s -f confmf 2> /dev/null` in #( |
|||
*the\ am__doit\ target*) |
|||
am__include=.include |
|||
am__quote="\"" |
|||
_am_result=BSD |
|||
;; |
|||
esac |
|||
fi |
|||
AC_SUBST([am__include]) |
|||
AC_SUBST([am__quote]) |
|||
AC_MSG_RESULT([$_am_result]) |
|||
rm -f confinc confmf |
|||
]) |
|||
|
|||
# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- |
|||
|
|||
# Copyright (C) 1997-2012 Free Software Foundation, Inc. |
|||
# |
|||
# This file is free software; the Free Software Foundation |
|||
# gives unlimited permission to copy and/or distribute it, |
|||
# with or without modifications, as long as this notice is preserved. |
|||
|
|||
# AM_MISSING_PROG(NAME, PROGRAM) |
|||
# ------------------------------ |
|||
AC_DEFUN([AM_MISSING_PROG], |
|||
[AC_REQUIRE([AM_MISSING_HAS_RUN]) |
|||
$1=${$1-"${am_missing_run}$2"} |
|||
AC_SUBST($1)]) |
|||
|
|||
# AM_MISSING_HAS_RUN |
|||
# ------------------ |
|||
# Define MISSING if not defined so far and test if it supports --run. |
|||
# If it does, set am_missing_run to use it, otherwise, to nothing. |
|||
AC_DEFUN([AM_MISSING_HAS_RUN], |
|||
[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl |
|||
AC_REQUIRE_AUX_FILE([missing])dnl |
|||
if test x"${MISSING+set}" != xset; then |
|||
case $am_aux_dir in |
|||
*\ * | *\ *) |
|||
MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; |
|||
*) |
|||
MISSING="\${SHELL} $am_aux_dir/missing" ;; |
|||
esac |
|||
fi |
|||
# Use eval to expand $SHELL |
|||
if eval "$MISSING --run true"; then |
|||
am_missing_run="$MISSING --run " |
|||
else |
|||
am_missing_run= |
|||
AC_MSG_WARN(['missing' script is too old or missing]) |
|||
fi |
|||
]) |
|||
|
|||
# Helper functions for option handling. -*- Autoconf -*- |
|||
|
|||
# Copyright (C) 2001-2012 Free Software Foundation, Inc. |
|||
# |
|||
# This file is free software; the Free Software Foundation |
|||
# gives unlimited permission to copy and/or distribute it, |
|||
# with or without modifications, as long as this notice is preserved. |
|||
|
|||
# _AM_MANGLE_OPTION(NAME) |
|||
# ----------------------- |
|||
AC_DEFUN([_AM_MANGLE_OPTION], |
|||
[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) |
|||
|
|||
# _AM_SET_OPTION(NAME) |
|||
# -------------------- |
|||
# Set option NAME. Presently that only means defining a flag for this option. |
|||
AC_DEFUN([_AM_SET_OPTION], |
|||
[m4_define(_AM_MANGLE_OPTION([$1]), [1])]) |
|||
|
|||
# _AM_SET_OPTIONS(OPTIONS) |
|||
# ------------------------ |
|||
# OPTIONS is a space-separated list of Automake options. |
|||
AC_DEFUN([_AM_SET_OPTIONS], |
|||
[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) |
|||
|
|||
# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) |
|||
# ------------------------------------------- |
|||
# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. |
|||
AC_DEFUN([_AM_IF_OPTION], |
|||
[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) |
|||
|
|||
# Check to make sure that the build environment is sane. -*- Autoconf -*- |
|||
|
|||
# Copyright (C) 1996-2012 Free Software Foundation, Inc. |
|||
# |
|||
# This file is free software; the Free Software Foundation |
|||
# gives unlimited permission to copy and/or distribute it, |
|||
# with or without modifications, as long as this notice is preserved. |
|||
|
|||
# AM_SANITY_CHECK |
|||
# --------------- |
|||
AC_DEFUN([AM_SANITY_CHECK], |
|||
[AC_MSG_CHECKING([whether build environment is sane]) |
|||
# Reject unsafe characters in $srcdir or the absolute working directory |
|||
# name. Accept space and tab only in the latter. |
|||
am_lf=' |
|||
' |
|||
case `pwd` in |
|||
*[[\\\"\#\$\&\'\`$am_lf]]*) |
|||
AC_MSG_ERROR([unsafe absolute working directory name]);; |
|||
esac |
|||
case $srcdir in |
|||
*[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) |
|||
AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);; |
|||
esac |
|||
|
|||
# Do 'set' in a subshell so we don't clobber the current shell's |
|||
# arguments. Must try -L first in case configure is actually a |
|||
# symlink; some systems play weird games with the mod time of symlinks |
|||
# (eg FreeBSD returns the mod time of the symlink's containing |
|||
# directory). |
|||
if ( |
|||
am_has_slept=no |
|||
for am_try in 1 2; do |
|||
echo "timestamp, slept: $am_has_slept" > conftest.file |
|||
set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` |
|||
if test "$[*]" = "X"; then |
|||
# -L didn't work. |
|||
set X `ls -t "$srcdir/configure" conftest.file` |
|||
fi |
|||
if test "$[*]" != "X $srcdir/configure conftest.file" \ |
|||
&& test "$[*]" != "X conftest.file $srcdir/configure"; then |
|||
|
|||
# If neither matched, then we have a broken ls. This can happen |
|||
# if, for instance, CONFIG_SHELL is bash and it inherits a |
|||
# broken ls alias from the environment. This has actually |
|||
# happened. Such a system could not be considered "sane". |
|||
AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken |
|||
alias in your environment]) |
|||
fi |
|||
if test "$[2]" = conftest.file || test $am_try -eq 2; then |
|||
break |
|||
fi |
|||
# Just in case. |
|||
sleep 1 |
|||
am_has_slept=yes |
|||
done |
|||
test "$[2]" = conftest.file |
|||
) |
|||
then |
|||
# Ok. |
|||
: |
|||
else |
|||
AC_MSG_ERROR([newly created file is older than distributed files! |
|||
Check your system clock]) |
|||
fi |
|||
AC_MSG_RESULT([yes]) |
|||
# If we didn't sleep, we still need to ensure time stamps of config.status and |
|||
# generated files are strictly newer. |
|||
am_sleep_pid= |
|||
if grep 'slept: no' conftest.file >/dev/null 2>&1; then |
|||
( sleep 1 ) & |
|||
am_sleep_pid=$! |
|||
fi |
|||
AC_CONFIG_COMMANDS_PRE( |
|||
[AC_MSG_CHECKING([that generated files are newer than configure]) |
|||
if test -n "$am_sleep_pid"; then |
|||
# Hide warnings about reused PIDs. |
|||
wait $am_sleep_pid 2>/dev/null |
|||
fi |
|||
AC_MSG_RESULT([done])]) |
|||
rm -f conftest.file |
|||
]) |
|||
|
|||
# Copyright (C) 2001-2012 Free Software Foundation, Inc. |
|||
# |
|||
# This file is free software; the Free Software Foundation |
|||
# gives unlimited permission to copy and/or distribute it, |
|||
# with or without modifications, as long as this notice is preserved. |
|||
|
|||
# AM_PROG_INSTALL_STRIP |
|||
# --------------------- |
|||
# One issue with vendor 'install' (even GNU) is that you can't |
|||
# specify the program used to strip binaries. This is especially |
|||
# annoying in cross-compiling environments, where the build's strip |
|||
# is unlikely to handle the host's binaries. |
|||
# Fortunately install-sh will honor a STRIPPROG variable, so we |
|||
# always use install-sh in "make install-strip", and initialize |
|||
# STRIPPROG with the value of the STRIP variable (set by the user). |
|||
AC_DEFUN([AM_PROG_INSTALL_STRIP], |
|||
[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl |
|||
# Installed binaries are usually stripped using 'strip' when the user |
|||
# run "make install-strip". However 'strip' might not be the right |
|||
# tool to use in cross-compilation environments, therefore Automake |
|||
# will honor the 'STRIP' environment variable to overrule this program. |
|||
dnl Don't test for $cross_compiling = yes, because it might be 'maybe'. |
|||
if test "$cross_compiling" != no; then |
|||
AC_CHECK_TOOL([STRIP], [strip], :) |
|||
fi |
|||
INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" |
|||
AC_SUBST([INSTALL_STRIP_PROGRAM])]) |
|||
|
|||
# Copyright (C) 2006-2012 Free Software Foundation, Inc. |
|||
# |
|||
# This file is free software; the Free Software Foundation |
|||
# gives unlimited permission to copy and/or distribute it, |
|||
# with or without modifications, as long as this notice is preserved. |
|||
|
|||
# _AM_SUBST_NOTMAKE(VARIABLE) |
|||
# --------------------------- |
|||
# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. |
|||
# This macro is traced by Automake. |
|||
AC_DEFUN([_AM_SUBST_NOTMAKE]) |
|||
|
|||
# AM_SUBST_NOTMAKE(VARIABLE) |
|||
# -------------------------- |
|||
# Public sister of _AM_SUBST_NOTMAKE. |
|||
AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) |
|||
|
|||
# Check how to create a tarball. -*- Autoconf -*- |
|||
|
|||
# Copyright (C) 2004-2012 Free Software Foundation, Inc. |
|||
# |
|||
# This file is free software; the Free Software Foundation |
|||
# gives unlimited permission to copy and/or distribute it, |
|||
# with or without modifications, as long as this notice is preserved. |
|||
|
|||
# _AM_PROG_TAR(FORMAT) |
|||
# -------------------- |
|||
# Check how to create a tarball in format FORMAT. |
|||
# FORMAT should be one of 'v7', 'ustar', or 'pax'. |
|||
# |
|||
# Substitute a variable $(am__tar) that is a command |
|||
# writing to stdout a FORMAT-tarball containing the directory |
|||
# $tardir. |
|||
# tardir=directory && $(am__tar) > result.tar |
|||
# |
|||
# Substitute a variable $(am__untar) that extract such |
|||
# a tarball read from stdin. |
|||
# $(am__untar) < result.tar |
|||
AC_DEFUN([_AM_PROG_TAR], |
|||
[# Always define AMTAR for backward compatibility. Yes, it's still used |
|||
# in the wild :-( We should find a proper way to deprecate it ... |
|||
AC_SUBST([AMTAR], ['$${TAR-tar}']) |
|||
m4_if([$1], [v7], |
|||
[am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], |
|||
[m4_case([$1], [ustar],, [pax],, |
|||
[m4_fatal([Unknown tar format])]) |
|||
AC_MSG_CHECKING([how to create a $1 tar archive]) |
|||
# Loop over all known methods to create a tar archive until one works. |
|||
_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' |
|||
_am_tools=${am_cv_prog_tar_$1-$_am_tools} |
|||
# Do not fold the above two line into one, because Tru64 sh and |
|||
# Solaris sh will not grok spaces in the rhs of '-'. |
|||
for _am_tool in $_am_tools |
|||
do |
|||
case $_am_tool in |
|||
gnutar) |
|||
for _am_tar in tar gnutar gtar; |
|||
do |
|||
AM_RUN_LOG([$_am_tar --version]) && break |
|||
done |
|||
am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' |
|||
am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' |
|||
am__untar="$_am_tar -xf -" |
|||
;; |
|||
plaintar) |
|||
# Must skip GNU tar: if it does not support --format= it doesn't create |
|||
# ustar tarball either. |
|||
(tar --version) >/dev/null 2>&1 && continue |
|||
am__tar='tar chf - "$$tardir"' |
|||
am__tar_='tar chf - "$tardir"' |
|||
am__untar='tar xf -' |
|||
;; |
|||
pax) |
|||
am__tar='pax -L -x $1 -w "$$tardir"' |
|||
am__tar_='pax -L -x $1 -w "$tardir"' |
|||
am__untar='pax -r' |
|||
;; |
|||
cpio) |
|||
am__tar='find "$$tardir" -print | cpio -o -H $1 -L' |
|||
am__tar_='find "$tardir" -print | cpio -o -H $1 -L' |
|||
am__untar='cpio -i -H $1 -d' |
|||
;; |
|||
none) |
|||
am__tar=false |
|||
am__tar_=false |
|||
am__untar=false |
|||
;; |
|||
esac |
|||
|
|||
# If the value was cached, stop now. We just wanted to have am__tar |
|||
# and am__untar set. |
|||
test -n "${am_cv_prog_tar_$1}" && break |
|||
|
|||
# tar/untar a dummy directory, and stop if the command works |
|||
rm -rf conftest.dir |
|||
mkdir conftest.dir |
|||
echo GrepMe > conftest.dir/file |
|||
AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) |
|||
rm -rf conftest.dir |
|||
if test -s conftest.tar; then |
|||
AM_RUN_LOG([$am__untar <conftest.tar]) |
|||
grep GrepMe conftest.dir/file >/dev/null 2>&1 && break |
|||
fi |
|||
done |
|||
rm -rf conftest.dir |
|||
|
|||
AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) |
|||
AC_MSG_RESULT([$am_cv_prog_tar_$1])]) |
|||
AC_SUBST([am__tar]) |
|||
AC_SUBST([am__untar]) |
|||
]) # _AM_PROG_TAR |
|||
|
|||
m4_include([m4/libtool.m4]) |
|||
m4_include([m4/ltoptions.m4]) |
|||
m4_include([m4/ltsugar.m4]) |
|||
m4_include([m4/ltversion.m4]) |
|||
m4_include([m4/lt~obsolete.m4]) |
1537
resources/3rdparty/glpk-4.57/config.guess
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
@ -0,0 +1,27 @@ |
|||
/* config.h.in (GLPK configuration template file) */ |
|||
|
|||
#undef HAVE_SYS_TIME_H |
|||
/* defined if the <sys/time.h> header can be used */ |
|||
|
|||
#undef HAVE_GETTIMEOFDAY |
|||
/* defined if the gettimeofday function can be used */ |
|||
|
|||
#undef HAVE_GMP |
|||
/* defined if the GNU MP bignum library is available */ |
|||
/* requires <gmp.h> and -lgmp */ |
|||
|
|||
#undef HAVE_LTDL |
|||
/* defined if the GNU Libtool shared library support is enabled */ |
|||
/* requires <ltdl.h> and -lltdl */ |
|||
|
|||
#undef HAVE_DLFCN |
|||
/* defined if the POSIX shared library support is enabled */ |
|||
/* requires <dlfcn.h> */ |
|||
|
|||
#undef ODBC_DLNAME |
|||
/* ODBC shared library name if this feature is enabled */ |
|||
|
|||
#undef MYSQL_DLNAME |
|||
/* MySQL shared library name if this feature is enabled */ |
|||
|
|||
/* eof */ |
1789
resources/3rdparty/glpk-4.57/config.sub
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
13840
resources/3rdparty/glpk-4.57/configure
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
@ -0,0 +1,148 @@ |
|||
dnl Process this file with autoconf to produce a configure script |
|||
|
|||
AC_INIT([GLPK], [4.57], [bug-glpk@gnu.org]) |
|||
|
|||
AC_CONFIG_SRCDIR([src/glpk.h]) |
|||
|
|||
AC_CONFIG_MACRO_DIR([m4]) |
|||
|
|||
AM_INIT_AUTOMAKE |
|||
|
|||
AC_CONFIG_HEADERS([config.h]) |
|||
|
|||
AC_ARG_WITH(gmp, |
|||
AC_HELP_STRING([--with-gmp], |
|||
[use GNU MP bignum library [[default=no]]]), |
|||
[case $withval in |
|||
yes | no) ;; |
|||
*) AC_MSG_ERROR([invalid value `$withval' for --with-gmp]);; |
|||
esac], |
|||
[with_gmp=no]) |
|||
|
|||
AC_ARG_ENABLE(dl, |
|||
AC_HELP_STRING([--enable-dl], |
|||
[enable shared library support [[default=no]]]), |
|||
[case $enableval in |
|||
yes | ltdl | dlfcn | no) ;; |
|||
*) AC_MSG_ERROR([invalid value `$enableval' for --enable-dl]);; |
|||
esac], |
|||
[enable_dl=no]) |
|||
|
|||
AC_ARG_ENABLE(odbc, |
|||
AC_HELP_STRING([--enable-odbc], |
|||
[enable MathProg ODBC support [[default=no]]]), |
|||
[case $enableval in |
|||
yes | unix | no) ;; |
|||
*) AC_MSG_ERROR([invalid value `$enableval' for --enable-odbc]);; |
|||
esac], |
|||
[enable_odbc=no]) |
|||
|
|||
AC_ARG_ENABLE(mysql, |
|||
AC_HELP_STRING([--enable-mysql], |
|||
[enable MathProg MySQL support [[default=no]]]), |
|||
[case $enableval in |
|||
yes | no) ;; |
|||
*) AC_MSG_ERROR([invalid value `$enableval' for --enable-mysql]);; |
|||
esac], |
|||
[enable_mysql=no]) |
|||
|
|||
dnl Disable unnecessary libtool tests |
|||
define([AC_LIBTOOL_LANG_CXX_CONFIG], [:]) |
|||
define([AC_LIBTOOL_LANG_F77_CONFIG], [:]) |
|||
define([AC_LIBTOOL_LANG_GCJ_CONFIG], [:]) |
|||
|
|||
dnl Check for programs |
|||
AC_PROG_CC |
|||
AC_PROG_INSTALL |
|||
AC_PROG_LIBTOOL |
|||
|
|||
dnl Check for math library |
|||
AC_CHECK_LIB([m], [exp]) |
|||
|
|||
dnl Check for <sys/time.h> header |
|||
AC_CHECK_HEADER([sys/time.h], |
|||
AC_DEFINE([HAVE_SYS_TIME_H], [1], [N/A])) |
|||
|
|||
dnl Check for gettimeofday function |
|||
AC_CHECK_FUNC([gettimeofday], |
|||
AC_DEFINE([HAVE_GETTIMEOFDAY], [1], [N/A])) |
|||
|
|||
dnl Check for <gmp.h> header |
|||
if test "$with_gmp" = "yes"; then |
|||
AC_CHECK_HEADER([gmp.h], [], |
|||
[AC_MSG_ERROR([gmp.h header not found])]) |
|||
fi |
|||
|
|||
AC_MSG_CHECKING([whether to use GNU MP bignum library]) |
|||
if test "$with_gmp" = "yes"; then |
|||
AC_MSG_RESULT([yes]) |
|||
AC_DEFINE([HAVE_GMP], [1], [N/A]) |
|||
LIBS="-lgmp $LIBS" |
|||
else |
|||
AC_MSG_RESULT([no]) |
|||
fi |
|||
|
|||
AC_MSG_CHECKING([whether to enable shared library support]) |
|||
if test "$enable_dl" = "yes"; then |
|||
AC_MSG_RESULT([ltdl]) |
|||
AC_DEFINE([HAVE_LTDL], [1], [N/A]) |
|||
LIBS="-lltdl $LIBS" |
|||
elif test "$enable_dl" = "ltdl"; then |
|||
AC_MSG_RESULT([ltdl]) |
|||
AC_DEFINE([HAVE_LTDL], [1], [N/A]) |
|||
LIBS="-lltdl $LIBS" |
|||
elif test "$enable_dl" = "dlfcn"; then |
|||
AC_MSG_RESULT([dlfcn]) |
|||
AC_DEFINE([HAVE_DLFCN], [1], [N/A]) |
|||
else |
|||
AC_MSG_RESULT([no]) |
|||
fi |
|||
|
|||
case $host_os in |
|||
darwin* | macosx*) |
|||
LIBIODBC="libiodbc.dylib" |
|||
LIBODBC="libodbc.dylib" |
|||
LIBMYSQL="libmysqlclient.dylib" |
|||
;; |
|||
*) |
|||
LIBIODBC="libiodbc.so" |
|||
LIBODBC="libodbc.so" |
|||
LIBMYSQL="libmysqlclient.so" |
|||
;; |
|||
esac |
|||
|
|||
AC_MSG_CHECKING([whether to enable MathProg ODBC support]) |
|||
if test "$enable_odbc" = "yes"; then |
|||
if test "$enable_dl" = "no"; then |
|||
AC_MSG_ERROR([--enable-odbc requires --enable-dl]) |
|||
fi |
|||
AC_MSG_RESULT([yes]) |
|||
CFLAGS="$(iodbc-config --cflags) $CFLAGS" |
|||
AC_DEFINE_UNQUOTED([ODBC_DLNAME], ["$LIBIODBC"], [N/A]) |
|||
elif test "$enable_odbc" = "unix"; then |
|||
if test "$enable_dl" = "no"; then |
|||
AC_MSG_ERROR([--enable-odbc requires --enable-dl]) |
|||
fi |
|||
AC_MSG_RESULT([unix]) |
|||
AC_DEFINE_UNQUOTED([ODBC_DLNAME], ["$LIBODBC"], [N/A]) |
|||
else |
|||
AC_MSG_RESULT([no]) |
|||
fi |
|||
|
|||
AC_MSG_CHECKING([whether to enable MathProg MySQL support]) |
|||
if test "$enable_mysql" = "yes"; then |
|||
if test "$enable_dl" = "no"; then |
|||
AC_MSG_ERROR([--enable-mysql requires --enable-dl]) |
|||
fi |
|||
AC_MSG_RESULT([yes]) |
|||
CPPFLAGS="-I/usr/include/mysql $CPPFLAGS" |
|||
AC_DEFINE_UNQUOTED([MYSQL_DLNAME], ["$LIBMYSQL"], [N/A]) |
|||
else |
|||
AC_MSG_RESULT([no]) |
|||
fi |
|||
|
|||
AC_CONFIG_FILES( |
|||
[src/Makefile examples/Makefile Makefile]) |
|||
AC_OUTPUT |
|||
|
|||
dnl eof |
@ -0,0 +1,787 @@ |
|||
#! /bin/sh |
|||
# depcomp - compile a program generating dependencies as side-effects |
|||
|
|||
scriptversion=2012-07-12.20; # UTC |
|||
|
|||
# Copyright (C) 1999-2012 Free Software Foundation, Inc. |
|||
|
|||
# This program is free software; you can redistribute it and/or modify |
|||
# it under the terms of the GNU General Public License as published by |
|||
# the Free Software Foundation; either version 2, or (at your option) |
|||
# any later version. |
|||
|
|||
# This program is distributed in the hope that it will be useful, |
|||
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
# GNU General Public License for more details. |
|||
|
|||
# You should have received a copy of the GNU General Public License |
|||
# along with this program. If not, see <http://www.gnu.org/licenses/>. |
|||
|
|||
# As a special exception to the GNU General Public License, if you |
|||
# distribute this file as part of a program that contains a |
|||
# configuration script generated by Autoconf, you may include it under |
|||
# the same distribution terms that you use for the rest of that program. |
|||
|
|||
# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>. |
|||
|
|||
case $1 in |
|||
'') |
|||
echo "$0: No command. Try '$0 --help' for more information." 1>&2 |
|||
exit 1; |
|||
;; |
|||
-h | --h*) |
|||
cat <<\EOF |
|||
Usage: depcomp [--help] [--version] PROGRAM [ARGS] |
|||
|
|||
Run PROGRAMS ARGS to compile a file, generating dependencies |
|||
as side-effects. |
|||
|
|||
Environment variables: |
|||
depmode Dependency tracking mode. |
|||
source Source file read by 'PROGRAMS ARGS'. |
|||
object Object file output by 'PROGRAMS ARGS'. |
|||
DEPDIR directory where to store dependencies. |
|||
depfile Dependency file to output. |
|||
tmpdepfile Temporary file to use when outputting dependencies. |
|||
libtool Whether libtool is used (yes/no). |
|||
|
|||
Report bugs to <bug-automake@gnu.org>. |
|||
EOF |
|||
exit $? |
|||
;; |
|||
-v | --v*) |
|||
echo "depcomp $scriptversion" |
|||
exit $? |
|||
;; |
|||
esac |
|||
|
|||
# A tabulation character. |
|||
tab=' ' |
|||
# A newline character. |
|||
nl=' |
|||
' |
|||
|
|||
if test -z "$depmode" || test -z "$source" || test -z "$object"; then |
|||
echo "depcomp: Variables source, object and depmode must be set" 1>&2 |
|||
exit 1 |
|||
fi |
|||
|
|||
# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. |
|||
depfile=${depfile-`echo "$object" | |
|||
sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} |
|||
tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} |
|||
|
|||
rm -f "$tmpdepfile" |
|||
|
|||
# Avoid interferences from the environment. |
|||
gccflag= dashmflag= |
|||
|
|||
# Some modes work just like other modes, but use different flags. We |
|||
# parameterize here, but still list the modes in the big case below, |
|||
# to make depend.m4 easier to write. Note that we *cannot* use a case |
|||
# here, because this file can only contain one case statement. |
|||
if test "$depmode" = hp; then |
|||
# HP compiler uses -M and no extra arg. |
|||
gccflag=-M |
|||
depmode=gcc |
|||
fi |
|||
|
|||
if test "$depmode" = dashXmstdout; then |
|||
# This is just like dashmstdout with a different argument. |
|||
dashmflag=-xM |
|||
depmode=dashmstdout |
|||
fi |
|||
|
|||
cygpath_u="cygpath -u -f -" |
|||
if test "$depmode" = msvcmsys; then |
|||
# This is just like msvisualcpp but w/o cygpath translation. |
|||
# Just convert the backslash-escaped backslashes to single forward |
|||
# slashes to satisfy depend.m4 |
|||
cygpath_u='sed s,\\\\,/,g' |
|||
depmode=msvisualcpp |
|||
fi |
|||
|
|||
if test "$depmode" = msvc7msys; then |
|||
# This is just like msvc7 but w/o cygpath translation. |
|||
# Just convert the backslash-escaped backslashes to single forward |
|||
# slashes to satisfy depend.m4 |
|||
cygpath_u='sed s,\\\\,/,g' |
|||
depmode=msvc7 |
|||
fi |
|||
|
|||
if test "$depmode" = xlc; then |
|||
# IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information. |
|||
gccflag=-qmakedep=gcc,-MF |
|||
depmode=gcc |
|||
fi |
|||
|
|||
case "$depmode" in |
|||
gcc3) |
|||
## gcc 3 implements dependency tracking that does exactly what |
|||
## we want. Yay! Note: for some reason libtool 1.4 doesn't like |
|||
## it if -MD -MP comes after the -MF stuff. Hmm. |
|||
## Unfortunately, FreeBSD c89 acceptance of flags depends upon |
|||
## the command line argument order; so add the flags where they |
|||
## appear in depend2.am. Note that the slowdown incurred here |
|||
## affects only configure: in makefiles, %FASTDEP% shortcuts this. |
|||
for arg |
|||
do |
|||
case $arg in |
|||
-c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; |
|||
*) set fnord "$@" "$arg" ;; |
|||
esac |
|||
shift # fnord |
|||
shift # $arg |
|||
done |
|||
"$@" |
|||
stat=$? |
|||
if test $stat -eq 0; then : |
|||
else |
|||
rm -f "$tmpdepfile" |
|||
exit $stat |
|||
fi |
|||
mv "$tmpdepfile" "$depfile" |
|||
;; |
|||
|
|||
gcc) |
|||
## Note that this doesn't just cater to obsosete pre-3.x GCC compilers. |
|||
## but also to in-use compilers like IMB xlc/xlC and the HP C compiler. |
|||
## (see the conditional assignment to $gccflag above). |
|||
## There are various ways to get dependency output from gcc. Here's |
|||
## why we pick this rather obscure method: |
|||
## - Don't want to use -MD because we'd like the dependencies to end |
|||
## up in a subdir. Having to rename by hand is ugly. |
|||
## (We might end up doing this anyway to support other compilers.) |
|||
## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like |
|||
## -MM, not -M (despite what the docs say). Also, it might not be |
|||
## supported by the other compilers which use the 'gcc' depmode. |
|||
## - Using -M directly means running the compiler twice (even worse |
|||
## than renaming). |
|||
if test -z "$gccflag"; then |
|||
gccflag=-MD, |
|||
fi |
|||
"$@" -Wp,"$gccflag$tmpdepfile" |
|||
stat=$? |
|||
if test $stat -eq 0; then : |
|||
else |
|||
rm -f "$tmpdepfile" |
|||
exit $stat |
|||
fi |
|||
rm -f "$depfile" |
|||
echo "$object : \\" > "$depfile" |
|||
alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz |
|||
## The second -e expression handles DOS-style file names with drive letters. |
|||
sed -e 's/^[^:]*: / /' \ |
|||
-e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" |
|||
## This next piece of magic avoids the "deleted header file" problem. |
|||
## The problem is that when a header file which appears in a .P file |
|||
## is deleted, the dependency causes make to die (because there is |
|||
## typically no way to rebuild the header). We avoid this by adding |
|||
## dummy dependencies for each header file. Too bad gcc doesn't do |
|||
## this for us directly. |
|||
tr ' ' "$nl" < "$tmpdepfile" | |
|||
## Some versions of gcc put a space before the ':'. On the theory |
|||
## that the space means something, we add a space to the output as |
|||
## well. hp depmode also adds that space, but also prefixes the VPATH |
|||
## to the object. Take care to not repeat it in the output. |
|||
## Some versions of the HPUX 10.20 sed can't process this invocation |
|||
## correctly. Breaking it into two sed invocations is a workaround. |
|||
sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \ |
|||
| sed -e 's/$/ :/' >> "$depfile" |
|||
rm -f "$tmpdepfile" |
|||
;; |
|||
|
|||
hp) |
|||
# This case exists only to let depend.m4 do its work. It works by |
|||
# looking at the text of this script. This case will never be run, |
|||
# since it is checked for above. |
|||
exit 1 |
|||
;; |
|||
|
|||
sgi) |
|||
if test "$libtool" = yes; then |
|||
"$@" "-Wp,-MDupdate,$tmpdepfile" |
|||
else |
|||
"$@" -MDupdate "$tmpdepfile" |
|||
fi |
|||
stat=$? |
|||
if test $stat -eq 0; then : |
|||
else |
|||
rm -f "$tmpdepfile" |
|||
exit $stat |
|||
fi |
|||
rm -f "$depfile" |
|||
|
|||
if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files |
|||
echo "$object : \\" > "$depfile" |
|||
|
|||
# Clip off the initial element (the dependent). Don't try to be |
|||
# clever and replace this with sed code, as IRIX sed won't handle |
|||
# lines with more than a fixed number of characters (4096 in |
|||
# IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; |
|||
# the IRIX cc adds comments like '#:fec' to the end of the |
|||
# dependency line. |
|||
tr ' ' "$nl" < "$tmpdepfile" \ |
|||
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ |
|||
tr "$nl" ' ' >> "$depfile" |
|||
echo >> "$depfile" |
|||
|
|||
# The second pass generates a dummy entry for each header file. |
|||
tr ' ' "$nl" < "$tmpdepfile" \ |
|||
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ |
|||
>> "$depfile" |
|||
else |
|||
# The sourcefile does not contain any dependencies, so just |
|||
# store a dummy comment line, to avoid errors with the Makefile |
|||
# "include basename.Plo" scheme. |
|||
echo "#dummy" > "$depfile" |
|||
fi |
|||
rm -f "$tmpdepfile" |
|||
;; |
|||
|
|||
xlc) |
|||
# This case exists only to let depend.m4 do its work. It works by |
|||
# looking at the text of this script. This case will never be run, |
|||
# since it is checked for above. |
|||
exit 1 |
|||
;; |
|||
|
|||
aix) |
|||
# The C for AIX Compiler uses -M and outputs the dependencies |
|||
# in a .u file. In older versions, this file always lives in the |
|||
# current directory. Also, the AIX compiler puts '$object:' at the |
|||
# start of each line; $object doesn't have directory information. |
|||
# Version 6 uses the directory in both cases. |
|||
dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` |
|||
test "x$dir" = "x$object" && dir= |
|||
base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` |
|||
if test "$libtool" = yes; then |
|||
tmpdepfile1=$dir$base.u |
|||
tmpdepfile2=$base.u |
|||
tmpdepfile3=$dir.libs/$base.u |
|||
"$@" -Wc,-M |
|||
else |
|||
tmpdepfile1=$dir$base.u |
|||
tmpdepfile2=$dir$base.u |
|||
tmpdepfile3=$dir$base.u |
|||
"$@" -M |
|||
fi |
|||
stat=$? |
|||
|
|||
if test $stat -eq 0; then : |
|||
else |
|||
rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" |
|||
exit $stat |
|||
fi |
|||
|
|||
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" |
|||
do |
|||
test -f "$tmpdepfile" && break |
|||
done |
|||
if test -f "$tmpdepfile"; then |
|||
# Each line is of the form 'foo.o: dependent.h'. |
|||
# Do two passes, one to just change these to |
|||
# '$object: dependent.h' and one to simply 'dependent.h:'. |
|||
sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" |
|||
sed -e 's,^.*\.[a-z]*:['"$tab"' ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" |
|||
else |
|||
# The sourcefile does not contain any dependencies, so just |
|||
# store a dummy comment line, to avoid errors with the Makefile |
|||
# "include basename.Plo" scheme. |
|||
echo "#dummy" > "$depfile" |
|||
fi |
|||
rm -f "$tmpdepfile" |
|||
;; |
|||
|
|||
icc) |
|||
# Intel's C compiler anf tcc (Tiny C Compiler) understand '-MD -MF file'. |
|||
# However on |
|||
# $CC -MD -MF foo.d -c -o sub/foo.o sub/foo.c |
|||
# ICC 7.0 will fill foo.d with something like |
|||
# foo.o: sub/foo.c |
|||
# foo.o: sub/foo.h |
|||
# which is wrong. We want |
|||
# sub/foo.o: sub/foo.c |
|||
# sub/foo.o: sub/foo.h |
|||
# sub/foo.c: |
|||
# sub/foo.h: |
|||
# ICC 7.1 will output |
|||
# foo.o: sub/foo.c sub/foo.h |
|||
# and will wrap long lines using '\': |
|||
# foo.o: sub/foo.c ... \ |
|||
# sub/foo.h ... \ |
|||
# ... |
|||
# tcc 0.9.26 (FIXME still under development at the moment of writing) |
|||
# will emit a similar output, but also prepend the continuation lines |
|||
# with horizontal tabulation characters. |
|||
"$@" -MD -MF "$tmpdepfile" |
|||
stat=$? |
|||
if test $stat -eq 0; then : |
|||
else |
|||
rm -f "$tmpdepfile" |
|||
exit $stat |
|||
fi |
|||
rm -f "$depfile" |
|||
# Each line is of the form 'foo.o: dependent.h', |
|||
# or 'foo.o: dep1.h dep2.h \', or ' dep3.h dep4.h \'. |
|||
# Do two passes, one to just change these to |
|||
# '$object: dependent.h' and one to simply 'dependent.h:'. |
|||
sed -e "s/^[ $tab][ $tab]*/ /" -e "s,^[^:]*:,$object :," \ |
|||
< "$tmpdepfile" > "$depfile" |
|||
sed ' |
|||
s/[ '"$tab"'][ '"$tab"']*/ /g |
|||
s/^ *// |
|||
s/ *\\*$// |
|||
s/^[^:]*: *// |
|||
/^$/d |
|||
/:$/d |
|||
s/$/ :/ |
|||
' < "$tmpdepfile" >> "$depfile" |
|||
rm -f "$tmpdepfile" |
|||
;; |
|||
|
|||
## The order of this option in the case statement is important, since the |
|||
## shell code in configure will try each of these formats in the order |
|||
## listed in this file. A plain '-MD' option would be understood by many |
|||
## compilers, so we must ensure this comes after the gcc and icc options. |
|||
pgcc) |
|||
# Portland's C compiler understands '-MD'. |
|||
# Will always output deps to 'file.d' where file is the root name of the |
|||
# source file under compilation, even if file resides in a subdirectory. |
|||
# The object file name does not affect the name of the '.d' file. |
|||
# pgcc 10.2 will output |
|||
# foo.o: sub/foo.c sub/foo.h |
|||
# and will wrap long lines using '\' : |
|||
# foo.o: sub/foo.c ... \ |
|||
# sub/foo.h ... \ |
|||
# ... |
|||
dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` |
|||
test "x$dir" = "x$object" && dir= |
|||
# Use the source, not the object, to determine the base name, since |
|||
# that's sadly what pgcc will do too. |
|||
base=`echo "$source" | sed -e 's|^.*/||' -e 's/\.[-_a-zA-Z0-9]*$//'` |
|||
tmpdepfile="$base.d" |
|||
|
|||
# For projects that build the same source file twice into different object |
|||
# files, the pgcc approach of using the *source* file root name can cause |
|||
# problems in parallel builds. Use a locking strategy to avoid stomping on |
|||
# the same $tmpdepfile. |
|||
lockdir="$base.d-lock" |
|||
trap "echo '$0: caught signal, cleaning up...' >&2; rm -rf $lockdir" 1 2 13 15 |
|||
numtries=100 |
|||
i=$numtries |
|||
while test $i -gt 0 ; do |
|||
# mkdir is a portable test-and-set. |
|||
if mkdir $lockdir 2>/dev/null; then |
|||
# This process acquired the lock. |
|||
"$@" -MD |
|||
stat=$? |
|||
# Release the lock. |
|||
rm -rf $lockdir |
|||
break |
|||
else |
|||
## the lock is being held by a different process, |
|||
## wait until the winning process is done or we timeout |
|||
while test -d $lockdir && test $i -gt 0; do |
|||
sleep 1 |
|||
i=`expr $i - 1` |
|||
done |
|||
fi |
|||
i=`expr $i - 1` |
|||
done |
|||
trap - 1 2 13 15 |
|||
if test $i -le 0; then |
|||
echo "$0: failed to acquire lock after $numtries attempts" >&2 |
|||
echo "$0: check lockdir '$lockdir'" >&2 |
|||
exit 1 |
|||
fi |
|||
|
|||
if test $stat -ne 0; then |
|||
rm -f "$tmpdepfile" |
|||
exit $stat |
|||
fi |
|||
rm -f "$depfile" |
|||
# Each line is of the form `foo.o: dependent.h', |
|||
# or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. |
|||
# Do two passes, one to just change these to |
|||
# `$object: dependent.h' and one to simply `dependent.h:'. |
|||
sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" |
|||
# Some versions of the HPUX 10.20 sed can't process this invocation |
|||
# correctly. Breaking it into two sed invocations is a workaround. |
|||
sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" | |
|||
sed -e 's/$/ :/' >> "$depfile" |
|||
rm -f "$tmpdepfile" |
|||
;; |
|||
|
|||
hp2) |
|||
# The "hp" stanza above does not work with aCC (C++) and HP's ia64 |
|||
# compilers, which have integrated preprocessors. The correct option |
|||
# to use with these is +Maked; it writes dependencies to a file named |
|||
# 'foo.d', which lands next to the object file, wherever that |
|||
# happens to be. |
|||
# Much of this is similar to the tru64 case; see comments there. |
|||
dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` |
|||
test "x$dir" = "x$object" && dir= |
|||
base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` |
|||
if test "$libtool" = yes; then |
|||
tmpdepfile1=$dir$base.d |
|||
tmpdepfile2=$dir.libs/$base.d |
|||
"$@" -Wc,+Maked |
|||
else |
|||
tmpdepfile1=$dir$base.d |
|||
tmpdepfile2=$dir$base.d |
|||
"$@" +Maked |
|||
fi |
|||
stat=$? |
|||
if test $stat -eq 0; then : |
|||
else |
|||
rm -f "$tmpdepfile1" "$tmpdepfile2" |
|||
exit $stat |
|||
fi |
|||
|
|||
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" |
|||
do |
|||
test -f "$tmpdepfile" && break |
|||
done |
|||
if test -f "$tmpdepfile"; then |
|||
sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile" |
|||
# Add 'dependent.h:' lines. |
|||
sed -ne '2,${ |
|||
s/^ *// |
|||
s/ \\*$// |
|||
s/$/:/ |
|||
p |
|||
}' "$tmpdepfile" >> "$depfile" |
|||
else |
|||
echo "#dummy" > "$depfile" |
|||
fi |
|||
rm -f "$tmpdepfile" "$tmpdepfile2" |
|||
;; |
|||
|
|||
tru64) |
|||
# The Tru64 compiler uses -MD to generate dependencies as a side |
|||
# effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'. |
|||
# At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put |
|||
# dependencies in 'foo.d' instead, so we check for that too. |
|||
# Subdirectories are respected. |
|||
dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` |
|||
test "x$dir" = "x$object" && dir= |
|||
base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` |
|||
|
|||
if test "$libtool" = yes; then |
|||
# With Tru64 cc, shared objects can also be used to make a |
|||
# static library. This mechanism is used in libtool 1.4 series to |
|||
# handle both shared and static libraries in a single compilation. |
|||
# With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d. |
|||
# |
|||
# With libtool 1.5 this exception was removed, and libtool now |
|||
# generates 2 separate objects for the 2 libraries. These two |
|||
# compilations output dependencies in $dir.libs/$base.o.d and |
|||
# in $dir$base.o.d. We have to check for both files, because |
|||
# one of the two compilations can be disabled. We should prefer |
|||
# $dir$base.o.d over $dir.libs/$base.o.d because the latter is |
|||
# automatically cleaned when .libs/ is deleted, while ignoring |
|||
# the former would cause a distcleancheck panic. |
|||
tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4 |
|||
tmpdepfile2=$dir$base.o.d # libtool 1.5 |
|||
tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5 |
|||
tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504 |
|||
"$@" -Wc,-MD |
|||
else |
|||
tmpdepfile1=$dir$base.o.d |
|||
tmpdepfile2=$dir$base.d |
|||
tmpdepfile3=$dir$base.d |
|||
tmpdepfile4=$dir$base.d |
|||
"$@" -MD |
|||
fi |
|||
|
|||
stat=$? |
|||
if test $stat -eq 0; then : |
|||
else |
|||
rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" |
|||
exit $stat |
|||
fi |
|||
|
|||
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" |
|||
do |
|||
test -f "$tmpdepfile" && break |
|||
done |
|||
if test -f "$tmpdepfile"; then |
|||
sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" |
|||
sed -e 's,^.*\.[a-z]*:['"$tab"' ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" |
|||
else |
|||
echo "#dummy" > "$depfile" |
|||
fi |
|||
rm -f "$tmpdepfile" |
|||
;; |
|||
|
|||
msvc7) |
|||
if test "$libtool" = yes; then |
|||
showIncludes=-Wc,-showIncludes |
|||
else |
|||
showIncludes=-showIncludes |
|||
fi |
|||
"$@" $showIncludes > "$tmpdepfile" |
|||
stat=$? |
|||
grep -v '^Note: including file: ' "$tmpdepfile" |
|||
if test "$stat" = 0; then : |
|||
else |
|||
rm -f "$tmpdepfile" |
|||
exit $stat |
|||
fi |
|||
rm -f "$depfile" |
|||
echo "$object : \\" > "$depfile" |
|||
# The first sed program below extracts the file names and escapes |
|||
# backslashes for cygpath. The second sed program outputs the file |
|||
# name when reading, but also accumulates all include files in the |
|||
# hold buffer in order to output them again at the end. This only |
|||
# works with sed implementations that can handle large buffers. |
|||
sed < "$tmpdepfile" -n ' |
|||
/^Note: including file: *\(.*\)/ { |
|||
s//\1/ |
|||
s/\\/\\\\/g |
|||
p |
|||
}' | $cygpath_u | sort -u | sed -n ' |
|||
s/ /\\ /g |
|||
s/\(.*\)/'"$tab"'\1 \\/p |
|||
s/.\(.*\) \\/\1:/ |
|||
H |
|||
$ { |
|||
s/.*/'"$tab"'/ |
|||
G |
|||
p |
|||
}' >> "$depfile" |
|||
rm -f "$tmpdepfile" |
|||
;; |
|||
|
|||
msvc7msys) |
|||
# This case exists only to let depend.m4 do its work. It works by |
|||
# looking at the text of this script. This case will never be run, |
|||
# since it is checked for above. |
|||
exit 1 |
|||
;; |
|||
|
|||
#nosideeffect) |
|||
# This comment above is used by automake to tell side-effect |
|||
# dependency tracking mechanisms from slower ones. |
|||
|
|||
dashmstdout) |
|||
# Important note: in order to support this mode, a compiler *must* |
|||
# always write the preprocessed file to stdout, regardless of -o. |
|||
"$@" || exit $? |
|||
|
|||
# Remove the call to Libtool. |
|||
if test "$libtool" = yes; then |
|||
while test "X$1" != 'X--mode=compile'; do |
|||
shift |
|||
done |
|||
shift |
|||
fi |
|||
|
|||
# Remove '-o $object'. |
|||
IFS=" " |
|||
for arg |
|||
do |
|||
case $arg in |
|||
-o) |
|||
shift |
|||
;; |
|||
$object) |
|||
shift |
|||
;; |
|||
*) |
|||
set fnord "$@" "$arg" |
|||
shift # fnord |
|||
shift # $arg |
|||
;; |
|||
esac |
|||
done |
|||
|
|||
test -z "$dashmflag" && dashmflag=-M |
|||
# Require at least two characters before searching for ':' |
|||
# in the target name. This is to cope with DOS-style filenames: |
|||
# a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise. |
|||
"$@" $dashmflag | |
|||
sed 's:^['"$tab"' ]*[^:'"$tab"' ][^:][^:]*\:['"$tab"' ]*:'"$object"'\: :' > "$tmpdepfile" |
|||
rm -f "$depfile" |
|||
cat < "$tmpdepfile" > "$depfile" |
|||
tr ' ' "$nl" < "$tmpdepfile" | \ |
|||
## Some versions of the HPUX 10.20 sed can't process this invocation |
|||
## correctly. Breaking it into two sed invocations is a workaround. |
|||
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" |
|||
rm -f "$tmpdepfile" |
|||
;; |
|||
|
|||
dashXmstdout) |
|||
# This case only exists to satisfy depend.m4. It is never actually |
|||
# run, as this mode is specially recognized in the preamble. |
|||
exit 1 |
|||
;; |
|||
|
|||
makedepend) |
|||
"$@" || exit $? |
|||
# Remove any Libtool call |
|||
if test "$libtool" = yes; then |
|||
while test "X$1" != 'X--mode=compile'; do |
|||
shift |
|||
done |
|||
shift |
|||
fi |
|||
# X makedepend |
|||
shift |
|||
cleared=no eat=no |
|||
for arg |
|||
do |
|||
case $cleared in |
|||
no) |
|||
set ""; shift |
|||
cleared=yes ;; |
|||
esac |
|||
if test $eat = yes; then |
|||
eat=no |
|||
continue |
|||
fi |
|||
case "$arg" in |
|||
-D*|-I*) |
|||
set fnord "$@" "$arg"; shift ;; |
|||
# Strip any option that makedepend may not understand. Remove |
|||
# the object too, otherwise makedepend will parse it as a source file. |
|||
-arch) |
|||
eat=yes ;; |
|||
-*|$object) |
|||
;; |
|||
*) |
|||
set fnord "$@" "$arg"; shift ;; |
|||
esac |
|||
done |
|||
obj_suffix=`echo "$object" | sed 's/^.*\././'` |
|||
touch "$tmpdepfile" |
|||
${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" |
|||
rm -f "$depfile" |
|||
# makedepend may prepend the VPATH from the source file name to the object. |
|||
# No need to regex-escape $object, excess matching of '.' is harmless. |
|||
sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile" |
|||
sed '1,2d' "$tmpdepfile" | tr ' ' "$nl" | \ |
|||
## Some versions of the HPUX 10.20 sed can't process this invocation |
|||
## correctly. Breaking it into two sed invocations is a workaround. |
|||
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" |
|||
rm -f "$tmpdepfile" "$tmpdepfile".bak |
|||
;; |
|||
|
|||
cpp) |
|||
# Important note: in order to support this mode, a compiler *must* |
|||
# always write the preprocessed file to stdout. |
|||
"$@" || exit $? |
|||
|
|||
# Remove the call to Libtool. |
|||
if test "$libtool" = yes; then |
|||
while test "X$1" != 'X--mode=compile'; do |
|||
shift |
|||
done |
|||
shift |
|||
fi |
|||
|
|||
# Remove '-o $object'. |
|||
IFS=" " |
|||
for arg |
|||
do |
|||
case $arg in |
|||
-o) |
|||
shift |
|||
;; |
|||
$object) |
|||
shift |
|||
;; |
|||
*) |
|||
set fnord "$@" "$arg" |
|||
shift # fnord |
|||
shift # $arg |
|||
;; |
|||
esac |
|||
done |
|||
|
|||
"$@" -E | |
|||
sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ |
|||
-e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | |
|||
sed '$ s: \\$::' > "$tmpdepfile" |
|||
rm -f "$depfile" |
|||
echo "$object : \\" > "$depfile" |
|||
cat < "$tmpdepfile" >> "$depfile" |
|||
sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" |
|||
rm -f "$tmpdepfile" |
|||
;; |
|||
|
|||
msvisualcpp) |
|||
# Important note: in order to support this mode, a compiler *must* |
|||
# always write the preprocessed file to stdout. |
|||
"$@" || exit $? |
|||
|
|||
# Remove the call to Libtool. |
|||
if test "$libtool" = yes; then |
|||
while test "X$1" != 'X--mode=compile'; do |
|||
shift |
|||
done |
|||
shift |
|||
fi |
|||
|
|||
IFS=" " |
|||
for arg |
|||
do |
|||
case "$arg" in |
|||
-o) |
|||
shift |
|||
;; |
|||
$object) |
|||
shift |
|||
;; |
|||
"-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") |
|||
set fnord "$@" |
|||
shift |
|||
shift |
|||
;; |
|||
*) |
|||
set fnord "$@" "$arg" |
|||
shift |
|||
shift |
|||
;; |
|||
esac |
|||
done |
|||
"$@" -E 2>/dev/null | |
|||
sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" |
|||
rm -f "$depfile" |
|||
echo "$object : \\" > "$depfile" |
|||
sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile" |
|||
echo "$tab" >> "$depfile" |
|||
sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" |
|||
rm -f "$tmpdepfile" |
|||
;; |
|||
|
|||
msvcmsys) |
|||
# This case exists only to let depend.m4 do its work. It works by |
|||
# looking at the text of this script. This case will never be run, |
|||
# since it is checked for above. |
|||
exit 1 |
|||
;; |
|||
|
|||
none) |
|||
exec "$@" |
|||
;; |
|||
|
|||
*) |
|||
echo "Unknown depmode $depmode" 1>&2 |
|||
exit 1 |
|||
;; |
|||
esac |
|||
|
|||
exit 0 |
|||
|
|||
# Local Variables: |
|||
# mode: shell-script |
|||
# sh-indentation: 2 |
|||
# eval: (add-hook 'write-file-hooks 'time-stamp) |
|||
# time-stamp-start: "scriptversion=" |
|||
# time-stamp-format: "%:y-%02m-%02d.%02H" |
|||
# time-stamp-time-zone: "UTC" |
|||
# time-stamp-end: "; # UTC" |
|||
# End: |
@ -0,0 +1,413 @@ |
|||
%* cnfsat.tex *% |
|||
|
|||
\documentclass[11pt,draft]{article} |
|||
\usepackage{amssymb} |
|||
\usepackage{indentfirst} |
|||
|
|||
\setlength{\textwidth}{6.5in} |
|||
\setlength{\textheight}{8.5in} |
|||
\setlength{\oddsidemargin}{0in} |
|||
\setlength{\topmargin}{0in} |
|||
\setlength{\headheight}{0in} |
|||
\setlength{\headsep}{0in} |
|||
\setlength{\footskip}{0.5in} |
|||
\setlength{\parindent}{16pt} |
|||
\setlength{\parskip}{5pt} |
|||
\setlength{\topsep}{0pt} |
|||
\setlength{\partopsep}{0pt} |
|||
\setlength{\itemsep}{\parskip} |
|||
\setlength{\parsep}{0pt} |
|||
\setlength{\leftmargini}{\parindent} |
|||
\renewcommand{\labelitemi}{---} |
|||
|
|||
\def\para#1{\noindent{\bf#1}} |
|||
\def\synopsis{\para{Synopsis}} |
|||
\def\description{\para{Description}} |
|||
\def\returns{\para{Returns}} |
|||
|
|||
\newenvironment{retlist} |
|||
{ \def\arraystretch{1.5} |
|||
\noindent |
|||
\begin{tabular}{@{}p{1in}@{}p{5.5in}@{}} |
|||
} |
|||
{\end{tabular}} |
|||
|
|||
\begin{document} |
|||
|
|||
\title{\bf CNF Satisfiability Problem} |
|||
|
|||
\author{Andrew Makhorin {\tt<mao@gnu.org>}} |
|||
|
|||
\date{August 2011} |
|||
|
|||
\maketitle |
|||
|
|||
\section{Introduction} |
|||
|
|||
The {\it Satisfiability Problem (SAT)} is a classic combinatorial |
|||
problem. Given a Boolean formula of $n$ variables |
|||
$$f(x_1,x_2,\dots,x_n),\eqno(1.1)$$ |
|||
this problem is to find such values of the variables, on which the |
|||
formula takes on the value {\it true}. |
|||
|
|||
The {\it CNF Satisfiability Problem (CNF-SAT)} is a version of the |
|||
Satisfiability Problem, where the Boolean formula (1.1) is specified |
|||
in the {\it Conjunctive Normal Form (CNF)}, that means that it is a |
|||
conjunction of {\it clauses}, where a clause is a disjunction of |
|||
{\it literals}, and a literal is a variable or its negation. |
|||
For example: |
|||
$$(x_1\vee x_2)\;\&\;(\neg x_2\vee x_3\vee\neg x_4)\;\&\;(\neg |
|||
x_1\vee x_4).\eqno(1.2)$$ |
|||
Here $x_1$, $x_2$, $x_3$, $x_4$ are Boolean variables to be assigned, |
|||
$\neg$ means |
|||
negation (logical {\it not}), $\vee$ means disjunction (logical |
|||
{\it or}), and $\&$ means conjunction (logical {\it and}). One may |
|||
note that the formula (1.2) is {\it satisfiable}, because on |
|||
$x_1$ = {\it true}, $x_2$ = {\it false}, $x_3$ = {\it false}, and |
|||
$x_4$ = {\it true} it takes on the value {\it true}. If a formula |
|||
is not satisfiable, it is called {\it unsatisfiable}, that means that |
|||
it takes on the value {\it false} on any values of its variables. |
|||
|
|||
Any CNF-SAT problem can be easily translated to a 0-1 programming |
|||
problem as follows.\linebreak A Boolean variable $x$ can be modeled by |
|||
a binary variable in a natural way: $x=1$ means that $x$ takes on the |
|||
value {\it true}, and $x=0$ means that $x$ takes on the value |
|||
{\it false}. Then, if a literal is a negated variable, i.e. $t=\neg x$, |
|||
it can be expressed as $t=1-x$. Since a formula in CNF is a conjunction |
|||
of clauses, to provide its satisfiability we should require all its |
|||
clauses to take on the value {\it true}. A particular clause is |
|||
a disjunction of literals: |
|||
$$t\vee t'\vee t''\dots ,\eqno(1.3)$$ |
|||
so it takes on the value {\it true} iff at least one of its literals |
|||
takes on the value {\it true}, that can be expressed as the following |
|||
inequality constraint: |
|||
$$t+t'+t''+\dots\geq 1.\eqno(1.4)$$ |
|||
Note that no objective function is used in this case, because only |
|||
a feasible solution needs to be found. |
|||
|
|||
For example, the formula (1.2) can be translated to the following |
|||
constraints: |
|||
$$\begin{array}{c@{\ }c@{\ }c@{\ }c@{\ }c@{\ }c@{\ }c@{\ }c@{\ }c} |
|||
x_1&+&x_2&&&&&\geq&1\\ |
|||
&&(1-x_2)&+&x_3&+&(1-x_4)&\geq&1\\ |
|||
(1-x_1)&&&&&+&x_4&\geq&1\\ |
|||
\end{array}$$ |
|||
$$x_1, x_2, x_3, x_4\in\{0,1\}$$ |
|||
Carrying out all constant terms to the right-hand side gives |
|||
corresponding 0-1 programming problem in the standard format: |
|||
$$\begin{array}{r@{\ }c@{\ }c@{\ }c@{\ }c@{\ }c@{\ }c@{\ }c@{\ }r} |
|||
x_1&+&x_2&&&&&\geq&1\\ |
|||
&-&x_2&+&x_3&-&x_4&\geq&-1\\ |
|||
-x_1&&&&&+&x_4&\geq&0\\ |
|||
\end{array}$$ |
|||
$$x_1, x_2, x_3, x_4\in\{0,1\}$$ |
|||
|
|||
In general case translation of a CNF-SAT problem results in the |
|||
following 0-1 programming problem: |
|||
$$\sum_{j\in J^+_i}x_j-\sum_{j\in J^-_i}x_j\geq 1-|J^-_i|, |
|||
\ \ \ i=1,\dots,m\eqno(1.5)$$ |
|||
$$x_j\in\{0,1\},\ \ \ j=1,\dots,n\eqno(1.6)$$ |
|||
where $n$ is the number of variables, $m$ is the number of clauses |
|||
(inequality constraints),\linebreak $J^+_i\subseteq\{1,\dots,n\}$ is |
|||
a subset of variables, whose literals in $i$-th clause do not have |
|||
negation, and $J^-_i\subseteq\{1,\dots,n\}$ is a subset of variables, |
|||
whose literals in $i$-th clause are negations of that variables. It is |
|||
assumed that $J^+_i\cap J^-_i=\varnothing$ for all $i$. |
|||
|
|||
\section{GLPK API Routines} |
|||
|
|||
\subsection{glp\_read\_cnfsat --- read CNF-SAT problem data in DIMACS |
|||
format} |
|||
|
|||
\synopsis |
|||
|
|||
\begin{verbatim} |
|||
int glp_read_cnfsat(glp_prob *P, const char *fname); |
|||
\end{verbatim} |
|||
|
|||
\description |
|||
|
|||
The routine \verb|glp_read_cnfsat| reads the CNF-SAT problem data from |
|||
a text file in DIMACS format and automatically translates the data to |
|||
corresponding 0-1 programming problem instance (1.5)--(1.6). |
|||
|
|||
The parameter \verb|P| specifies the problem object, to which the |
|||
0-1 programming problem instance should be stored. Note that before |
|||
reading data the current content of the problem object is completely |
|||
erased with the routine \verb|glp_erase_prob|. |
|||
|
|||
The character string \verb|fname| specifies the name of a text file |
|||
to be read in. (If the file name ends with the suffix `\verb|.gz|', |
|||
the file is assumed to be compressed, in which case the routine |
|||
decompresses it ``on the fly''.) |
|||
|
|||
\newpage |
|||
|
|||
\returns |
|||
|
|||
If the operation was successful, the routine returns zero. Otherwise, |
|||
it prints an error message and returns non-zero. |
|||
|
|||
\para{DIMACS CNF-SAT problem format}\footnote{This material is based on |
|||
the paper ``Satisfiability Suggested Format'', which is publicly |
|||
available at {\tt http://dimacs.rutgers.edu/}.} |
|||
|
|||
The DIMACS input file is a plain ASCII text file. It contains lines of |
|||
several types described below. A line is terminated with an end-of-line |
|||
character. Fields in each line are separated by at least one blank |
|||
space. |
|||
|
|||
\para{Comment lines.} Comment lines give human-readable information |
|||
about the file and are ignored by programs. Comment lines can appear |
|||
anywhere in the file. Each comment line begins with a lower-case |
|||
character \verb|c|. |
|||
|
|||
\begin{verbatim} |
|||
c This is a comment line |
|||
\end{verbatim} |
|||
|
|||
\para{Problem line.} There is one problem line per data file. The |
|||
problem line must appear before any clause lines. It has the following |
|||
format: |
|||
|
|||
\begin{verbatim} |
|||
p cnf VARIABLES CLAUSES |
|||
\end{verbatim} |
|||
|
|||
\noindent |
|||
The lower-case character \verb|p| signifies that this is a problem |
|||
line. The three character problem designator \verb|cnf| identifies the |
|||
file as containing specification information for the CNF-SAT problem. |
|||
The \verb|VARIABLES| field contains an integer value specifying $n$, |
|||
the number of variables in the instance. The \verb|CLAUSES| field |
|||
contains an integer value specifying $m$, the number of clauses in the |
|||
instance. |
|||
|
|||
\para{Clauses.} The clauses appear immediately after the problem |
|||
line. The variables are assumed to be numbered from 1 up to $n$. It is |
|||
not necessary that every variable appears in the instance. Each clause |
|||
is represented by a sequence of numbers separated by either a space, |
|||
tab, or new-line character. The non-negated version of a variable $j$ |
|||
is represented by $j$; the negated version is represented by $-j$. Each |
|||
clause is terminated by the value 0. Unlike many formats that represent |
|||
the end of a clause by a new-line character, this format allows clauses |
|||
to be on multiple lines. |
|||
|
|||
\para{Example.} Below here is an example of the data file in DIMACS |
|||
format corresponding to the CNF-SAT problem (1.2). |
|||
|
|||
\begin{footnotesize} |
|||
\begin{verbatim} |
|||
c sample.cnf |
|||
c |
|||
c This is an example of the CNF-SAT problem data |
|||
c in DIMACS format. |
|||
c |
|||
p cnf 4 3 |
|||
1 2 0 |
|||
-4 3 |
|||
-2 0 |
|||
-1 4 0 |
|||
c |
|||
c eof |
|||
\end{verbatim} |
|||
\end{footnotesize} |
|||
|
|||
\newpage |
|||
|
|||
\subsection{glp\_check\_cnfsat --- check for CNF-SAT problem instance} |
|||
|
|||
\synopsis |
|||
|
|||
\begin{verbatim} |
|||
int glp_check_cnfsat(glp\_prob *P); |
|||
\end{verbatim} |
|||
|
|||
\description |
|||
|
|||
The routine \verb|glp_check_cnfsat| checks if the specified problem |
|||
object \verb|P| contains a 0-1 programming problem instance in the |
|||
format (1.5)--(1.6) and therefore encodes a CNF-SAT problem instance. |
|||
|
|||
\returns |
|||
|
|||
If the specified problem object has the format (1.5)--(1.6), the |
|||
routine returns zero, otherwise non-zero. |
|||
|
|||
\subsection{glp\_write\_cnfsat --- write CNF-SAT problem data in DIMACS |
|||
format} |
|||
|
|||
\synopsis |
|||
|
|||
\begin{verbatim} |
|||
int glp_write_cnfsat(glp_prob *P, const char *fname); |
|||
\end{verbatim} |
|||
|
|||
\description |
|||
|
|||
The routine \verb|glp_write_cnfsat| automatically translates the |
|||
specified 0-1 programming problem instance (1.5)--(1.6) to a CNF-SAT |
|||
problem instance and writes the problem data to a text file in DIMACS |
|||
format. |
|||
|
|||
The parameter \verb|P| is the problem object, which should specify |
|||
a 0-1 programming problem instance in the format (1.5)--(1.6). |
|||
|
|||
The character string \verb|fname| specifies a name of the output text |
|||
file to be written. (If the file name ends with suffix `\verb|.gz|', |
|||
the file is assumed to be compressed, in which case the routine |
|||
performs automatic compression on writing that file.) |
|||
|
|||
\returns |
|||
|
|||
If the operation was successful, the routine returns zero. Otherwise, |
|||
it prints an error message and returns non-zero. |
|||
|
|||
\subsection{glp\_minisat1 --- solve CNF-SAT problem instance with |
|||
MiniSat solver} |
|||
|
|||
\synopsis |
|||
|
|||
\begin{verbatim} |
|||
int glp_minisat1(glp_prob *P); |
|||
\end{verbatim} |
|||
|
|||
\description |
|||
|
|||
The routine \verb|glp_minisat1| is a driver to MiniSat, a CNF-SAT |
|||
solver developed by Niklas E\'en and Niklas S\"orensson, Chalmers |
|||
University of Technology, Sweden.\footnote{The MiniSat software module |
|||
is {\it not} part of GLPK, but is used with GLPK and included in the |
|||
distribution.} |
|||
|
|||
\newpage |
|||
|
|||
It is assumed that the specified problem object \verb|P| contains |
|||
a 0-1 programming problem instance in the format (1.5)--(1.6) and |
|||
therefore encodes a CNF-SAT problem instance. |
|||
|
|||
If the problem instance has been successfully solved to the end, the |
|||
routine \verb|glp_minisat1| returns 0. In this case the routine |
|||
\verb|glp_mip_status| can be used to determine the solution status: |
|||
|
|||
\begin{itemize} |
|||
\item {\tt GLP\_OPT} means that the solver found an integer feasible |
|||
solution and therefore the corresponding CNF-SAT instance is |
|||
satisfiable; |
|||
|
|||
\item {\tt GLP\_NOFEAS} means that no integer feasible solution exists |
|||
and therefore the corresponding CNF-SAT instance is unsatisfiable. |
|||
\end{itemize} |
|||
|
|||
If an integer feasible solution was found, corresponding values of |
|||
binary variables can be retrieved with the routine |
|||
\verb|glp_mip_col_val|. |
|||
|
|||
\returns |
|||
|
|||
\begin{retlist} |
|||
0 & The MIP problem instance has been successfully solved. (This code |
|||
does {\it not} necessarily mean that the solver has found feasible |
|||
solution. It only means that the solution process was successful.)\\ |
|||
|
|||
{\tt GLP\_EDATA} & The specified problem object contains a MIP |
|||
instance which does {\it not} have the format (1.5)--(1.6).\\ |
|||
|
|||
{\tt GLP\_EFAIL} & The solution process was unsuccessful because of |
|||
the solver failure.\\ |
|||
\end{retlist} |
|||
|
|||
\subsection{glp\_intfeas1 --- solve integer feasibility problem} |
|||
|
|||
\synopsis |
|||
|
|||
\begin{verbatim} |
|||
int glp_intfeas1(glp_prob *P, int use_bound, int obj_bound); |
|||
\end{verbatim} |
|||
|
|||
\description |
|||
|
|||
The routine \verb|glp_intfeas1| is a tentative implementation of |
|||
an integer feasibility solver based on a CNF-SAT solver (currently |
|||
it is MiniSat; see Subsection 2.4). |
|||
|
|||
If the parameter \verb|use_bound| is zero, the routine searches for |
|||
{\it any} integer feasibile solution to the specified integer |
|||
programming problem. Note that in this case the objective function is |
|||
ignored. |
|||
|
|||
If the parameter \verb|use_bound| is non-zero, the routine searches for |
|||
an integer feasible solution, which provides a value of the objective |
|||
function not worse than \verb|obj_bound|. In other word, the parameter |
|||
\verb|obj_bound| specifies an upper (in case of minimization) or lower |
|||
(in case of maximization) bound to the objective function. |
|||
|
|||
If the specified problem has been successfully solved to the end, the |
|||
routine \verb|glp_intfeas1| returns 0. In this case the routine |
|||
\verb|glp_mip_status| can be used to determine the solution status: |
|||
|
|||
\begin{itemize} |
|||
\item {\tt GLP\_FEAS} means that the solver found an integer feasible |
|||
solution; |
|||
|
|||
\item {\tt GLP\_NOFEAS} means that the problem has no integer feasible |
|||
solution (if {\tt use\_bound} is zero) or it has no integer feasible |
|||
solution, which is not worse than {\tt obj\_bound} (if {\tt use\_bound} |
|||
is non-zero). |
|||
\end{itemize} |
|||
|
|||
\newpage |
|||
|
|||
If an integer feasible solution was found, corresponding values of |
|||
variables (columns) can be retrieved with the routine |
|||
\verb|glp_mip_col_val|. |
|||
|
|||
\para{Usage Notes} |
|||
|
|||
The integer programming problem specified by the parameter \verb|P| |
|||
should satisfy to the following requirements: |
|||
|
|||
\begin{enumerate} |
|||
\item All variables (columns) should be either binary ({\tt GLP\_BV}) |
|||
or fixed at integer values ({\tt GLP\_FX}). |
|||
|
|||
\item All constraint and objective coefficients should be integer |
|||
numbers in the range\linebreak $[-2^{31},\ +2^{31}-1]$. |
|||
\end{enumerate} |
|||
|
|||
Though there are no special requirements to the constraints, |
|||
currently the routine \verb|glp_intfeas1| is efficient mainly for |
|||
problems, where most constraints (rows) fall into the following three |
|||
classes: |
|||
|
|||
\begin{enumerate} |
|||
\item Covering inequalities |
|||
$$\sum_{j}t_j\geq 1,$$ |
|||
where $t_j=x_j$ or $t_j=1-x_j$, $x_j$ is a binary variable. |
|||
|
|||
\item Packing inequalities |
|||
$$\sum_{j}t_j\leq 1.$$ |
|||
|
|||
\item Partitioning equalities (SOS1 constraints) |
|||
$$\sum_{j}t_j=1.$$ |
|||
\end{enumerate} |
|||
|
|||
\returns |
|||
|
|||
\begin{retlist} |
|||
0 & The problem has been successfully solved. (This code does |
|||
{\it not} necessarily mean that the solver has found an integer |
|||
feasible solution. It only means that the solution process was |
|||
successful.) \\ |
|||
|
|||
{\tt GLP\_EDATA} & The specified problem object does not satisfy |
|||
to the requirements listed in Paragraph `Usage Notes'. \\ |
|||
|
|||
{\tt GLP\_ERANGE} & An integer overflow occured on translating the |
|||
specified problem to a CNF-SAT problem. \\ |
|||
|
|||
{\tt GLP\_EFAIL} & The solution process was unsuccessful because of |
|||
the solver failure. \\ |
|||
\end{retlist} |
|||
|
|||
\end{document} |
@ -0,0 +1,168 @@ |
|||
%* glpk.tex *% |
|||
|
|||
%*********************************************************************** |
|||
% This code is part of GLPK (GNU Linear Programming Kit). |
|||
% |
|||
% Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, |
|||
% 2009, 2010, 2011, 2013, 2014, 2015 Andrew Makhorin, Department for |
|||
% Applied Informatics, Moscow Aviation Institute, Moscow, Russia. All |
|||
% rights reserved. E-mail: <mao@gnu.org>. |
|||
% |
|||
% GLPK is free software: you can redistribute it and/or modify it |
|||
% under the terms of the GNU General Public License as published by |
|||
% the Free Software Foundation, either version 3 of the License, or |
|||
% (at your option) any later version. |
|||
% |
|||
% GLPK is distributed in the hope that it will be useful, but WITHOUT |
|||
% ANY WARRANTY; without even the implied warranty of MERCHANTABILITY |
|||
% or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public |
|||
% License for more details. |
|||
% |
|||
% You should have received a copy of the GNU General Public License |
|||
% along with GLPK. If not, see <http://www.gnu.org/licenses/>. |
|||
%*********************************************************************** |
|||
|
|||
\documentclass[11pt]{report} |
|||
\usepackage{amssymb} |
|||
\usepackage[dvipdfm,linktocpage,colorlinks,linkcolor=blue, |
|||
urlcolor=blue]{hyperref} |
|||
\usepackage{indentfirst} |
|||
\usepackage{lscape} |
|||
\usepackage[all]{xy} |
|||
|
|||
\setlength{\textwidth}{6.5in} |
|||
\setlength{\textheight}{8.5in} |
|||
\setlength{\oddsidemargin}{0in} |
|||
\setlength{\topmargin}{0in} |
|||
\setlength{\headheight}{0in} |
|||
\setlength{\headsep}{0in} |
|||
\setlength{\footskip}{0.5in} |
|||
\setlength{\parindent}{16pt} |
|||
\setlength{\parskip}{5pt} |
|||
\setlength{\topsep}{0pt} |
|||
\setlength{\partopsep}{0pt} |
|||
\setlength{\itemsep}{\parskip} |
|||
\setlength{\parsep}{0pt} |
|||
\setlength{\leftmargini}{\parindent} |
|||
\renewcommand{\labelitemi}{---} |
|||
|
|||
\def\para#1{\noindent{\bf#1}} |
|||
\def\synopsis{\para{Synopsis}} |
|||
\def\description{\para{Description}} |
|||
\def\note{\para{Note}} |
|||
\def\returns{\para{Returns}} |
|||
|
|||
\renewcommand\contentsname{\sf\bfseries Contents} |
|||
\renewcommand\chaptername{\sf\bfseries Chapter} |
|||
\renewcommand\appendixname{\sf\bfseries Appendix} |
|||
|
|||
\newenvironment{retlist} |
|||
{ \def\arraystretch{1.5} |
|||
\noindent |
|||
\begin{tabular}{@{}p{1in}@{}p{5.5in}@{}} |
|||
} |
|||
{\end{tabular}} |
|||
|
|||
\begin{document} |
|||
|
|||
\thispagestyle{empty} |
|||
|
|||
\begin{center} |
|||
|
|||
\vspace*{1.5in} |
|||
|
|||
\begin{huge} |
|||
\sf\bfseries GNU Linear Programming Kit |
|||
\end{huge} |
|||
|
|||
\vspace{0.5in} |
|||
|
|||
\begin{LARGE} |
|||
\sf Reference Manual |
|||
\end{LARGE} |
|||
|
|||
\vspace{0.5in} |
|||
|
|||
\begin{LARGE} |
|||
\sf for GLPK Version 4.57 |
|||
\end{LARGE} |
|||
|
|||
\vspace{0.5in} |
|||
\begin{Large} |
|||
\sf (DRAFT, November 2015) |
|||
\end{Large} |
|||
\end{center} |
|||
|
|||
\newpage |
|||
|
|||
\vspace*{1in} |
|||
|
|||
\vfill |
|||
|
|||
\noindent |
|||
The GLPK package is part of the GNU Project released under the aegis of |
|||
GNU. |
|||
|
|||
\noindent |
|||
Copyright \copyright{} 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, |
|||
2008, 2009, 2010, 2011, 2013, 2014, 2015 Andrew Makhorin, Department |
|||
for Applied Informatics, Moscow Aviation Institute, Moscow, Russia. All |
|||
rights reserved. |
|||
|
|||
\noindent |
|||
Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA |
|||
02110-1301, USA. |
|||
|
|||
\noindent |
|||
Permission is granted to make and distribute verbatim copies of this |
|||
manual provided the copyright notice and this permission notice are |
|||
preserved on all copies. |
|||
|
|||
\noindent |
|||
Permission is granted to copy and distribute modified versions of this |
|||
manual under the conditions for verbatim copying, provided also that |
|||
the entire resulting derived work is distributed under the terms of |
|||
a permission notice identical to this one. |
|||
|
|||
\noindent |
|||
Permission is granted to copy and distribute translations of this |
|||
manual into another language, under the above conditions for modified |
|||
versions. |
|||
|
|||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|||
|
|||
\newpage |
|||
|
|||
{\setlength{\parskip}{0pt} |
|||
\tableofcontents |
|||
} |
|||
|
|||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|||
|
|||
\include{glpk01} |
|||
|
|||
\include{glpk02} |
|||
|
|||
\include{glpk03} |
|||
|
|||
\include{glpk04} |
|||
|
|||
\include{glpk05} |
|||
|
|||
\include{glpk06} |
|||
|
|||
\appendix |
|||
|
|||
\include{glpk07} |
|||
|
|||
\include{glpk08} |
|||
|
|||
\include{glpk09} |
|||
|
|||
\include{glpk10} |
|||
|
|||
\include{glpk11} |
|||
|
|||
\include{glpk12} |
|||
|
|||
\end{document} |
@ -0,0 +1,343 @@ |
|||
%* glpk01.tex *% |
|||
|
|||
\chapter{Introduction} |
|||
|
|||
GLPK (\underline{G}NU \underline{L}inear \underline{P}rogramming |
|||
\underline{K}it) is a set of routines written in the ANSI C programming |
|||
language and organized in the form of a callable library. It is |
|||
intended for solving linear programming (LP), mixed integer programming |
|||
(MIP), and other related problems. |
|||
|
|||
\section{LP problem} |
|||
\label{seclp} |
|||
|
|||
GLPK assumes the following formulation of {\it linear programming (LP)} |
|||
problem: |
|||
|
|||
\medskip\noindent |
|||
\hspace{.5in} minimize (or maximize) |
|||
$$z = c_1x_{m+1} + c_2x_{m+2} + \dots + c_nx_{m+n} + c_0 \eqno (1.1)$$ |
|||
\hspace{.5in} subject to linear constraints |
|||
$$ |
|||
\begin{array}{r@{\:}c@{\:}r@{\:}c@{\:}r@{\:}c@{\:}r} |
|||
x_1&=&a_{11}x_{m+1}&+&a_{12}x_{m+2}&+ \dots +&a_{1n}x_{m+n} \\ |
|||
x_2&=&a_{21}x_{m+1}&+&a_{22}x_{m+2}&+ \dots +&a_{2n}x_{m+n} \\ |
|||
\multicolumn{7}{c} |
|||
{.\ \ .\ \ .\ \ .\ \ .\ \ .\ \ .\ \ .\ \ .\ \ .\ \ .\ \ .\ \ .\ \ .} \\ |
|||
x_m&=&a_{m1}x_{m+1}&+&a_{m2}x_{m+2}&+ \dots +&a_{mn}x_{m+n} \\ |
|||
\end{array} \eqno (1.2) |
|||
$$ |
|||
\hspace{.5in} and bounds of variables |
|||
$$ |
|||
\begin{array}{r@{\:}c@{\:}c@{\:}c@{\:}l} |
|||
l_1&\leq&x_1&\leq&u_1 \\ |
|||
l_2&\leq&x_2&\leq&u_2 \\ |
|||
\multicolumn{5}{c}{.\ \ .\ \ .\ \ .\ \ .}\\ |
|||
l_{m+n}&\leq&x_{m+n}&\leq&u_{m+n} \\ |
|||
\end{array} \eqno (1.3) |
|||
$$ |
|||
|
|||
\medskip\noindent |
|||
where: $x_1, x_2, \dots, x_m$ are auxiliary variables; |
|||
$x_{m+1}, x_{m+2}, \dots, x_{m+n}$ are structural variables; |
|||
$z$ is the objective function; |
|||
$c_1, c_2, \dots, c_n$ are objective coefficients; |
|||
$c_0$ is the constant term (``shift'') of the objective function; |
|||
$a_{11}, a_{12}, \dots, a_{mn}$ are constraint coefficients; |
|||
$l_1, l_2, \dots, l_{m+n}$ are lower bounds of variables; |
|||
$u_1, u_2, \dots, u_{m+n}$ are upper bounds of variables. |
|||
|
|||
Auxiliary variables are also called {\it rows}, because they correspond |
|||
to rows of the constraint matrix (i.e. a matrix built of the constraint |
|||
coefficients). Similarly, structural variables are also called |
|||
{\it columns}, because they correspond to columns of the constraint |
|||
matrix. |
|||
|
|||
Bounds of variables can be finite as well as infinite. Besides, lower |
|||
and upper bounds can be equal to each other. Thus, the following types |
|||
of variables are possible: |
|||
|
|||
\begin{center} |
|||
\begin{tabular}{r@{}c@{}ll} |
|||
\multicolumn{3}{c}{Bounds of variable} & Type of variable \\ |
|||
\hline |
|||
$-\infty <$ &$\ x_k\ $& $< +\infty$ & Free (unbounded) variable \\ |
|||
$l_k \leq$ &$\ x_k\ $& $< +\infty$ & Variable with lower bound \\ |
|||
$-\infty <$ &$\ x_k\ $& $\leq u_k$ & Variable with upper bound \\ |
|||
$l_k \leq$ &$\ x_k\ $& $\leq u_k$ & Double-bounded variable \\ |
|||
$l_k =$ &$\ x_k\ $& $= u_k$ & Fixed variable \\ |
|||
\end{tabular} |
|||
\end{center} |
|||
|
|||
\noindent |
|||
Note that the types of variables shown above are applicable to |
|||
structural as well as to auxiliary variables. |
|||
|
|||
To solve the LP problem (1.1)---(1.3) is to find such values of all |
|||
structural and auxiliary variables, which: |
|||
|
|||
\vspace*{-10pt} |
|||
|
|||
\begin{itemize}\setlength{\itemsep}{0pt} |
|||
\item satisfy to all the linear constraints (1.2), and |
|||
|
|||
\item are within their bounds (1.3), and |
|||
|
|||
\item provide smallest (in case of minimization) or largest (in case of |
|||
maximization) value of the objective function (1.1). |
|||
\end{itemize} |
|||
|
|||
\section{MIP problem} |
|||
|
|||
{\it Mixed integer linear programming (MIP)} problem is an LP problem |
|||
in which some variables are additionally required to be integer. |
|||
|
|||
GLPK assumes that MIP problem has the same formulation as ordinary |
|||
(pure) LP problem (1.1)---(1.3), i.e. includes auxiliary and structural |
|||
variables, which may have lower and/or upper bounds. However, in case |
|||
of MIP problem some variables may be required to be integer. This |
|||
additional constraint means that a value of each {\it integer variable} |
|||
must be only integer number. (Should note that GLPK allows only |
|||
structural variables to be of integer kind.) |
|||
|
|||
\section{Using the package} |
|||
|
|||
\subsection{Brief example} |
|||
|
|||
In order to understand what GLPK is from the user's standpoint, |
|||
consider the following simple LP problem: |
|||
|
|||
\medskip |
|||
|
|||
\noindent |
|||
\hspace{.5in} maximize |
|||
$$z = 10 x_1 + 6 x_2 + 4 x_3$$ |
|||
\hspace{.5in} subject to |
|||
$$ |
|||
\begin{array}{r@{\:}c@{\:}r@{\:}c@{\:}r@{\:}c@{\:}r} |
|||
x_1 &+&x_2 &+&x_3 &\leq 100 \\ |
|||
10 x_1 &+& 4 x_2 & +&5 x_3 & \leq 600 \\ |
|||
2 x_1 &+& 2 x_2 & +& 6 x_3 & \leq 300 \\ |
|||
\end{array} |
|||
$$ |
|||
\hspace{.5in} where all variables are non-negative |
|||
$$x_1 \geq 0, \ x_2 \geq 0, \ x_3 \geq 0$$ |
|||
|
|||
At first, this LP problem should be transformed to the standard form |
|||
(1.1)---(1.3). This can be easily done by introducing auxiliary |
|||
variables, by one for each original inequality constraint. Thus, the |
|||
problem can be reformulated as follows: |
|||
|
|||
\medskip |
|||
|
|||
\noindent |
|||
\hspace{.5in} maximize |
|||
$$z = 10 x_1 + 6 x_2 + 4 x_3$$ |
|||
\hspace{.5in} subject to |
|||
$$ |
|||
\begin{array}{r@{\:}c@{\:}r@{\:}c@{\:}r@{\:}c@{\:}r} |
|||
p& = &x_1 &+&x_2 &+&x_3 \\ |
|||
q& = &10 x_1 &+& 4 x_2 &+& 5 x_3 \\ |
|||
r& = &2 x_1 &+& 2 x_2 &+& 6 x_3 \\ |
|||
\end{array} |
|||
$$ |
|||
\hspace{.5in} and bounds of variables |
|||
$$ |
|||
\begin{array}{ccc} |
|||
\nonumber -\infty < p \leq 100 && 0 \leq x_1 < +\infty \\ |
|||
\nonumber -\infty < q \leq 600 && 0 \leq x_2 < +\infty \\ |
|||
\nonumber -\infty < r \leq 300 && 0 \leq x_3 < +\infty \\ |
|||
\end{array} |
|||
$$ |
|||
|
|||
\medskip |
|||
|
|||
where $p, q, r$ are auxiliary variables (rows), and $x_1, x_2, x_3$ are |
|||
structural variables (columns). |
|||
|
|||
The example C program shown below uses GLPK API routines in order to |
|||
solve this LP problem.\footnote{If you just need to solve LP or MIP |
|||
instance, you may write it in MPS or CPLEX LP format and then use the |
|||
GLPK stand-alone solver to obtain a solution. This is much less |
|||
time-consuming than programming in C with GLPK API routines.} |
|||
|
|||
\begin{footnotesize} |
|||
\begin{verbatim} |
|||
/* sample.c */ |
|||
|
|||
#include <stdio.h> |
|||
#include <stdlib.h> |
|||
#include <glpk.h> |
|||
|
|||
int main(void) |
|||
{ glp_prob *lp; |
|||
int ia[1+1000], ja[1+1000]; |
|||
double ar[1+1000], z, x1, x2, x3; |
|||
s1: lp = glp_create_prob(); |
|||
s2: glp_set_prob_name(lp, "sample"); |
|||
s3: glp_set_obj_dir(lp, GLP_MAX); |
|||
s4: glp_add_rows(lp, 3); |
|||
s5: glp_set_row_name(lp, 1, "p"); |
|||
s6: glp_set_row_bnds(lp, 1, GLP_UP, 0.0, 100.0); |
|||
s7: glp_set_row_name(lp, 2, "q"); |
|||
s8: glp_set_row_bnds(lp, 2, GLP_UP, 0.0, 600.0); |
|||
s9: glp_set_row_name(lp, 3, "r"); |
|||
s10: glp_set_row_bnds(lp, 3, GLP_UP, 0.0, 300.0); |
|||
s11: glp_add_cols(lp, 3); |
|||
s12: glp_set_col_name(lp, 1, "x1"); |
|||
s13: glp_set_col_bnds(lp, 1, GLP_LO, 0.0, 0.0); |
|||
s14: glp_set_obj_coef(lp, 1, 10.0); |
|||
s15: glp_set_col_name(lp, 2, "x2"); |
|||
s16: glp_set_col_bnds(lp, 2, GLP_LO, 0.0, 0.0); |
|||
s17: glp_set_obj_coef(lp, 2, 6.0); |
|||
s18: glp_set_col_name(lp, 3, "x3"); |
|||
s19: glp_set_col_bnds(lp, 3, GLP_LO, 0.0, 0.0); |
|||
s20: glp_set_obj_coef(lp, 3, 4.0); |
|||
s21: ia[1] = 1, ja[1] = 1, ar[1] = 1.0; /* a[1,1] = 1 */ |
|||
s22: ia[2] = 1, ja[2] = 2, ar[2] = 1.0; /* a[1,2] = 1 */ |
|||
s23: ia[3] = 1, ja[3] = 3, ar[3] = 1.0; /* a[1,3] = 1 */ |
|||
s24: ia[4] = 2, ja[4] = 1, ar[4] = 10.0; /* a[2,1] = 10 */ |
|||
s25: ia[5] = 3, ja[5] = 1, ar[5] = 2.0; /* a[3,1] = 2 */ |
|||
s26: ia[6] = 2, ja[6] = 2, ar[6] = 4.0; /* a[2,2] = 4 */ |
|||
s27: ia[7] = 3, ja[7] = 2, ar[7] = 2.0; /* a[3,2] = 2 */ |
|||
s28: ia[8] = 2, ja[8] = 3, ar[8] = 5.0; /* a[2,3] = 5 */ |
|||
s29: ia[9] = 3, ja[9] = 3, ar[9] = 6.0; /* a[3,3] = 6 */ |
|||
s30: glp_load_matrix(lp, 9, ia, ja, ar); |
|||
s31: glp_simplex(lp, NULL); |
|||
s32: z = glp_get_obj_val(lp); |
|||
s33: x1 = glp_get_col_prim(lp, 1); |
|||
s34: x2 = glp_get_col_prim(lp, 2); |
|||
s35: x3 = glp_get_col_prim(lp, 3); |
|||
s36: printf("\nz = %g; x1 = %g; x2 = %g; x3 = %g\n", |
|||
z, x1, x2, x3); |
|||
s37: glp_delete_prob(lp); |
|||
return 0; |
|||
} |
|||
|
|||
/* eof */ |
|||
\end{verbatim} |
|||
\end{footnotesize} |
|||
|
|||
The statement \verb|s1| creates a problem object. Being created the |
|||
object is initially empty. The statement \verb|s2| assigns a symbolic |
|||
name to the problem object. |
|||
|
|||
The statement \verb|s3| calls the routine \verb|glp_set_obj_dir| in |
|||
order to set the optimization direction flag, where \verb|GLP_MAX| |
|||
means maximization. |
|||
|
|||
The statement \verb|s4| adds three rows to the problem object. |
|||
|
|||
The statement \verb|s5| assigns the symbolic name `\verb|p|' to the |
|||
first row, and the statement \verb|s6| sets the type and bounds of the |
|||
first row, where \verb|GLP_UP| means that the row has an upper bound. |
|||
The statements \verb|s7|, \verb|s8|, \verb|s9|, \verb|s10| are used in |
|||
the same way in order to assign the symbolic names `\verb|q|' and |
|||
`\verb|r|' to the second and third rows and set their types and bounds. |
|||
|
|||
The statement \verb|s11| adds three columns to the problem object. |
|||
|
|||
The statement \verb|s12| assigns the symbolic name `\verb|x1|' to the |
|||
first column, the statement \verb|s13| sets the type and bounds of the |
|||
first column, where \verb|GLP_LO| means that the column has an lower |
|||
bound, and the statement \verb|s14| sets the objective coefficient for |
|||
the first column. The statements \verb|s15|---\verb|s20| are used in |
|||
the same way in order to assign the symbolic names `\verb|x2|' and |
|||
`\verb|x3|' to the second and third columns and set their types, |
|||
bounds, and objective coefficients. |
|||
|
|||
The statements \verb|s21|---\verb|s29| prepare non-zero elements of the |
|||
constraint matrix (i.e. constraint coefficients). Row indices of each |
|||
element are stored in the array \verb|ia|, column indices are stored in |
|||
the array \verb|ja|, and numerical values of corresponding elements are |
|||
stored in the array \verb|ar|. Then the statement \verb|s30| calls |
|||
the routine \verb|glp_load_matrix|, which loads information from these |
|||
three arrays into the problem object. |
|||
|
|||
Now all data have been entered into the problem object, and therefore |
|||
the statement \verb|s31| calls the routine \verb|glp_simplex|, which is |
|||
a driver to the simplex method, in order to solve the LP problem. This |
|||
routine finds an optimal solution and stores all relevant information |
|||
back into the problem object. |
|||
|
|||
The statement \verb|s32| obtains a computed value of the objective |
|||
function, and the statements \verb|s33|---\verb|s35| obtain computed |
|||
values of structural variables (columns), which correspond to the |
|||
optimal basic solution found by the solver. |
|||
|
|||
The statement \verb|s36| writes the optimal solution to the standard |
|||
output. The printout may look like follows: |
|||
|
|||
\begin{footnotesize} |
|||
\begin{verbatim} |
|||
* 0: objval = 0.000000000e+00 infeas = 0.000000000e+00 (0) |
|||
* 2: objval = 7.333333333e+02 infeas = 0.000000000e+00 (0) |
|||
OPTIMAL SOLUTION FOUND |
|||
|
|||
z = 733.333; x1 = 33.3333; x2 = 66.6667; x3 = 0 |
|||
\end{verbatim} |
|||
\end{footnotesize} |
|||
|
|||
Finally, the statement \verb|s37| calls the routine |
|||
\verb|glp_delete_prob|, which frees all the memory allocated to the |
|||
problem object. |
|||
|
|||
\subsection{Compiling} |
|||
|
|||
The GLPK package has the only header file \verb|glpk.h|, which should |
|||
be available on compiling a C (or C++) program using GLPK API routines. |
|||
|
|||
If the header file is installed in the default location |
|||
\verb|/usr/local/include|, the following typical command may be used to |
|||
compile, say, the example C program described above with the GNU C |
|||
compiler: |
|||
|
|||
\begin{verbatim} |
|||
$ gcc -c sample.c |
|||
\end{verbatim} |
|||
|
|||
If \verb|glpk.h| is not in the default location, the corresponding |
|||
directory containing it should be made known to the C compiler through |
|||
\verb|-I| option, for example: |
|||
|
|||
\begin{verbatim} |
|||
$ gcc -I/foo/bar/glpk-4.15/include -c sample.c |
|||
\end{verbatim} |
|||
|
|||
In any case the compilation results in an object file \verb|sample.o|. |
|||
|
|||
\subsection{Linking} |
|||
|
|||
The GLPK library is a single file \verb|libglpk.a|. (On systems which |
|||
support shared libraries there may be also a shared version of the |
|||
library \verb|libglpk.so|.) |
|||
|
|||
If the library is installed in the default |
|||
location \verb|/usr/local/lib|, the following typical command may be |
|||
used to link, say, the example C program described above against with |
|||
the library: |
|||
|
|||
\begin{verbatim} |
|||
$ gcc sample.o -lglpk -lm |
|||
\end{verbatim} |
|||
|
|||
If the GLPK library is not in the default location, the corresponding |
|||
directory containing it should be made known to the linker through |
|||
\verb|-L| option, for example: |
|||
|
|||
\begin{verbatim} |
|||
$ gcc -L/foo/bar/glpk-4.15 sample.o -lglpk -lm |
|||
\end{verbatim} |
|||
|
|||
Depending on configuration of the package linking against with the GLPK |
|||
library may require optional libraries, in which case these libraries |
|||
should be also made known to the linker, for example: |
|||
|
|||
\begin{verbatim} |
|||
$ gcc sample.o -lglpk -lgmp -lm |
|||
\end{verbatim} |
|||
|
|||
For more details about configuration options of the GLPK package see |
|||
Appendix \ref{install}, page \pageref{install}. |
|||
|
|||
%* eof *% |
3470
resources/3rdparty/glpk-4.57/doc/glpk02.tex
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
1572
resources/3rdparty/glpk-4.57/doc/glpk03.tex
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
1387
resources/3rdparty/glpk-4.57/doc/glpk04.tex
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
1090
resources/3rdparty/glpk-4.57/doc/glpk05.tex
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
@ -0,0 +1,462 @@ |
|||
%* glpk06.tex *% |
|||
|
|||
\chapter{Miscellaneous API Routines} |
|||
|
|||
\section{GLPK environment routines} |
|||
|
|||
\subsection{glp\_init\_env --- initialize GLPK environment} |
|||
|
|||
\synopsis |
|||
|
|||
\begin{verbatim} |
|||
int glp_init_env(void); |
|||
\end{verbatim} |
|||
|
|||
\description |
|||
|
|||
The routine \verb|glp_init_env| initializes the GLPK environment. |
|||
Normally the application program does not need to call this routine, |
|||
because it is called automatically on the first call to any API |
|||
routine. |
|||
|
|||
\returns |
|||
|
|||
\begin{retlist} |
|||
0 & initialization successful;\\ |
|||
1 & environment is already initialized;\\ |
|||
2 & initialization failed (insufficient memory);\\ |
|||
3 & initialization failed (unsupported programming model).\\ |
|||
\end{retlist} |
|||
|
|||
\subsection{glp\_version --- determine library version} |
|||
|
|||
\synopsis |
|||
|
|||
\begin{verbatim} |
|||
const char *glp_version(void); |
|||
\end{verbatim} |
|||
|
|||
\returns |
|||
|
|||
The routine \verb|glp_version| returns a pointer to a null-terminated |
|||
character string, which specifies the version of the GLPK library in |
|||
the form \verb|"X.Y"|, where `\verb|X|' is the major version number, |
|||
and `\verb|Y|' is the minor version number, for example, \verb|"4.16"|. |
|||
|
|||
\newpage |
|||
|
|||
\subsection{glp\_free\_env --- free GLPK environment} |
|||
|
|||
\synopsis |
|||
|
|||
\begin{verbatim} |
|||
int glp_free_env(void); |
|||
\end{verbatim} |
|||
|
|||
\description |
|||
|
|||
The routine \verb|glp_free_env| frees all resources used by GLPK |
|||
routines (memory blocks, etc.) which are currently still in use. |
|||
|
|||
Normally the application program does not need to call this routine, |
|||
because GLPK routines always free all unused resources. However, if |
|||
the application program even has deleted all problem objects, there |
|||
will be several memory blocks still allocated for the internal library |
|||
needs. For some reasons the application program may want GLPK to free |
|||
this memory, in which case it should call \verb|glp_free_env|. |
|||
|
|||
Note that a call to \verb|glp_free_env| invalidates all problem objects |
|||
which still exist. |
|||
|
|||
\returns |
|||
|
|||
\begin{retlist} |
|||
0 & termination successful;\\ |
|||
1 & environment is inactive (was not initialized).\\ |
|||
\end{retlist} |
|||
|
|||
\subsection{glp\_printf --- write formatted output to terminal} |
|||
|
|||
\synopsis |
|||
|
|||
\begin{verbatim} |
|||
void glp_printf(const char *fmt, ...); |
|||
\end{verbatim} |
|||
|
|||
\description |
|||
|
|||
The routine \verb|glp_printf| uses the format control string |
|||
\verb|fmt| to format its parameters and writes the formatted output to |
|||
the terminal. |
|||
|
|||
This routine is a replacement of the standard C function |
|||
\verb|printf| and used by all GLPK routines to perform terminal |
|||
output. The application program may use \verb|glp_printf| for the same |
|||
purpose that allows controlling its terminal output with the routines |
|||
\verb|glp_term_out| and \verb|glp_term_hook|. |
|||
|
|||
\subsection{glp\_vprintf --- write formatted output to terminal} |
|||
|
|||
\synopsis |
|||
|
|||
\begin{verbatim} |
|||
void glp_vprintf(const char *fmt, va_list arg); |
|||
\end{verbatim} |
|||
|
|||
\description |
|||
|
|||
The routine \verb|glp_vprintf| uses the format control string |
|||
\verb|fmt| to format its parameters specified by the list \verb|arg| |
|||
and writes the formatted output to the terminal. |
|||
|
|||
This routine is a replacement of the standard C function |
|||
\verb|vprintf| and used by all GLPK routines to perform terminal |
|||
output. The application program may use \verb|glp_vprintf| for the same |
|||
purpose that allows controlling its terminal output with the routines |
|||
\verb|glp_term_out| and \verb|glp_term_hook|. |
|||
|
|||
\newpage |
|||
|
|||
\subsection{glp\_term\_out --- enable/disable terminal output} |
|||
|
|||
\synopsis |
|||
|
|||
\begin{verbatim} |
|||
int glp_term_out(int flag); |
|||
\end{verbatim} |
|||
|
|||
\description |
|||
|
|||
Depending on the parameter flag the routine \verb|glp_term_out| enables |
|||
or disables terminal output performed by glpk routines: |
|||
|
|||
\verb|GLP_ON | --- enable terminal output; |
|||
|
|||
\verb|GLP_OFF| --- disable terminal output. |
|||
|
|||
\returns |
|||
|
|||
The routine \verb|glp_term_out| returns the previous value of the |
|||
terminal output flag. |
|||
|
|||
\subsection{glp\_term\_hook --- intercept terminal output} |
|||
|
|||
\synopsis |
|||
|
|||
\begin{verbatim} |
|||
void glp_term_hook(int (*func)(void *info, const char *s), void *info); |
|||
\end{verbatim} |
|||
|
|||
\description |
|||
|
|||
The routine \verb|glp_term_hook| installs the user-defined hook routine |
|||
to intercept all terminal output performed by GLPK routines. |
|||
|
|||
%This feature can be used to redirect the terminal output to other |
|||
%destination, for example, to a file or a text window. |
|||
|
|||
The parameter {\it func} specifies the user-defined hook routine. It is |
|||
called from an internal printing routine, which passes to it two |
|||
parameters: {\it info} and {\it s}. The parameter {\it info} is a |
|||
transit pointer specified in corresponding call to the routine |
|||
\verb|glp_term_hook|; it may be used to pass some additional information |
|||
to the hook routine. The parameter {\it s} is a pointer to the null |
|||
terminated character string, which is intended to be written to the |
|||
terminal. If the hook routine returns zero, the printing routine writes |
|||
the string {\it s} to the terminal in a usual way; otherwise, if the |
|||
hook routine returns non-zero, no terminal output is performed. |
|||
|
|||
To uninstall the hook routine both parameters {\it func} and {\it info} |
|||
should be specified as \verb|NULL|. |
|||
|
|||
\para{Example} |
|||
|
|||
\begin{footnotesize} |
|||
\begin{verbatim} |
|||
static int hook(void *info, const char *s) |
|||
{ FILE *foo = info; |
|||
fputs(s, foo); |
|||
return 1; |
|||
} |
|||
|
|||
int main(void) |
|||
{ FILE *foo; |
|||
. . . |
|||
glp_term_hook(hook, foo); /* redirect terminal output */ |
|||
. . . |
|||
glp_term_hook(NULL, NULL); /* resume terminal output */ |
|||
. . . |
|||
} |
|||
\end{verbatim} |
|||
\end{footnotesize} |
|||
|
|||
\newpage |
|||
|
|||
\subsection{glp\_open\_tee --- start copying terminal output} |
|||
|
|||
\synopsis |
|||
|
|||
\begin{verbatim} |
|||
int glp_open_tee(const char *fname); |
|||
\end{verbatim} |
|||
|
|||
\description |
|||
|
|||
The routine \verb|glp_open_tee| starts copying all the terminal output |
|||
to an output text file, whose name is specified by the character string |
|||
\verb|fname|. |
|||
|
|||
\returns |
|||
|
|||
\begin{retlist} |
|||
0 & operation successful;\\ |
|||
1 & copying terminal output is already active;\\ |
|||
2 & unable to create output file.\\ |
|||
\end{retlist} |
|||
|
|||
\subsection{glp\_close\_tee --- stop copying terminal output} |
|||
|
|||
\synopsis |
|||
|
|||
\begin{verbatim} |
|||
int glp_close_tee(void); |
|||
\end{verbatim} |
|||
|
|||
\description |
|||
|
|||
The routine \verb|glp_close_tee| stops copying the terminal output to |
|||
the output text file previously open by the routine \verb|glp_open_tee| |
|||
closing that file. |
|||
|
|||
\returns |
|||
|
|||
\begin{retlist} |
|||
0 & operation successful;\\ |
|||
1 & copying terminal output was not started.\\ |
|||
\end{retlist} |
|||
|
|||
\subsection{glp\_error --- display error message and terminate |
|||
execution} |
|||
|
|||
\synopsis |
|||
|
|||
\begin{verbatim} |
|||
void glp_error(const char *fmt, ...); |
|||
\end{verbatim} |
|||
|
|||
\description |
|||
|
|||
The routine \verb|glp_error| (implemented as a macro) formats its |
|||
parameters using the format control string \verb|fmt|, writes the |
|||
formatted message to the terminal, and then abnormally terminates the |
|||
program. |
|||
|
|||
\newpage |
|||
|
|||
\subsection{glp\_at\_error --- check for error state} |
|||
|
|||
\synopsis |
|||
|
|||
\begin{verbatim} |
|||
int glp_at_error(void); |
|||
\end{verbatim} |
|||
|
|||
\description |
|||
|
|||
The routine \verb|glp_at_error| checks if the GLPK environment is at |
|||
error state, i.~e.~if the call to the routine is (indirectly) made from |
|||
the \verb|glp_error| routine via an user-defined hook routine. |
|||
|
|||
This routine can be used, for example, by a custom output handler |
|||
(installed with the routine \verb|glp_term_hook|) to determine whether |
|||
or not the message to be displayed is an error message. |
|||
|
|||
\returns |
|||
|
|||
If the GLPK environment is at error state, the routine returns |
|||
non-zero, otherwise zero. |
|||
|
|||
\subsection{glp\_assert --- check logical condition} |
|||
|
|||
\synopsis |
|||
|
|||
\begin{verbatim} |
|||
void glp_assert(int expr); |
|||
\end{verbatim} |
|||
|
|||
\description |
|||
|
|||
The routine \verb|glp_assert| (implemented as a macro) checks |
|||
a logical condition specified by the expression \verb|expr|. If the |
|||
condition is true (non-zero), the routine does nothing; otherwise, if |
|||
the condition is false (zero), the routine prints an error message and |
|||
abnormally terminates the program. |
|||
|
|||
This routine is a replacement of the standard C function \verb|assert| |
|||
and used by all GLPK routines to check program logic. The application |
|||
program may use \verb|glp_assert| for the same purpose. |
|||
|
|||
\subsection{glp\_error\_hook --- install hook to intercept abnormal |
|||
termination} |
|||
|
|||
\synopsis |
|||
|
|||
\begin{verbatim} |
|||
void glp_error_hook(void (*func)(void *info), void *info); |
|||
\end{verbatim} |
|||
|
|||
\description |
|||
|
|||
The routine \verb|glp_error_hook| installs a user-defined hook routine |
|||
to intercept abnormal termination. |
|||
|
|||
The parameter \verb|func| specifies the user-defined hook routine. It |
|||
is called from the routine \verb|glp_error| before the latter calls the |
|||
abort function to abnormally terminate the application program because |
|||
of fatal error. The parameter \verb|info| is a transit pointer, |
|||
specified in the corresponding call to the routine |
|||
\verb|glp_error_hook|; it may be used to pass some information to the |
|||
hook routine. |
|||
|
|||
To uninstall the hook routine the parameters \verb|func| and \verb|info| |
|||
should be specified as \verb|NULL|. |
|||
|
|||
If the hook routine returns, the application program is abnormally |
|||
terminated. To prevent abnormal termnation the hook routine may perform |
|||
a global jump using the standard function \verb|longjmp|, in which case |
|||
the application program {\it must} call the routine \verb|glp_free_env|. |
|||
|
|||
\subsection{glp\_alloc --- allocate memory block} |
|||
|
|||
\synopsis |
|||
|
|||
\begin{verbatim} |
|||
void *glp_alloc(int n, int size); |
|||
\end{verbatim} |
|||
|
|||
\description |
|||
|
|||
The routine \verb|glp_alloc| dynamically allocates a memory block of |
|||
\verb|n|$\times$\verb|size| bytes long. Note that: |
|||
|
|||
1) the parameters \verb|n| and \verb|size| must be positive; |
|||
|
|||
2) having been allocated the memory block contains arbitrary data, that |
|||
is, it is {\it not} initialized by binary zeros; |
|||
|
|||
3) if the block cannot be allocated due to insufficient memory, the |
|||
routine prints an error message and abnormally terminates the program. |
|||
|
|||
This routine is a replacement of the standard C function \verb|malloc| |
|||
and used by GLPK routines for dynamic memory allocation. The |
|||
application program may use \verb|glp_alloc| for the same purpose. |
|||
|
|||
\returns |
|||
|
|||
The routine \verb|glp_alloc| returns a pointer to the memory block |
|||
allocated. To free this block the routine \verb|glp_free| (not the |
|||
standard C function \verb|free|!) should be used. |
|||
|
|||
\subsection{glp\_realloc --- reallocate memory block} |
|||
|
|||
\synopsis |
|||
|
|||
\begin{verbatim} |
|||
void *glp_realloc(void *ptr, int n, int size); |
|||
\end{verbatim} |
|||
|
|||
\description |
|||
|
|||
The routine \verb|glp_realloc| dynamically reallocates a memory block |
|||
pointed to by \verb|ptr|, which was previously allocated by the routine |
|||
\verb|glp_alloc| or reallocated by this routine. Note that the pointer |
|||
\verb|ptr| must be valid and must not be \verb|NULL|. The new size of |
|||
the memory block is \verb|n|$\times$\verb|size| bytes long. Note that: |
|||
|
|||
1) both parameters \verb|n| and \verb|size| must be positive; |
|||
|
|||
2) if the block cannot be reallocated due to insufficient memory, the |
|||
routine prints an error message and abnormally terminates the program. |
|||
|
|||
This routine is a replacement of the standard C function \verb|realloc| |
|||
and used by GLPK routines for dynamic memory allocation. The |
|||
application program may use \verb|glp_realloc| for the same purpose. |
|||
|
|||
\returns |
|||
|
|||
The routine \verb|glp_realloc| returns a pointer to the memory block |
|||
reallocated. To free this block the routine \verb|glp_free| (not the |
|||
standard C function \verb|free|!) should be used. |
|||
|
|||
\subsection{glp\_free --- free memory block} |
|||
|
|||
\synopsis |
|||
|
|||
\begin{verbatim} |
|||
void glp_free(void *ptr); |
|||
\end{verbatim} |
|||
|
|||
\description |
|||
|
|||
The routine \verb|glp_free| deallocates a memory block pointed to by |
|||
\verb|ptr|, which was previously allocated by the routine |
|||
\verb|glp_malloc| or reallocated by the routine \verb|glp_realloc|. |
|||
Note that the pointer \verb|ptr| must be valid and must not be |
|||
\verb|NULL|. |
|||
|
|||
This routine is a replacement of the standard C function \verb|free| |
|||
and used by GLPK routines for dynamic memory allocation. The |
|||
application program may use \verb|glp_free| for the same purpose. |
|||
|
|||
\subsection{glp\_mem\_usage --- get memory usage information} |
|||
|
|||
\synopsis |
|||
|
|||
\begin{verbatim} |
|||
void glp_mem_usage(int *count, int *cpeak, size_t *total, size_t *tpeak); |
|||
\end{verbatim} |
|||
|
|||
\description |
|||
|
|||
The routine \verb|glp_mem_usage| reports some information about |
|||
utilization of the memory by the routines \verb|glp_malloc|, |
|||
\verb|glp_calloc|, and \verb|glp_free|. Information is stored to |
|||
locations specified by corresponding parameters (see below). Any |
|||
parameter can be specified as \verb|NULL|, in which case corresponding |
|||
information is not stored. |
|||
|
|||
\verb|*count| is the number of currently allocated memory blocks. |
|||
|
|||
\verb|*cpeak| is the peak value of \verb|*count| reached since the |
|||
initialization of the GLPK library environment. |
|||
|
|||
\verb|*total| is the total amount, in bytes, of currently allocated |
|||
memory blocks. |
|||
|
|||
\verb|*tpeak| is the peak value of \verb|*total| reached since the |
|||
initialization of the GLPK library envirionment. |
|||
|
|||
\para{Example} |
|||
|
|||
\begin{footnotesize} |
|||
\begin{verbatim} |
|||
glp_mem_usage(&count, NULL, NULL, NULL); |
|||
printf("%d memory block(s) are still allocated\n", count); |
|||
\end{verbatim} |
|||
\end{footnotesize} |
|||
|
|||
\subsection{glp\_mem\_limit --- set memory usage limit} |
|||
|
|||
\synopsis |
|||
|
|||
\begin{verbatim} |
|||
void glp_mem_limit(int limit); |
|||
\end{verbatim} |
|||
|
|||
\description |
|||
|
|||
The routine \verb|glp_mem_limit| limits the amount of memory available |
|||
for dynamic allocation (with the routines \verb|glp_malloc| and |
|||
\verb|glp_calloc|) to \verb|limit| megabytes. |
|||
|
|||
%* eof *% |
@ -0,0 +1,258 @@ |
|||
%* glpk07.tex *% |
|||
|
|||
\chapter{Installing GLPK on Your Computer} |
|||
\label{install} |
|||
|
|||
\section{Downloading the distribution tarball} |
|||
|
|||
The distribution tarball of the most recent version of the GLPK |
|||
package can be found on \url{http://ftp.gnu.org/gnu/glpk/} [via http] |
|||
and \url{ftp://ftp.gnu.org/gnu/glpk/} [via FTP]. It can also be found |
|||
on one of the FTP mirrors; see \url{http://www.gnu.org/prep/ftp.html}. |
|||
Please use a mirror if possible. |
|||
|
|||
To make sure that the GLPK distribution tarball you have downloaded is |
|||
intact you need to download the corresponding `\verb|.sig|' file and |
|||
run a command like this: |
|||
|
|||
\begin{verbatim} |
|||
gpg --verify glpk-4.38.tar.gz.sig |
|||
\end{verbatim} |
|||
|
|||
\noindent |
|||
If that command fails because you do not have the required public key, |
|||
run the following command to import it: |
|||
|
|||
\begin{verbatim} |
|||
gpg --keyserver keys.gnupg.net --recv-keys 5981E818 |
|||
\end{verbatim} |
|||
|
|||
\noindent |
|||
and then re-run the previous command. |
|||
|
|||
\section{Unpacking the distribution tarball} |
|||
|
|||
The GLPK package (like all other GNU software) is distributed in the |
|||
form of packed archive. This is one file named \verb|glpk-X.Y.tar.gz|, |
|||
where {\it X} is the major version number and {\it Y} is the minor |
|||
version number. |
|||
|
|||
In order to prepare the distribution for installation you need to copy |
|||
the GLPK distribution file to a working subdirectory and then unpack |
|||
and unarchive the distribution file with the following command: |
|||
|
|||
\begin{verbatim} |
|||
tar zx < glpk-X.Y.tar |
|||
\end{verbatim} |
|||
|
|||
\newpage |
|||
|
|||
\section{Configuring the package} |
|||
|
|||
After unpacking and unarchiving the GLPK distribution you should |
|||
configure the package,\linebreak i.e. automatically tune it for your |
|||
platform. |
|||
|
|||
Normally, you should just \verb|cd| to the subdirectory \verb|glpk-X.Y| |
|||
and run the configure script, e.g. |
|||
|
|||
\begin{verbatim} |
|||
./configure |
|||
\end{verbatim} |
|||
|
|||
The `\verb|configure|' shell script attempts to guess correct values |
|||
for various system-dependent variables used during compilation. It uses |
|||
those values to create a `\verb|Makefile|' in each directory of the |
|||
package. It also creates file `\verb|config.h|' containing |
|||
platform-dependent definitions. Finally, it creates a shell script |
|||
`\verb|config.status|' that you can run in the future to recreate the |
|||
current configuration, a file `\verb|config.cache|' that saves the |
|||
results of its tests to speed up reconfiguring, and a file |
|||
`\verb|config.log|' containing compiler output (useful mainly for |
|||
debugging `\verb|configure|'). |
|||
|
|||
Running `\verb|configure|' takes about a minute. While it is running, |
|||
it displays some informational messages that tell you what it |
|||
is doing. If you don't want to see these messages, run |
|||
`\verb|configure|' with its standard output redirected to |
|||
`\verb|dev/null|'; for example, `\verb|./configure > /dev/null|'. |
|||
|
|||
By default both static and shared versions of the GLPK library will be |
|||
compiled. Compilation of the shared librariy can be turned off by |
|||
specifying the `\verb|--disable-shared|' option to `\verb|configure|': |
|||
|
|||
\begin{verbatim} |
|||
./configure --disable-shared |
|||
\end{verbatim} |
|||
|
|||
\noindent |
|||
If you encounter problems building the library try using the above |
|||
option, because some platforms do not support shared libraries. |
|||
|
|||
The GLPK package has some optional features listed below. By default |
|||
all these features are disabled. To enable a feature the corresponding |
|||
option should be passed to the configure script. |
|||
|
|||
\verb|--with-gmp | Enable using the GNU MP bignum library |
|||
|
|||
This feature allows the exact simplex solver to use the GNU MP bignum |
|||
library. If it is disabled, the exact simplex solver uses the GLPK |
|||
bignum module, which provides the same functionality as GNU MP, however, |
|||
it is much less efficient. |
|||
|
|||
For details about the GNU MP bignum library see its web page at |
|||
\url{http://gmplib.org/}. |
|||
|
|||
\verb|--enable-dl | The same as `\verb|--enable-dl=ltdl|' |
|||
|
|||
\verb|--enable-dl=ltdl | Enable shared library support (GNU) |
|||
|
|||
\verb|--enable-dl=dlfcn | Enable shared library support (POSIX) |
|||
|
|||
Currently this feature is only needed to provide dynamic linking to |
|||
ODBC and MySQL shared libraries (see below). |
|||
|
|||
For details about the GNU shared library support see the manual at |
|||
\url{http://www.gnu.org/software/libtool/manual/}. |
|||
|
|||
\verb|--enable-odbc | |
|||
Enable using ODBC table driver (\verb|libiodbc|) |
|||
|
|||
\verb|--enable-odbc=unix | |
|||
Enable using ODBC table driver (\verb|libodbc|) |
|||
|
|||
This feature allows transmitting data between MathProg model objects |
|||
and relational databases accessed through ODBC. |
|||
|
|||
For more details about this feature see the supplement ``Using Data |
|||
Tables in the GNU MathProg Modeling Language'' (\verb|doc/tables.pdf|). |
|||
|
|||
\verb|--enable-mysql | |
|||
Enable using MySQL table driver (\verb|libmysql|) |
|||
|
|||
This feature allows transmitting data between MathProg model objects |
|||
and MySQL relational databases. |
|||
|
|||
For more details about this feature see the supplement ``Using Data |
|||
Tables in the GNU MathProg Modeling Language'' (\verb|doc/tables.pdf|). |
|||
|
|||
\section{Compiling the package} |
|||
|
|||
Normally, you can compile (build) the package by typing the command: |
|||
|
|||
\begin{verbatim} |
|||
make |
|||
\end{verbatim} |
|||
|
|||
\noindent |
|||
It reads `\verb|Makefile|' generated by `\verb|configure|' and performs |
|||
all necessary jobs. |
|||
|
|||
If you want, you can override the `\verb|make|' variables \verb|CFLAGS| |
|||
and \verb|LDFLAGS| like this: |
|||
|
|||
\begin{verbatim} |
|||
make CFLAGS=-O2 LDFLAGS=-s |
|||
\end{verbatim} |
|||
|
|||
To compile the package in a different directory from the one containing |
|||
the source code, you must use a version of `\verb|make|' that supports |
|||
`\verb|VPATH|' variable, such as GNU `\verb|make|'. `\verb|cd|' to the |
|||
directory where you want the object files and executables to go and run |
|||
the `\verb|configure|' script. `\verb|configure|' automatically checks |
|||
for the source code in the directory that `\verb|configure|' is in and |
|||
in `\verb|..|'. If for some reason `\verb|configure|' is not in the |
|||
source code directory that you are configuring, then it will report |
|||
that it can't find the source code. In that case, run `\verb|configure|' |
|||
with the option `\verb|--srcdir=DIR|', where \verb|DIR| is the |
|||
directory that contains the source code. |
|||
|
|||
Some systems require unusual options for compilation or linking that |
|||
the `\verb|configure|' script does not know about. You can give |
|||
`\verb|configure|' initial values for variables by setting them in the |
|||
environment. Using a Bourne-compatible shell, you can do that on the |
|||
command line like this: |
|||
|
|||
\begin{verbatim} |
|||
CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure |
|||
\end{verbatim} |
|||
|
|||
\noindent |
|||
Or on systems that have the `\verb|env|' program, you can do it like |
|||
this: |
|||
|
|||
\begin{verbatim} |
|||
env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure |
|||
\end{verbatim} |
|||
|
|||
Here are the `\verb|make|' variables that you might want to override |
|||
with environment variables when running `\verb|configure|'. |
|||
|
|||
For these variables, any value given in the environment overrides the |
|||
value that `\verb|configure|' would choose: |
|||
|
|||
\verb|CC | C compiler program. The default is `\verb|cc|'. |
|||
|
|||
\verb|INSTALL | Program used to install files. The default value is |
|||
`\verb|install|' if you have it,\\ |
|||
\verb| | otherwise `\verb|cp|'. |
|||
|
|||
For these variables, any value given in the environment is added to the |
|||
value that `\verb|configure|' chooses: |
|||
|
|||
\verb|DEFS | Configuration options, in the form |
|||
`\verb|-Dfoo -Dbar| \dots'. |
|||
|
|||
\verb|LIBS | Libraries to link with, in the form |
|||
`\verb|-lfoo -lbar| \dots'. |
|||
|
|||
\section{Checking the package} |
|||
|
|||
To check the package, i.e. to run some tests included in the package, |
|||
you can use the following command: |
|||
|
|||
\begin{verbatim} |
|||
make check |
|||
\end{verbatim} |
|||
|
|||
\section{Installing the package} |
|||
|
|||
Normally, to install the GLPK package you should type the following |
|||
command: |
|||
|
|||
\begin{verbatim} |
|||
make install |
|||
\end{verbatim} |
|||
|
|||
\noindent |
|||
By default, `\verb|make install|' will install the package's files in |
|||
`\verb|usr/local/bin|', `\verb|usr/local/lib|', etc. You can specify an |
|||
installation prefix other than `\verb|/usr/local|' by giving |
|||
`\verb|configure|' the option `\verb|--prefix=PATH|'. Alternately, you |
|||
can do so by consistently giving a value for the `\verb|prefix|' |
|||
variable when you run `\verb|make|', e.g. |
|||
|
|||
\begin{verbatim} |
|||
make prefix=/usr/gnu |
|||
make prefix=/usr/gnu install |
|||
\end{verbatim} |
|||
|
|||
After installing you can remove the program binaries and object files |
|||
from the source directory by typing `\verb|make clean|'. To remove all |
|||
files that `\verb|configure|' created (`\verb|Makefile|', |
|||
`\verb|config.status|', etc.), just type `\verb|make distclean|'. |
|||
|
|||
The file `\verb|configure.ac|' is used to create `\verb|configure|' by |
|||
a program called `\verb|autoconf|'. You only need it if you want to |
|||
remake `\verb|configure|' using a newer version of `\verb|autoconf|'. |
|||
|
|||
\section{Uninstalling the package} |
|||
|
|||
To uninstall the GLPK package, i.e. to remove all the package's files |
|||
from the system places, you can use the following command: |
|||
|
|||
\begin{verbatim} |
|||
make uninstall |
|||
\end{verbatim} |
|||
|
|||
%* eof *% |
@ -0,0 +1,738 @@ |
|||
%* glpk08.tex *% |
|||
|
|||
\chapter{MPS Format} |
|||
\label{champs} |
|||
|
|||
\section{Fixed MPS Format} |
|||
\label{secmps} |
|||
|
|||
The MPS format\footnote{The MPS format was developed in 1960's by IBM |
|||
as input format for their mathematical programming system MPS/360. |
|||
Today the MPS format is a most widely used format understood by most |
|||
mathematical programming packages. This appendix describes only the |
|||
features of the MPS format, which are implemented in the GLPK package.} |
|||
is intended for coding LP/MIP problem data. This format assumes the |
|||
formulation of LP/MIP problem (1.1)---(1.3) (see Section \ref{seclp}, |
|||
page \pageref{seclp}). |
|||
|
|||
{\it MPS file} is a text file, which contains two types of |
|||
cards\footnote{In 1960's MPS file was a deck of 80-column punched |
|||
cards, so the author decided to keep the word ``card'', which may be |
|||
understood as ``line of text file''.}: indicator cards and data cards. |
|||
|
|||
Indicator cards determine a kind of succeeding data. Each indicator |
|||
card has one word in uppercase letters beginning in column 1. |
|||
|
|||
Data cards contain problem data. Each data card is divided into six |
|||
fixed fields: |
|||
|
|||
\begin{center} |
|||
\begin{tabular}{lcccccc} |
|||
& Field 1 & Field 2 & Field 3 & Field 4 & Field 5 & Feld 6 \\ |
|||
\hline |
|||
Columns & 2---3 & 5---12 & 15---22 & 25---36 & 40---47 & 50---61 \\ |
|||
Contents & Code & Name & Name & Number & Name & Number \\ |
|||
\end{tabular} |
|||
\end{center} |
|||
|
|||
On a particular data card some fields may be optional. |
|||
|
|||
Names are used to identify rows, columns, and some vectors (see below). |
|||
|
|||
Aligning the indicator code in the field 1 to the left margin is |
|||
optional. |
|||
|
|||
All names specified in the fields 2, 3, and 5 should contain from 1 up |
|||
to 8 arbitrary characters (except control characters). If a name is |
|||
placed in the field 3 or 5, its first character should not be the dollar |
|||
sign `\verb|$|'. If a name contains spaces, the spaces are ignored. |
|||
|
|||
All numerical values in the fields 4 and 6 should be coded in the form |
|||
$sxx$\verb|E|$syy$, where $s$ is the plus `\verb|+|' or the minus |
|||
`\verb|-|' sign, $xx$ is a real number with optional decimal point, |
|||
$yy$ is an integer decimal exponent. Any number should contain up to 12 |
|||
characters. If the sign $s$ is omitted, the plus sign is assumed. The |
|||
exponent part is optional. If a number contains spaces, the spaces are |
|||
ignored. |
|||
|
|||
\newpage |
|||
|
|||
If a card has the asterisk `\verb|*|' in the column 1, this card is |
|||
considered as a comment and ignored. Besides, if the first character in |
|||
the field 3 or 5 is the dollar sign `\verb|$|', all characters from the |
|||
dollar sign to the end of card are considered as a comment and ignored. |
|||
|
|||
MPS file should contain cards in the following order: |
|||
|
|||
\vspace*{-8pt} |
|||
|
|||
\begin{itemize} |
|||
\item NAME indicator card; |
|||
|
|||
\item ROWS indicator card; |
|||
|
|||
\item data cards specifying rows (constraints); |
|||
|
|||
\item COLUMNS indicator card; |
|||
|
|||
\item data cards specifying columns (structural variables) and |
|||
constraint coefficients; |
|||
|
|||
\item RHS indicator card; |
|||
|
|||
\item data cards specifying right-hand sides of constraints; |
|||
|
|||
\item RANGES indicator card; |
|||
|
|||
\item data cards specifying ranges for double-bounded constraints; |
|||
|
|||
\item BOUNDS indicator card; |
|||
|
|||
\item data cards specifying types and bounds of structural |
|||
variables; |
|||
|
|||
\item ENDATA indicator card. |
|||
\end{itemize} |
|||
|
|||
\vspace*{-8pt} |
|||
|
|||
{\it Section} is a group of cards consisting of an indicator card and |
|||
data cards succeeding this indicator card. For example, the ROWS section |
|||
consists of the ROWS indicator card and data cards specifying rows. |
|||
|
|||
The sections RHS, RANGES, and BOUNDS are optional and may be omitted. |
|||
|
|||
\section{Free MPS Format} |
|||
|
|||
{\it Free MPS format} is an improved version of the standard (fixed) |
|||
MPS format described above.\footnote{This format was developed in the |
|||
beginning of 1990's by IBM as an alternative to the standard fixed MPS |
|||
format for Optimization Subroutine Library (OSL).} Note that all |
|||
changes in free MPS format concern only the coding of data while the |
|||
structure of data is the same for both fixed and free versions of the |
|||
MPS format. |
|||
|
|||
In free MPS format indicator and data records\footnote{{\it Record} in |
|||
free MPS format has the same meaning as {\it card} in fixed MPS format.} |
|||
may have arbitrary length not limited to 80 characters. Fields of data |
|||
records have no predefined positions, i.e. the fields may begin in any |
|||
position, except position 1, which must be blank, and must be separated |
|||
from each other by one or more blanks. However, the fields must appear |
|||
in the same order as in fixed MPS format. |
|||
|
|||
\newpage |
|||
|
|||
Symbolic names in fields 2, 3, and 5 may be longer than 8 |
|||
characters\footnote{GLPK allows symbolic names having up to 255 |
|||
characters.} and must not contain embedded blanks. |
|||
|
|||
Numeric values in fields 4 and 6 are limited to 12 characters and must |
|||
not contain embedded blanks. |
|||
|
|||
Only six fields on each data record are used. Any other fields are |
|||
ignored. |
|||
|
|||
If the first character of any field (not necessarily fields 3 and 5) |
|||
is the dollar sign (\$), all characters from the dollar sign to the end |
|||
of record are considered as a comment and ignored. |
|||
|
|||
\section{NAME indicator card} |
|||
|
|||
The NAME indicator card should be the first card in the MPS file |
|||
(except optional comment cards, which may precede the NAME card). This |
|||
card should contain the word \verb|NAME| in the columns 1---4 and the |
|||
problem name in the field 3. The problem name is optional and may be |
|||
omitted. |
|||
|
|||
\section{ROWS section} |
|||
\label{secrows} |
|||
|
|||
The ROWS section should start with the indicator card, which contains |
|||
the word \verb|ROWS| in the columns 1---4. |
|||
|
|||
Each data card in the ROWS section specifies one row (constraint) of |
|||
the problem. All these data cards have the following format. |
|||
|
|||
`\verb|N|' in the field 1 means that the row is free (unbounded): |
|||
$$-\infty < x_i = a_{i1}x_{m+1} + a_{i2}x_{m+2} + \dots + a_{in}x_{m+n} |
|||
< +\infty;$$ |
|||
|
|||
`\verb|L|' in the field 1 means that the row is of ``less than or equal |
|||
to'' type: |
|||
$$-\infty < x_i = a_{i1}x_{m+1} + a_{i2}x_{m+2} + \dots + a_{in}x_{m+n} |
|||
\leq b_i;$$ |
|||
|
|||
`\verb|G|' in the field 1 means that the row is of ``greater than or |
|||
equal to'' type: |
|||
$$b_i \leq x_i = a_{i1}x_{m+1} + a_{i2}x_{m+2} + \dots + a_{in}x_{m+n} |
|||
< +\infty;$$ |
|||
|
|||
`\verb|E|' in the field 1 means that the row is of ``equal to'' type: |
|||
$$x_i = a_{i1}x_{m+1} + a_{i2}x_{m+2} + \dots + a_{in}x_{m+n} \leq |
|||
b_i,$$ |
|||
where $b_i$ is a right-hand side. Note that each constraint has a |
|||
corresponding implictly defined auxiliary variable ($x_i$ above), whose |
|||
value is a value of the corresponding linear form, therefore row bounds |
|||
can be considered as bounds of such auxiliary variable. |
|||
|
|||
The filed 2 specifies a row name (which is considered as the name of |
|||
the corresponding auxiliary variable). |
|||
|
|||
\newpage |
|||
|
|||
The fields 3, 4, 5, and 6 are not used and should be empty. |
|||
|
|||
Numerical values of all non-zero right-hand sides $b_i$ should be |
|||
specified in the RHS section (see below). All double-bounded (ranged) |
|||
constraints should be specified in the RANGES section (see below). |
|||
|
|||
\section{COLUMNS section} |
|||
|
|||
The COLUMNS section should start with the indicator card, which |
|||
contains the word \verb|COLUMNS| in the columns 1---7. |
|||
|
|||
Each data card in the COLUMNS section specifies one or two constraint |
|||
coefficients $a_{ij}$ and also introduces names of columns, i.e. names |
|||
of structural variables. All these data cards have the following |
|||
format. |
|||
|
|||
The field 1 is not used and should be empty. |
|||
|
|||
The field 2 specifies a column name. If this field is empty, the column |
|||
name from the immediately preceeding data card is assumed. |
|||
|
|||
The field 3 specifies a row name defined in the ROWS section. |
|||
|
|||
The field 4 specifies a numerical value of the constraint coefficient |
|||
$a_{ij}$, which is placed in the corresponding row and column. |
|||
|
|||
The fields 5 and 6 are optional. If they are used, they should contain |
|||
a second pair ``row name---constraint coefficient'' for the same column. |
|||
|
|||
Elements of the constraint matrix (i.e. constraint coefficients) should |
|||
be enumerated in the column wise manner: all elements for the current |
|||
column should be specified before elements for the next column. However, |
|||
the order of rows in the COLUMNS section may differ from the order of |
|||
rows in the ROWS section. |
|||
|
|||
Constraint coefficients not specified in the COLUMNS section are |
|||
considered as zeros. Therefore zero coefficients may be omitted, |
|||
although it is allowed to explicitly specify them. |
|||
|
|||
\section{RHS section} |
|||
|
|||
The RHS section should start with the indicator card, which contains the |
|||
word \verb|RHS| in the columns 1---3. |
|||
|
|||
Each data card in the RHS section specifies one or two right-hand sides |
|||
$b_i$ (see Section \ref{secrows}, page \pageref{secrows}). All these |
|||
data cards have the following format. |
|||
|
|||
The field 1 is not used and should be empty. |
|||
|
|||
The field 2 specifies a name of the right-hand side (RHS) |
|||
vector\footnote{This feature allows the user to specify several RHS |
|||
vectors in the same MPS file. However, before solving the problem a |
|||
particular RHS vector should be chosen.}. If this field is empty, the |
|||
RHS vector name from the immediately preceeding data card is assumed. |
|||
|
|||
\newpage |
|||
|
|||
The field 3 specifies a row name defined in the ROWS section. |
|||
|
|||
The field 4 specifies a right-hand side $b_i$ for the row, whose name is |
|||
specified in the field 3. Depending on the row type $b_i$ is a lower |
|||
bound (for the row of \verb|G| type), an upper bound (for the row of |
|||
\verb|L| type), or a fixed value (for the row of \verb|E| |
|||
type).\footnote{If the row is of {\tt N} type, $b_i$ is considered as |
|||
a constant term of the corresponding linear form. Should note, however, |
|||
this convention is non-standard.} |
|||
|
|||
The fields 5 and 6 are optional. If they are used, they should contain |
|||
a second pair ``row name---right-hand side'' for the same RHS vector. |
|||
|
|||
All right-hand sides for the current RHS vector should be specified |
|||
before right-hand sides for the next RHS vector. However, the order of |
|||
rows in the RHS section may differ from the order of rows in the ROWS |
|||
section. |
|||
|
|||
Right-hand sides not specified in the RHS section are considered as |
|||
zeros. Therefore zero right-hand sides may be omitted, although it is |
|||
allowed to explicitly specify them. |
|||
|
|||
\section{RANGES section} |
|||
|
|||
The RANGES section should start with the indicator card, which contains |
|||
the word \verb|RANGES| in the columns 1---6. |
|||
|
|||
Each data card in the RANGES section specifies one or two ranges for |
|||
double-side constraints, i.e. for constraints that are of the types |
|||
\verb|L| and \verb|G| at the same time: |
|||
$$l_i \leq x_i = a_{i1}x_{m+1} + a_{i2}x_{m+2} + \dots + a_{in}x_{m+n} |
|||
\leq u_i,$$ |
|||
where $l_i$ is a lower bound, $u_i$ is an upper bound. All these data |
|||
cards have the following format. |
|||
|
|||
The field 1 is not used and should be empty. |
|||
|
|||
The field 2 specifies a name of the range vector\footnote{This feature |
|||
allows the user to specify several range vectors in the same MPS file. |
|||
However, before solving the problem a particular range vector should be |
|||
chosen.}. If this field is empty, the range vector name from the |
|||
immediately preceeding data card is assumed. |
|||
|
|||
The field 3 specifies a row name defined in the ROWS section. |
|||
|
|||
The field 4 specifies a range value $r_i$ (see the table below) for the |
|||
row, whose name is specified in the field 3. |
|||
|
|||
The fields 5 and 6 are optional. If they are used, they should contain |
|||
a second pair ``row name---range value'' for the same range vector. |
|||
|
|||
All range values for the current range vector should be specified before |
|||
range values for the next range vector. However, the order of rows in |
|||
the RANGES section may differ from the order of rows in the ROWS |
|||
section. |
|||
|
|||
For each double-side constraint specified in the RANGES section its |
|||
lower and upper bounds are determined as follows: |
|||
|
|||
\newpage |
|||
|
|||
\begin{center} |
|||
\begin{tabular}{cccc} |
|||
Row type & Sign of $r_i$ & Lower bound & Upper bound \\ |
|||
\hline |
|||
{\tt G} & $+$ or $-$ & $b_i$ & $b_i + |r_i|$ \\ |
|||
{\tt L} & $+$ or $-$ & $b_i - |r_i|$ & $b_i$ \\ |
|||
{\tt E} & $+$ & $b_i$ & $b_i + |r_i|$ \\ |
|||
{\tt E} & $-$ & $b_i - |r_i|$ & $b_i$ \\ |
|||
\end{tabular} |
|||
\end{center} |
|||
|
|||
\noindent |
|||
where $b_i$ is a right-hand side specified in the RHS section (if $b_i$ |
|||
is not specified, it is considered as zero), $r_i$ is a range value |
|||
specified in the RANGES section. |
|||
|
|||
\section{BOUNDS section} |
|||
\label{secbounds} |
|||
|
|||
The BOUNDS section should start with the indicator card, which contains |
|||
the word \verb|BOUNDS| in the columns 1---6. |
|||
|
|||
Each data card in the BOUNDS section specifies one (lower or upper) |
|||
bound for one structural variable (column). All these data cards have |
|||
the following format. |
|||
|
|||
The indicator in the field 1 specifies the bound type: |
|||
|
|||
\verb|LO| --- lower bound; |
|||
|
|||
\verb|UP| --- upper bound; |
|||
|
|||
\verb|FX| --- fixed variable (lower and upper bounds are equal); |
|||
|
|||
\verb|FR| --- free variable (no bounds); |
|||
|
|||
\verb|MI| --- no lower bound (lower bound is ``minus infinity''); |
|||
|
|||
\verb|PL| --- no upper bound (upper bound is ``plus infinity''). |
|||
|
|||
The field 2 specifies a name of the bound vector\footnote{This feature |
|||
allows the user to specify several bound vectors in the same MPS file. |
|||
However, before solving the problem a particular bound vector should be |
|||
chosen.}. If this field is empty, the bound vector name from the |
|||
immediately preceeding data card is assumed. |
|||
|
|||
The field 3 specifies a column name defined in the COLUMNS section. |
|||
|
|||
The field 4 specifies a bound value. If the bound type in the field 1 |
|||
differs from \verb|LO|, \verb|UP|, and \verb|FX|, the value in the field |
|||
4 is ignored and may be omitted. |
|||
|
|||
The fields 5 and 6 are not used and should be empty. |
|||
|
|||
All bound values for the current bound vector should be specified before |
|||
bound values for the next bound vector. However, the order of columns in |
|||
the BOUNDS section may differ from the order of columns in the COLUMNS |
|||
section. Specification of a lower bound should precede specification of |
|||
an upper bound for the same column (if both the lower and upper bounds |
|||
are explicitly specified). |
|||
|
|||
By default, all columns (structural variables) are non-negative, i.e. |
|||
have zero lower bound and no upper bound. Lower ($l_j$) and upper |
|||
($u_j$) bounds of some column (structural variable $x_j$) are set in the |
|||
following way, where $s_j$ is a corresponding bound value explicitly |
|||
specified in the BOUNDS section: |
|||
|
|||
\newpage |
|||
|
|||
\verb|LO| sets $l_j$ to $s_j$; |
|||
|
|||
\verb|UP| sets $u_j$ to $s_j$; |
|||
|
|||
\verb|FX| sets both $l_j$ and $u_j$ to $s_j$; |
|||
|
|||
\verb|FR| sets $l_j$ to $-\infty$ and $u_j$ to $+\infty$; |
|||
|
|||
\verb|MI| sets $l_j$ to $-\infty$; |
|||
|
|||
\verb|PL| sets $u_j$ to $+\infty$. |
|||
|
|||
\section{ENDATA indicator card} |
|||
|
|||
The ENDATA indicator card should be the last card of MPS file (except |
|||
optional comment cards, which may follow the ENDATA card). This card |
|||
should contain the word \verb|ENDATA| in the columns 1---6. |
|||
|
|||
\section{Specifying objective function} |
|||
|
|||
It is impossible to explicitly specify the objective function and |
|||
optimization direction in the MPS file. However, the following implicit |
|||
rule is used by default: the first row of \verb|N| type is considered |
|||
as a row of the objective function (i.e. the objective function is the |
|||
corresponding auxiliary variable), which should be {\it minimized}. |
|||
|
|||
GLPK also allows specifying a constant term of the objective function |
|||
as a right-hand side of the corresponding row in the RHS section. |
|||
|
|||
\section{Example of MPS file} |
|||
\label{secmpsex} |
|||
|
|||
To illustrate what the MPS format is, consider the following example of |
|||
LP problem: |
|||
|
|||
\def\arraystretch{1.2} |
|||
|
|||
\noindent\hspace{.5in}minimize |
|||
$$ |
|||
value = .03\ bin_1 + .08\ bin_2 + .17\ bin_3 + .12\ bin_4 + .15\ bin_5 |
|||
+ .21\ al + .38\ si |
|||
$$ |
|||
\noindent\hspace{.5in}subject to linear constraints |
|||
$$ |
|||
\begin{array}{@{}l@{\:}l@{}} |
|||
yield &= \ \ \ \ \;bin_1 + \ \ \ \ \;bin_2 + \ \ \ \ \;bin_3 + |
|||
\ \ \ \ \;bin_4 + \ \ \ \ \;bin_5 + \ \ \ \ \;al + |
|||
\ \ \ \ \;si \\ |
|||
FE &= .15\ bin_1 + .04\ bin_2 + .02\ bin_3 + .04\ bin_4 + .02\ bin_5 |
|||
+ .01\ al + .03\ si \\ |
|||
CU &= .03\ bin_1 + .05\ bin_2 + .08\ bin_3 + .02\ bin_4 + .06\ bin_5 |
|||
+ .01\ al \\ |
|||
MN &= .02\ bin_1 + .04\ bin_2 + .01\ bin_3 + .02\ bin_4 + .02\ bin_5 |
|||
\\ |
|||
MG &= .02\ bin_1 + .03\ bin_2 |
|||
\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ + .01\ bin_5 \\ |
|||
AL &= .70\ bin_1 + .75\ bin_2 + .80\ bin_3 + .75\ bin_4 + .80\ bin_5 |
|||
+ .97\ al \\ |
|||
SI &= .02\ bin_1 + .06\ bin_2 + .08\ bin_3 + .12\ bin_4 + .02\ bin_5 |
|||
+ .01\ al + .97\ si \\ |
|||
\end{array} |
|||
$$ |
|||
|
|||
\newpage |
|||
|
|||
\noindent\hspace{.5in}and bounds of (auxiliary and structural) |
|||
variables |
|||
$$ |
|||
\begin{array}{r@{\ }l@{\ }l@{\ }l@{\ }rcr@{\ }l@{\ }l@{\ }l@{\ }r} |
|||
&&yield&=&2000&&0&\leq&bin_1&\leq&200\\ |
|||
-\infty&<&FE&\leq&60&&0&\leq&bin_2&\leq&2500\\ |
|||
-\infty&<&CU&\leq&100&&400&\leq&bin_3&\leq&800\\ |
|||
-\infty&<&MN&\leq&40&&100&\leq&bin_4&\leq&700\\ |
|||
-\infty&<&MG&\leq&30&&0&\leq&bin_5&\leq&1500\\ |
|||
1500&\leq&AL&<&+\infty&&0&\leq&al&<&+\infty\\ |
|||
250&\leq&SI&\leq&300&&0&\leq&si&<&+\infty\\ |
|||
\end{array} |
|||
$$ |
|||
|
|||
\def\arraystretch{1} |
|||
|
|||
A complete MPS file which specifies data for this example is shown |
|||
below (the first two comment lines show card positions). |
|||
|
|||
\bigskip |
|||
|
|||
\begin{footnotesize} |
|||
\begin{verbatim} |
|||
*000000001111111111222222222233333333334444444444555555555566 |
|||
*234567890123456789012345678901234567890123456789012345678901 |
|||
NAME PLAN |
|||
ROWS |
|||
N VALUE |
|||
E YIELD |
|||
L FE |
|||
L CU |
|||
L MN |
|||
L MG |
|||
G AL |
|||
L SI |
|||
COLUMNS |
|||
BIN1 VALUE .03000 YIELD 1.00000 |
|||
FE .15000 CU .03000 |
|||
MN .02000 MG .02000 |
|||
AL .70000 SI .02000 |
|||
BIN2 VALUE .08000 YIELD 1.00000 |
|||
FE .04000 CU .05000 |
|||
MN .04000 MG .03000 |
|||
AL .75000 SI .06000 |
|||
BIN3 VALUE .17000 YIELD 1.00000 |
|||
FE .02000 CU .08000 |
|||
MN .01000 AL .80000 |
|||
SI .08000 |
|||
BIN4 VALUE .12000 YIELD 1.00000 |
|||
FE .04000 CU .02000 |
|||
MN .02000 AL .75000 |
|||
SI .12000 |
|||
BIN5 VALUE .15000 YIELD 1.00000 |
|||
FE .02000 CU .06000 |
|||
MN .02000 MG .01000 |
|||
AL .80000 SI .02000 |
|||
ALUM VALUE .21000 YIELD 1.00000 |
|||
FE .01000 CU .01000 |
|||
AL .97000 SI .01000 |
|||
SILICON VALUE .38000 YIELD 1.00000 |
|||
FE .03000 SI .97000 |
|||
RHS |
|||
RHS1 YIELD 2000.00000 FE 60.00000 |
|||
CU 100.00000 MN 40.00000 |
|||
SI 300.00000 |
|||
MG 30.00000 AL 1500.00000 |
|||
RANGES |
|||
RNG1 SI 50.00000 |
|||
BOUNDS |
|||
UP BND1 BIN1 200.00000 |
|||
UP BIN2 2500.00000 |
|||
LO BIN3 400.00000 |
|||
UP BIN3 800.00000 |
|||
LO BIN4 100.00000 |
|||
UP BIN4 700.00000 |
|||
UP BIN5 1500.00000 |
|||
ENDATA |
|||
\end{verbatim} |
|||
\end{footnotesize} |
|||
|
|||
\vspace*{-6pt} |
|||
|
|||
\section{MIP features} |
|||
|
|||
\vspace*{-4pt} |
|||
|
|||
The MPS format provides two ways for introducing integer variables into |
|||
the problem. |
|||
|
|||
The first way is most general and based on using special marker cards |
|||
INTORG and INTEND. These marker cards are placed in the COLUMNS section. |
|||
The INTORG card indicates the start of a group of integer variables |
|||
(columns), and the card INTEND indicates the end of the group. The MPS |
|||
file may contain arbitrary number of the marker cards. |
|||
|
|||
The marker cards have the same format as the data cards (see Section |
|||
\ref{secmps}, page \pageref{secmps}). |
|||
|
|||
The fields 1, 2, and 6 are not used and should be empty. |
|||
|
|||
The field 2 should contain a marker name. This name may be arbitrary. |
|||
|
|||
The field 3 should contain the word \verb|'MARKER'| (including |
|||
apostrophes). |
|||
|
|||
The field 5 should contain either the word \verb|'INTORG'| (including |
|||
apostrophes) for the marker card, which begins a group of integer |
|||
columns, or the word \verb|'INTEND'| (including apostrophes) for the |
|||
marker card, which ends the group. |
|||
|
|||
The second way is less general but more convenient in some cases. It |
|||
allows the user declaring integer columns using three additional types |
|||
of bounds, which are specified in the field 1 of data cards in the |
|||
BOUNDS section (see Section \ref{secbounds}, page \pageref{secbounds}): |
|||
|
|||
\verb|LI| --- lower integer. This bound type specifies that the |
|||
corresponding column (structural variable), whose name is specified in |
|||
field 3, is of integer kind. In this case an lower bound of the |
|||
column should be specified in field 4 (like in the case of \verb|LO| |
|||
bound type). |
|||
|
|||
\verb|UI| --- upper integer. This bound type specifies that the |
|||
corresponding column (structural variable), whose name is specified in |
|||
field 3, is of integer kind. In this case an upper bound of the |
|||
column should be specified in field 4 (like in the case of \verb|UP| |
|||
bound type). |
|||
|
|||
\verb|BV| --- binary variable. This bound type specifies that the |
|||
corresponding column (structural variable), whose name is specified in |
|||
the field 3, is of integer kind, its lower bound is zero, and its upper |
|||
bound is one (thus, such variable being of integer kind can have only |
|||
two values zero and one). In this case a numeric value specified in the |
|||
field 4 is ignored and may be omitted. |
|||
|
|||
Consider the following example of MIP problem: |
|||
|
|||
\noindent |
|||
\hspace{1in} minimize |
|||
$$Z = 3 x_1 + 7 x_2 - x_3 + x4$$ |
|||
\hspace{1in} subject to linear constraints |
|||
$$ |
|||
\begin{array}{c} |
|||
\nonumber r_1 = 2 x_1 - \ \ x_2 + \ \ x_3 - \ \;x_4 \\ |
|||
\nonumber r_2 = \ \;x_1 - \ \;x_2 - 6 x_3 + 4 x_4 \\ |
|||
\nonumber r_3 = 5 x_1 + 3 x_2 \ \ \ \ \ \ \ \ \ + \ \ x_4 \\ |
|||
\end{array} |
|||
$$ |
|||
\hspace{1in} and bound of variables |
|||
$$ |
|||
\begin{array}{cccl} |
|||
\nonumber 1 \leq r_1 < +\infty && 0 \leq x_1 \leq 4 &{\rm(continuous)}\\ |
|||
\nonumber 8 \leq r_2 < +\infty && 2 \leq x_2 \leq 5 &{\rm(integer)} \\ |
|||
\nonumber 5 \leq r_3 < +\infty && 0 \leq x_3 \leq 1 &{\rm(integer)} \\ |
|||
\nonumber && 3 \leq x_4 \leq 8 &{\rm(continuous)}\\ |
|||
\end{array} |
|||
$$ |
|||
|
|||
The corresponding MPS file may look like the following: |
|||
|
|||
\medskip |
|||
|
|||
\begin{footnotesize} |
|||
\begin{verbatim} |
|||
NAME SAMP1 |
|||
ROWS |
|||
N Z |
|||
G R1 |
|||
G R2 |
|||
G R3 |
|||
COLUMNS |
|||
X1 R1 2.0 R2 1.0 |
|||
X1 R3 5.0 Z 3.0 |
|||
MARK0001 'MARKER' 'INTORG' |
|||
X2 R1 -1.0 R2 -1.0 |
|||
X2 R3 3.0 Z 7.0 |
|||
X3 R1 1.0 R2 -6.0 |
|||
X3 Z -1.0 |
|||
MARK0002 'MARKER' 'INTEND' |
|||
X4 R1 -1.0 R2 4.0 |
|||
X4 R3 1.0 Z 1.0 |
|||
RHS |
|||
RHS1 R1 1.0 |
|||
RHS1 R2 8.0 |
|||
RHS1 R3 5.0 |
|||
BOUNDS |
|||
UP BND1 X1 4.0 |
|||
LO BND1 X2 2.0 |
|||
UP BND1 X2 5.0 |
|||
UP BND1 X3 1.0 |
|||
LO BND1 X4 3.0 |
|||
UP BND1 X4 8.0 |
|||
ENDATA |
|||
\end{verbatim} |
|||
\end{footnotesize} |
|||
|
|||
\newpage |
|||
|
|||
The same example may be coded without INTORG/INTEND markers using the |
|||
bound type UI for the variable $x_2$ and the bound type BV for the |
|||
variable $x_3$: |
|||
|
|||
\medskip |
|||
|
|||
\begin{footnotesize} |
|||
\begin{verbatim} |
|||
NAME SAMP2 |
|||
ROWS |
|||
N Z |
|||
G R1 |
|||
G R2 |
|||
G R3 |
|||
COLUMNS |
|||
X1 R1 2.0 R2 1.0 |
|||
X1 R3 5.0 Z 3.0 |
|||
X2 R1 -1.0 R2 -1.0 |
|||
X2 R3 3.0 Z 7.0 |
|||
X3 R1 1.0 R2 -6.0 |
|||
X3 Z -1.0 |
|||
X4 R1 -1.0 R2 4.0 |
|||
X4 R3 1.0 Z 1.0 |
|||
RHS |
|||
RHS1 R1 1.0 |
|||
RHS1 R2 8.0 |
|||
RHS1 R3 5.0 |
|||
BOUNDS |
|||
UP BND1 X1 4.0 |
|||
LO BND1 X2 2.0 |
|||
UI BND1 X2 5.0 |
|||
BV BND1 X3 |
|||
LO BND1 X4 3.0 |
|||
UP BND1 X4 8.0 |
|||
ENDATA |
|||
\end{verbatim} |
|||
\end{footnotesize} |
|||
|
|||
%\section{Specifying predefined basis} |
|||
%\label{secbas} |
|||
% |
|||
%The MPS format can also be used to specify some predefined basis for an |
|||
%LP problem, i.e. to specify which rows and columns are basic and which |
|||
%are non-basic. |
|||
% |
|||
%The order of a basis file in the MPS format is: |
|||
% |
|||
%$\bullet$ NAME indicator card; |
|||
% |
|||
%$\bullet$ data cards (can appear in arbitrary order); |
|||
% |
|||
%$\bullet$ ENDATA indicator card. |
|||
% |
|||
%Each data card specifies either a pair "basic column---non-basic row" |
|||
%or a non-basic column. All the data cards have the following format. |
|||
% |
|||
%`\verb|XL|' in the field 1 means that a column, whose name is given in |
|||
%the field 2, is basic, and a row, whose name is given in the field 3, |
|||
%is non-basic and placed on its lower bound. |
|||
% |
|||
%`\verb|XU|' in the field 1 means that a column, whose name is given in |
|||
%the field 2, is basic, and a row, whose name is given in the field 3, |
|||
%is non-basic and placed on its upper bound. |
|||
% |
|||
%`\verb|LL|' in the field 1 means that a column, whose name is given in |
|||
%the field 3, is non-basic and placed on its lower bound. |
|||
% |
|||
%`\verb|UL|' in the field 1 means that a column, whose name is given in |
|||
%the field 3, is non-basic and placed on its upper bound. |
|||
% |
|||
%The field 2 contains a column name. |
|||
% |
|||
%If the indicator given in the field 1 is `\verb|XL|' or `\verb|XU|', |
|||
%the field 3 contains a row name. Otherwise, if the indicator is |
|||
%`\verb|LL|' or `\verb|UL|', the field 3 is not used and should be |
|||
%empty. |
|||
% |
|||
%The field 4, 5, and 6 are not used and should be empty. |
|||
% |
|||
%A basis file in the MPS format acts like a patch: it doesn't specify |
|||
%a basis completely, instead that it is just shows in what a given basis |
|||
%differs from the "standard" basis, where all rows (auxiliary variables) |
|||
%are assumed to be basic and all columns (structural variables) are |
|||
%assumed to be non-basic. |
|||
% |
|||
%As an example here is a basis file that specifies an optimal basis |
|||
%for the example LP problem given in Section \ref{secmpsex}, |
|||
%Page \pageref{secmpsex}: |
|||
% |
|||
%\pagebreak |
|||
% |
|||
%\begin{verbatim} |
|||
%*000000001111111111222222222233333333334444444444555555555566 |
|||
%*234567890123456789012345678901234567890123456789012345678901 |
|||
%NAME PLAN |
|||
% XL BIN2 YIELD |
|||
% XL BIN3 FE |
|||
% XL BIN4 MN |
|||
% XL ALUM AL |
|||
% XL SILICON SI |
|||
% LL BIN1 |
|||
% LL BIN5 |
|||
%ENDATA |
|||
%\end{verbatim} |
|||
|
|||
%* eof *% |
@ -0,0 +1,424 @@ |
|||
%* glpk09.tex *% |
|||
|
|||
\chapter{CPLEX LP Format} |
|||
\label{chacplex} |
|||
|
|||
\section{Prelude} |
|||
|
|||
The CPLEX LP format\footnote{The CPLEX LP format was developed in |
|||
the end of 1980's by CPLEX Optimization, Inc. as an input format for |
|||
the CPLEX linear programming system. Although the CPLEX LP format is |
|||
not as widely used as the MPS format, being row-oriented it is more |
|||
convenient for coding mathematical programming models by human. This |
|||
appendix describes only the features of the CPLEX LP format which are |
|||
implemented in the GLPK package.} is intended for coding LP/MIP problem |
|||
data. It is a row-oriented format that assumes the formulation of |
|||
LP/MIP problem (1.1)---(1.3) (see Section \ref{seclp}, page |
|||
\pageref{seclp}). |
|||
|
|||
CPLEX LP file is a plain text file written in CPLEX LP format. Each |
|||
text line of this file may contain up to 255 characters\footnote{GLPK |
|||
allows text lines of arbitrary length.}. Blank lines are ignored. |
|||
If a line contains the backslash character ($\backslash$), this |
|||
character and everything that follows it until the end of line are |
|||
considered as a comment and also ignored. |
|||
|
|||
An LP file is coded by the user using the following elements: keywords, |
|||
symbolic names, numeric constants, delimiters, and blanks. |
|||
|
|||
{\it Keywords} which may be used in the LP file are the following: |
|||
|
|||
\begin{verbatim} |
|||
minimize minimum min |
|||
maximize maximum max |
|||
subject to such that s.t. st. st |
|||
bounds bound |
|||
general generals gen |
|||
integer integers int |
|||
binary binaries bin |
|||
infinity inf |
|||
free |
|||
end |
|||
\end{verbatim} |
|||
|
|||
\noindent |
|||
All the keywords are case insensitive. Keywords given above on the same |
|||
line are equivalent. Any keyword (except \verb|infinity|, \verb|inf|, |
|||
and \verb|free|) being used in the LP file must start at the beginning |
|||
of a text line. |
|||
|
|||
\newpage |
|||
|
|||
{\it Symbolic names} are used to identify the objective function, |
|||
constraints (rows), and variables (columns). All symbolic names are case |
|||
sensitive and may contain up to 16 alphanumeric characters\footnote{GLPK |
|||
allows symbolic names having up to 255 characters.} (\verb|a|, \dots, |
|||
\verb|z|, \verb|A|, \dots, \verb|Z|, \verb|0|, \dots, \verb|9|) as well |
|||
as the following characters: |
|||
|
|||
\begin{verbatim} |
|||
! " # $ % & ( ) / , . ; ? @ _ ` ' { } | ~ |
|||
\end{verbatim} |
|||
|
|||
\noindent |
|||
with exception that no symbolic name can begin with a digit or |
|||
a period. |
|||
|
|||
{\it Numeric constants} are used to denote constraint and objective |
|||
coefficients, right-hand sides of constraints, and bounds of variables. |
|||
They are coded in the standard form $xx$\verb|E|$syy$, where $xx$ is |
|||
a real number with optional decimal point, $s$ is a sign (\verb|+| or |
|||
\verb|-|), $yy$ is an integer decimal exponent. Numeric constants may |
|||
contain arbitrary number of characters. The exponent part is optional. |
|||
The letter `\verb|E|' can be coded as `\verb|e|'. If the sign $s$ is |
|||
omitted, plus is assumed. |
|||
|
|||
{\it Delimiters} that may be used in the LP file are the following: |
|||
|
|||
\begin{verbatim} |
|||
: |
|||
+ |
|||
- |
|||
< <= =< |
|||
> >= => |
|||
= |
|||
\end{verbatim} |
|||
|
|||
\noindent |
|||
Delimiters given above on the same line are equivalent. The meaning of |
|||
the delimiters will be explained below. |
|||
|
|||
{\it Blanks} are non-significant characters. They may be used freely to |
|||
improve readability of the LP file. Besides, blanks should be used to |
|||
separate elements from each other if there is no other way to do that |
|||
(for example, to separate a keyword from a following symbolic name). |
|||
|
|||
The order of an LP file is: |
|||
|
|||
\vspace*{-8pt} |
|||
|
|||
\begin{itemize} |
|||
\item objective function definition; |
|||
|
|||
\item constraints section; |
|||
|
|||
\item bounds section; |
|||
|
|||
\item general, integer, and binary sections (can appear in arbitrary |
|||
order); |
|||
|
|||
\item end keyword. |
|||
\end{itemize} |
|||
|
|||
\vspace*{-8pt} |
|||
|
|||
These components are discussed in following sections. |
|||
|
|||
\section{Objective function definition} |
|||
|
|||
The objective function definition must appear first in the LP file. |
|||
It defines the objective function and specifies the optimization |
|||
direction. |
|||
|
|||
The objective function definition has the following form: |
|||
$$ |
|||
\left\{ |
|||
\begin{array}{@{}c@{}} |
|||
{\tt minimize} \\ {\tt maximize} |
|||
\end{array} |
|||
\right\}\ f\ {\tt :}\ s\ c\ x\ s\ c\ x\ \dots\ s\ c\ x |
|||
$$ |
|||
where $f$ is a symbolic name of the objective function, $s$ is a sign |
|||
\verb|+| or \verb|-|, $c$ is a numeric constant that denotes an |
|||
objective coefficient, $x$ is a symbolic name of a variable. |
|||
|
|||
If necessary, the objective function definition can be continued on as |
|||
many text lines as desired. |
|||
|
|||
The name of the objective function is optional and may be omitted |
|||
(together with the semicolon that follows it). In this case the default |
|||
name `\verb|obj|' is assigned to the objective function. |
|||
|
|||
If the very first sign $s$ is omitted, the sign plus is assumed. Other |
|||
signs cannot be omitted. |
|||
|
|||
If some objective coefficient $c$ is omitted, 1 is assumed. |
|||
|
|||
Symbolic names $x$ used to denote variables are recognized by context |
|||
and therefore needn't to be declared somewhere else. |
|||
|
|||
Here is an example of the objective function definition: |
|||
|
|||
\begin{verbatim} |
|||
Minimize Z : - x1 + 2 x2 - 3.5 x3 + 4.997e3x(4) + x5 + x6 + |
|||
x7 - .01x8 |
|||
\end{verbatim} |
|||
|
|||
\section{Constraints section} |
|||
|
|||
The constraints section must follow the objective function definition. |
|||
It defines a system of equality and/or inequality constraints. |
|||
|
|||
The constraint section has the following form: |
|||
|
|||
\begin{center} |
|||
\begin{tabular}{l} |
|||
\verb|subject to| \\ |
|||
{\it constraint}$_1$ \\ |
|||
{\it constraint}$_2$ \\ |
|||
\hspace{20pt}\dots \\ |
|||
{\it constraint}$_m$ \\ |
|||
\end{tabular} |
|||
\end{center} |
|||
|
|||
\noindent where {\it constraint}$_i, i=1,\dots,m,$ is a particular |
|||
constraint definition. |
|||
|
|||
Each constraint definition can be continued on as many text lines as |
|||
desired. However, each constraint definition must begin on a new line |
|||
except the very first constraint definition which can begin on the same |
|||
line as the keyword `\verb|subject to|'. |
|||
|
|||
Constraint definitions have the following form: |
|||
$$ |
|||
r\ {\tt:}\ s\ c\ x\ s\ c\ x\ \dots\ s\ c\ x |
|||
\ \left\{ |
|||
\begin{array}{@{}c@{}} |
|||
\mbox{\tt<=} \\ \mbox{\tt>=} \\ \mbox{\tt=} |
|||
\end{array} |
|||
\right\}\ b |
|||
$$ |
|||
where $r$ is a symbolic name of a constraint, $s$ is a sign \verb|+| or |
|||
\verb|-|, $c$ is a numeric constant that denotes a constraint |
|||
coefficient, $x$ is a symbolic name of a variable, $b$ is a right-hand |
|||
side. |
|||
|
|||
The name $r$ of a constraint (which is the name of the corresponding |
|||
auxiliary variable) is optional and may be omitted (together with the |
|||
semicolon that follows it). In this case the default names like |
|||
`\verb|r.nnn|' are assigned to unnamed constraints. |
|||
|
|||
The linear form $s\ c\ x\ s\ c\ x\ \dots\ s\ c\ x$ in the left-hand |
|||
side of a constraint definition has exactly the same meaning as in the |
|||
case of the objective function definition (see above). |
|||
|
|||
After the linear form one of the following delimiters that indicates |
|||
the constraint sense must be specified: |
|||
|
|||
\verb|<=| \ means `less than or equal to' |
|||
|
|||
\verb|>=| \ means `greater than or equal to' |
|||
|
|||
\verb|= | \ means `equal to' |
|||
|
|||
The right hand side $b$ is a numeric constant with an optional sign. |
|||
|
|||
Here is an example of the constraints section: |
|||
|
|||
\begin{verbatim} |
|||
Subject To |
|||
one: y1 + 3 a1 - a2 - b >= 1.5 |
|||
y2 + 2 a3 + 2 |
|||
a4 - b >= -1.5 |
|||
two : y4 + 3 a1 + 4 a5 - b <= +1 |
|||
.20y5 + 5 a2 - b = 0 |
|||
1.7 y6 - a6 + 5 a777 - b >= 1 |
|||
\end{verbatim} |
|||
|
|||
Should note that it is impossible to express ranged constraints in the |
|||
CPLEX LP format. Each a ranged constraint can be coded as two |
|||
constraints with identical linear forms in the left-hand side, one of |
|||
which specifies a lower bound and other does an upper one of the |
|||
original ranged constraint. Another way is to introduce a slack |
|||
double-bounded variable; for example, the |
|||
constraint |
|||
$$10\leq x+2y+3z\leq 50$$ |
|||
can be written as follows: |
|||
$$x+2y+3z+t=50,$$ |
|||
where $0\leq t\leq 40$ is a slack variable. |
|||
|
|||
\section{Bounds section} |
|||
|
|||
The bounds section is intended to define bounds of variables. This |
|||
section is optional; if it is specified, it must follow the constraints |
|||
section. If the bound section is omitted, all variables are assumed to |
|||
be non-negative (i.e. that they have zero lower bound and no upper |
|||
bound). |
|||
|
|||
The bounds section has the following form: |
|||
|
|||
\begin{center} |
|||
\begin{tabular}{l} |
|||
\verb|bounds| \\ |
|||
{\it definition}$_1$ \\ |
|||
{\it definition}$_2$ \\ |
|||
\hspace{20pt}\dots \\ |
|||
{\it definition}$_p$ \\ |
|||
\end{tabular} |
|||
\end{center} |
|||
|
|||
\noindent |
|||
where {\it definition}$_k, k=1,\dots,p,$ is a particular bound |
|||
definition. |
|||
|
|||
Each bound definition must begin on a new line\footnote{The GLPK |
|||
implementation allows several bound definitions to be placed on the |
|||
same line.} except the very first bound definition which can begin on |
|||
the same line as the keyword `\verb|bounds|'. |
|||
|
|||
\newpage |
|||
|
|||
Syntactically constraint definitions can have one of the following six |
|||
forms: |
|||
|
|||
\begin{center} |
|||
\begin{tabular}{ll} |
|||
$x$ \verb|>=| $l$ & specifies a lower bound \\ |
|||
$l$ \verb|<=| $x$ & specifies a lower bound \\ |
|||
$x$ \verb|<=| $u$ & specifies an upper bound \\ |
|||
$l$ \verb|<=| $x$ \verb|<=| $u$ &specifies both lower and upper bounds\\ |
|||
$x$ \verb|=| $t$ &specifies a fixed value \\ |
|||
$x$ \verb|free| &specifies free variable |
|||
\end{tabular} |
|||
\end{center} |
|||
|
|||
\noindent |
|||
where $x$ is a symbolic name of a variable, $l$ is a numeric constant |
|||
with an optional sign that defines a lower bound of the variable or |
|||
\verb|-inf| that means that the variable has no lower bound, $u$ is a |
|||
numeric constant with an optional sign that defines an upper bound of |
|||
the variable or \verb|+inf| that means that the variable has no upper |
|||
bound, $t$ is a numeric constant with an optional sign that defines a |
|||
fixed value of the variable. |
|||
|
|||
By default all variables are non-negative, i.e. have zero lower bound |
|||
and no upper bound. Therefore definitions of these default bounds can |
|||
be omitted in the bounds section. |
|||
|
|||
Here is an example of the bounds section: |
|||
|
|||
\begin{verbatim} |
|||
Bounds |
|||
-inf <= a1 <= 100 |
|||
-100 <= a2 |
|||
b <= 100 |
|||
x2 = +123.456 |
|||
x3 free |
|||
\end{verbatim} |
|||
|
|||
\section{General, integer, and binary sections} |
|||
|
|||
The general, integer, and binary sections are intended to define |
|||
some variables as integer or binary. All these sections are optional |
|||
and needed only in case of MIP problems. If they are specified, they |
|||
must follow the bounds section or, if the latter is omitted, the |
|||
constraints section. |
|||
|
|||
All the general, integer, and binary sections have the same form as |
|||
follows: |
|||
|
|||
\begin{center} |
|||
\begin{tabular}{l} |
|||
$ |
|||
\left\{ |
|||
\begin{array}{@{}l@{}} |
|||
\verb|general| \\ |
|||
\verb|integer| \\ |
|||
\verb|binary | \\ |
|||
\end{array} |
|||
\right\} |
|||
$ \\ |
|||
\hspace{10pt}$x_1$ \\ |
|||
\hspace{10pt}$x_2$ \\ |
|||
\hspace{10pt}\dots \\ |
|||
\hspace{10pt}$x_q$ \\ |
|||
\end{tabular} |
|||
\end{center} |
|||
|
|||
\noindent |
|||
where $x_k$ is a symbolic name of variable, $k=1,\dots,q$. |
|||
|
|||
Each symbolic name must begin on a new line\footnote{The GLPK |
|||
implementation allows several symbolic names to be placed on the same |
|||
line.} except the very first symbolic name which can begin on the same |
|||
line as the keyword `\verb|general|', `\verb|integer|', or |
|||
`\verb|binary|'. |
|||
|
|||
\newpage |
|||
|
|||
If a variable appears in the general or the integer section, it is |
|||
assumed to be general integer variable. If a variable appears in the |
|||
binary section, it is assumed to be binary variable, i.e. an integer |
|||
variable whose lower bound is zero and upper bound is one. (Note that |
|||
if bounds of a variable are specified in the bounds section and then |
|||
the variable appears in the binary section, its previously specified |
|||
bounds are ignored.) |
|||
|
|||
Here is an example of the integer section: |
|||
|
|||
\begin{verbatim} |
|||
Integer |
|||
z12 |
|||
z22 |
|||
z35 |
|||
\end{verbatim} |
|||
|
|||
\section{End keyword} |
|||
|
|||
The keyword `\verb|end|' is intended to end the LP file. It must begin |
|||
on a separate line and no other elements (except comments and blank |
|||
lines) must follow it. Although this keyword is optional, it is strongly |
|||
recommended to include it in the LP file. |
|||
|
|||
\section{Example of CPLEX LP file} |
|||
|
|||
Here is a complete example of CPLEX LP file that corresponds to the |
|||
example given in Section \ref{secmpsex}, page \pageref{secmpsex}. |
|||
|
|||
\medskip |
|||
|
|||
\begin{footnotesize} |
|||
\begin{verbatim} |
|||
\* plan.lp *\ |
|||
|
|||
Minimize |
|||
value: .03 bin1 + .08 bin2 + .17 bin3 + .12 bin4 + .15 bin5 + |
|||
.21 alum + .38 silicon |
|||
|
|||
Subject To |
|||
yield: bin1 + bin2 + bin3 + bin4 + bin5 + |
|||
alum + silicon = 2000 |
|||
|
|||
fe: .15 bin1 + .04 bin2 + .02 bin3 + .04 bin4 + .02 bin5 + |
|||
.01 alum + .03 silicon <= 60 |
|||
|
|||
cu: .03 bin1 + .05 bin2 + .08 bin3 + .02 bin4 + .06 bin5 + |
|||
.01 alum <= 100 |
|||
|
|||
mn: .02 bin1 + .04 bin2 + .01 bin3 + .02 bin4 + .02 bin5 <= 40 |
|||
|
|||
mg: .02 bin1 + .03 bin2 + .01 bin5 <= 30 |
|||
|
|||
al: .70 bin1 + .75 bin2 + .80 bin3 + .75 bin4 + .80 bin5 + |
|||
.97 alum >= 1500 |
|||
|
|||
si1: .02 bin1 + .06 bin2 + .08 bin3 + .12 bin4 + .02 bin5 + |
|||
.01 alum + .97 silicon >= 250 |
|||
|
|||
si2: .02 bin1 + .06 bin2 + .08 bin3 + .12 bin4 + .02 bin5 + |
|||
.01 alum + .97 silicon <= 300 |
|||
|
|||
Bounds |
|||
bin1 <= 200 |
|||
bin2 <= 2500 |
|||
400 <= bin3 <= 800 |
|||
100 <= bin4 <= 700 |
|||
bin5 <= 1500 |
|||
|
|||
End |
|||
|
|||
\* eof *\ |
|||
\end{verbatim} |
|||
\end{footnotesize} |
|||
|
|||
%* eof *% |
@ -0,0 +1,165 @@ |
|||
%* glpk10.tex *% |
|||
|
|||
\chapter{Stand-alone LP/MIP Solver} |
|||
\label{chaglpsol} |
|||
|
|||
The GLPK package includes the program \verb|glpsol|, which is a |
|||
stand-alone LP/MIP solver. This program can be invoked from the command |
|||
line to read LP/MIP problem data in any format supported by GLPK, solve |
|||
the problem, and write its solution to an output text file. |
|||
|
|||
\para{Usage} |
|||
|
|||
\verb|glpsol| [{\it options\dots}] [{\it filename}] |
|||
|
|||
\para{General options} |
|||
|
|||
\begin{verbatim} |
|||
--mps read LP/MIP problem in fixed MPS format |
|||
--freemps read LP/MIP problem in free MPS format (default) |
|||
--lp read LP/MIP problem in CPLEX LP format |
|||
--glp read LP/MIP problem in GLPK format |
|||
--math read LP/MIP model written in GNU MathProg modeling |
|||
language |
|||
-m filename, --model filename |
|||
read model section and optional data section from |
|||
filename (same as --math) |
|||
-d filename, --data filename |
|||
read data section from filename (for --math only); |
|||
if model file also has data section, it is ignored |
|||
-y filename, --display filename |
|||
send display output to filename (for --math only); |
|||
by default the output is sent to terminal |
|||
--seed value initialize pseudo-random number generator used in |
|||
MathProg model with specified seed (any integer); |
|||
if seed value is ?, some random seed will be used |
|||
--mincost read min-cost flow problem in DIMACS format |
|||
--maxflow read maximum flow problem in DIMACS format |
|||
--cnf read CNF-SAT problem in DIMACS format |
|||
--simplex use simplex method (default) |
|||
--interior use interior point method (LP only) |
|||
-r filename, --read filename |
|||
read solution from filename rather to find it with |
|||
the solver |
|||
--min minimization |
|||
--max maximization |
|||
--scale scale problem (default) |
|||
--noscale do not scale problem |
|||
-o filename, --output filename |
|||
write solution to filename in printable format |
|||
-w filename, --write filename |
|||
write solution to filename in plain text format |
|||
--ranges filename |
|||
write sensitivity analysis report to filename in |
|||
printable format (simplex only) |
|||
--tmlim nnn limit solution time to nnn seconds |
|||
--memlim nnn limit available memory to nnn megabytes |
|||
--check do not solve problem, check input data only |
|||
--name probname change problem name to probname |
|||
--wmps filename write problem to filename in fixed MPS format |
|||
--wfreemps filename |
|||
write problem to filename in free MPS format |
|||
--wlp filename write problem to filename in CPLEX LP format |
|||
--wglp filename write problem to filename in GLPK format |
|||
--wcnf filename write problem to filename in DIMACS CNF-SAT format |
|||
--log filename write copy of terminal output to filename |
|||
-h, --help display this help information and exit |
|||
-v, --version display program version and exit |
|||
\end{verbatim} |
|||
|
|||
\para{LP basis factorization options} |
|||
|
|||
\begin{verbatim} |
|||
--luf plain LU factorization (default) |
|||
--btf block triangular LU factorization |
|||
--ft Forrest-Tomlin update (requires --luf; default) |
|||
--cbg Schur complement + Bartels-Golub update |
|||
--cgr Schur complement + Givens rotation update |
|||
\end{verbatim} |
|||
|
|||
\para{Options specific to the simplex solver} |
|||
|
|||
\begin{verbatim} |
|||
--primal use primal simplex (default) |
|||
--dual use dual simplex |
|||
--std use standard initial basis of all slacks |
|||
--adv use advanced initial basis (default) |
|||
--bib use Bixby's initial basis |
|||
--ini filename use as initial basis previously saved with -w |
|||
(disables LP presolver) |
|||
--steep use steepest edge technique (default) |
|||
--nosteep use standard "textbook" pricing |
|||
--relax use Harris' two-pass ratio test (default) |
|||
--norelax use standard "textbook" ratio test |
|||
--presol use presolver (default; assumes --scale and --adv) |
|||
--nopresol do not use presolver |
|||
--exact use simplex method based on exact arithmetic |
|||
--xcheck check final basis using exact arithmetic |
|||
\end{verbatim} |
|||
|
|||
\para{Options specific to the interior-point solver} |
|||
|
|||
\begin{verbatim} |
|||
--nord use natural (original) ordering |
|||
--qmd use quotient minimum degree ordering |
|||
--amd use approximate minimum degree ordering (default) |
|||
--symamd use approximate minimum degree ordering |
|||
\end{verbatim} |
|||
|
|||
\para{Options specific to the MIP solver} |
|||
|
|||
\begin{verbatim} |
|||
--nomip consider all integer variables as continuous |
|||
(allows solving MIP as pure LP) |
|||
--first branch on first integer variable |
|||
--last branch on last integer variable |
|||
--mostf branch on most fractional variable |
|||
--drtom branch using heuristic by Driebeck and Tomlin |
|||
(default) |
|||
--pcost branch using hybrid pseudocost heuristic (may be |
|||
useful for hard instances) |
|||
--dfs backtrack using depth first search |
|||
--bfs backtrack using breadth first search |
|||
--bestp backtrack using the best projection heuristic |
|||
--bestb backtrack using node with best local bound |
|||
(default) |
|||
--intopt use MIP presolver (default) |
|||
--nointopt do not use MIP presolver |
|||
--binarize replace general integer variables by binary ones |
|||
(assumes --intopt) |
|||
--fpump apply feasibility pump heuristic |
|||
--proxy [nnn] apply proximity search heuristic (nnn is time limit |
|||
in seconds; default is 60) |
|||
--gomory generate Gomory's mixed integer cuts |
|||
--mir generate MIR (mixed integer rounding) cuts |
|||
--cover generate mixed cover cuts |
|||
--clique generate clique cuts |
|||
--cuts generate all cuts above |
|||
--mipgap tol set relative mip gap tolerance to tol |
|||
--minisat translate integer feasibility problem to CNF-SAT |
|||
and solve it with MiniSat solver |
|||
\end{verbatim} |
|||
|
|||
\newpage |
|||
|
|||
\begin{verbatim} |
|||
--objbnd bound add inequality obj <= bound (minimization) or |
|||
obj >= bound (maximization) to integer feasibility |
|||
problem (assumes --minisat) |
|||
\end{verbatim} |
|||
|
|||
For description of the MPS format see Appendix \ref{champs}, page |
|||
\pageref{champs}. |
|||
|
|||
For description of the CPLEX LP format see Appendix \ref{chacplex}, |
|||
page \pageref{chacplex}. |
|||
|
|||
For description of the modeling language see the document ``Modeling |
|||
Language GNU MathProg: Language Reference'' included in the GLPK |
|||
distribution. |
|||
|
|||
For description of the DIMACS min-cost flow problem format and DIMACS |
|||
maximum flow problem format see the document ``GLPK: Graph and Network |
|||
Routines'' included in the GLPK distribution. |
|||
|
|||
%* eof *% |
@ -0,0 +1,203 @@ |
|||
%* glpk11.tex *% |
|||
|
|||
\chapter{External Software Modules Used In GLPK} |
|||
|
|||
In the GLPK package there are used some external software modules |
|||
listed in this Appendix. Note that these modules are {\it not} part of |
|||
GLPK, but are used with GLPK and included in the distribution. |
|||
|
|||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|||
|
|||
\section{AMD} |
|||
|
|||
\noindent |
|||
AMD Version 2.2, Copyright {\copyright} 2007 by Timothy A. Davis, |
|||
Patrick R. Amestoy, and Iain S. Duff. All Rights Reserved. |
|||
|
|||
\para{Description} |
|||
|
|||
AMD is a set of routines for pre-ordering sparse matrices prior to |
|||
Cholesky or LU factorization, using the approximate minimum degree |
|||
ordering algorithm. |
|||
|
|||
\para{License} |
|||
|
|||
This library is free software; you can redistribute it and/or |
|||
modify it under the terms of the GNU Lesser General Public License |
|||
as published by the Free Software Foundation; either version 2.1 of |
|||
the License, or (at your option) any later version. |
|||
|
|||
This library is distributed in the hope that it will be useful, |
|||
but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|||
Lesser General Public License for more details. |
|||
|
|||
You should have received a copy of the GNU Lesser General Public |
|||
License along with this library; if not, write to the Free Software |
|||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 |
|||
USA. |
|||
|
|||
Permission is hereby granted to use or copy this program under the |
|||
terms of the GNU LGPL, provided that the Copyright, this License, |
|||
and the Availability of the original version is retained on all |
|||
copies. User documentation of any code that uses this code or any |
|||
modified version of this code must cite the Copyright, this License, |
|||
the Availability note, and ``Used by permission.'' Permission to |
|||
modify the code and to distribute modified code is granted, provided |
|||
the Copyright, this License, and the Availability note are retained, |
|||
and a notice that the code was modified is included. |
|||
|
|||
AMD is available under alternate licences; contact T. Davis for |
|||
details. |
|||
|
|||
\para{Availability} |
|||
|
|||
\noindent |
|||
\url{http://www.cise.ufl.edu/research/sparse/amd} |
|||
|
|||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|||
|
|||
\section{COLAMD/SYMAMD} |
|||
|
|||
\noindent |
|||
COLAMD/SYMAMD Version 2.7, Copyright {\copyright} 1998-2007, Timothy A. |
|||
Davis, All Rights Reserved. |
|||
|
|||
\para{Description} |
|||
|
|||
colamd: an approximate minimum degree column ordering algorithm, for |
|||
LU factorization of symmetric or unsymmetric matrices, QR factorization, |
|||
least squares, interior point methods for linear programming problems, |
|||
and other related problems. |
|||
|
|||
symamd: an approximate minimum degree ordering algorithm for Cholesky |
|||
factorization of symmetric matrices. |
|||
|
|||
\para{Authors} |
|||
|
|||
The authors of the code itself are Stefan I. Larimore and Timothy A. |
|||
Davis (davis at cise.ufl.edu), University of Florida. The algorithm |
|||
was developed in collaboration with John Gilbert, Xerox PARC, and |
|||
Esmond Ng, Oak Ridge National Laboratory. |
|||
|
|||
\para{License} |
|||
|
|||
This library is free software; you can redistribute it and/or |
|||
modify it under the terms of the GNU Lesser General Public License |
|||
as published by the Free Software Foundation; either version 2.1 of |
|||
the License, or (at your option) any later version. |
|||
|
|||
This library is distributed in the hope that it will be useful, |
|||
but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|||
Lesser General Public License for more details. |
|||
|
|||
You should have received a copy of the GNU Lesser General Public |
|||
License along with this library; if not, write to the Free Software |
|||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 |
|||
USA. |
|||
|
|||
Permission is hereby granted to use or copy this program under the |
|||
terms of the GNU LGPL, provided that the Copyright, this License, |
|||
and the Availability of the original version is retained on all |
|||
copies. User documentation of any code that uses this code or any |
|||
modified version of this code must cite the Copyright, this License, |
|||
the Availability note, and ``Used by permission.'' Permission to |
|||
modify the code and to distribute modified code is granted, provided |
|||
the Copyright, this License, and the Availability note are retained, |
|||
and a notice that the code was modified is included. |
|||
|
|||
COLAMD is also available under alternate licenses, contact T. Davis for |
|||
details. |
|||
|
|||
\para{Availability} |
|||
|
|||
\noindent |
|||
\url{http://www.cise.ufl.edu/research/sparse/colamd} |
|||
|
|||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|||
|
|||
\section{MiniSat} |
|||
|
|||
\noindent |
|||
MiniSat-C v1.14.1, Copyright {\copyright} 2005, Niklas Sorensson. |
|||
|
|||
\para{Description} |
|||
|
|||
MiniSat is a minimalistic implementation of a Chaff-like SAT solver |
|||
based on the two-literal watch scheme for fast BCP and clause learning |
|||
by conflict analysis. |
|||
|
|||
\para{License} |
|||
|
|||
Permission is hereby granted, free of charge, to any person obtaining a |
|||
copy of this software and associated documentation files (the |
|||
"Software"), to deal in the Software without restriction, including |
|||
without limitation the rights to use, copy, modify, merge, publish, |
|||
distribute, sublicense, and/or sell copies of the Software, and to |
|||
permit persons to whom the Software is furnished to do so, subject to |
|||
the following conditions: |
|||
|
|||
The above copyright notice and this permission notice shall be included |
|||
in all copies or substantial portions of the Software. |
|||
|
|||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS |
|||
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
|||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
|||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE |
|||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION |
|||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION |
|||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
|||
|
|||
\para{Availability} |
|||
|
|||
\noindent |
|||
\url{http://www.cs.chalmers.se/Cs/Research/FormalMethods/MiniSat} |
|||
|
|||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|||
|
|||
\section{zlib} |
|||
|
|||
\noindent |
|||
zlib version 1.2.5, Copyright {\copyright} 1995--2010 Jean-loup Gailly |
|||
and Mark Adler. |
|||
|
|||
\para{Description} |
|||
|
|||
zlib is a general purpose data compression library. All the code is |
|||
thread safe. The data format used by the zlib library is described by |
|||
RFCs (Request for Comments) 1950 to 1952 in the files |
|||
\verb|rfc1950.txt| (zlib format), \verb|rfc1951.txt| (deflate format) |
|||
and \verb|rfc1952.txt| (gzip format). |
|||
|
|||
\para{License} |
|||
|
|||
This software is provided 'as-is', without any express or implied |
|||
warranty. In no event will the authors be held liable for any damages |
|||
arising from the use of this software. |
|||
|
|||
Permission is granted to anyone to use this software for any purpose, |
|||
including commercial applications, and to alter it and redistribute it |
|||
freely, subject to the following restrictions: |
|||
|
|||
1. The origin of this software must not be misrepresented; you must not |
|||
claim that you wrote the original software. If you use this software |
|||
in a product, an acknowledgment in the product documentation would |
|||
be appreciated but is not required. |
|||
|
|||
2. Altered source versions must be plainly marked as such, and must not |
|||
be misrepresented as being the original software. |
|||
|
|||
3. This notice may not be removed or altered from any source |
|||
distribution. |
|||
|
|||
\hfill Jean-loup Gailly |
|||
|
|||
\hfill Mark Adler |
|||
|
|||
\para{Availability} |
|||
|
|||
\noindent |
|||
\url{http://www.zlib.net/} |
|||
|
|||
%* eof *% |
@ -0,0 +1,707 @@ |
|||
%* glpk12.tex *% |
|||
|
|||
\begin{footnotesize} |
|||
|
|||
\chapter*{\sf\bfseries GNU General Public License} |
|||
\addcontentsline{toc}{chapter}{GNU General Public License} |
|||
|
|||
\begin{center} |
|||
{\bf Version 3, 29 June 2007} |
|||
\end{center} |
|||
|
|||
\begin{quotation} |
|||
\noindent |
|||
Copyright {\copyright} 2007 Free Software Foundation, Inc. |
|||
\verb|<http://fsf.org/>| |
|||
\end{quotation} |
|||
|
|||
\begin{quotation} |
|||
\noindent |
|||
Everyone is permitted to copy and distribute verbatim copies |
|||
of this license document, but changing it is not allowed. |
|||
\end{quotation} |
|||
|
|||
\section*{Preamble} |
|||
|
|||
The GNU General Public License is a free, copyleft license for |
|||
software and other kinds of works. |
|||
|
|||
The licenses for most software and other practical works are designed |
|||
to take away your freedom to share and change the works. By contrast, |
|||
the GNU General Public License is intended to guarantee your freedom to |
|||
share and change all versions of a program--to make sure it remains free |
|||
software for all its users. We, the Free Software Foundation, use the |
|||
GNU General Public License for most of our software; it applies also to |
|||
any other work released this way by its authors. You can apply it to |
|||
your programs, too. |
|||
|
|||
When we speak of free software, we are referring to freedom, not |
|||
price. Our General Public Licenses are designed to make sure that you |
|||
have the freedom to distribute copies of free software (and charge for |
|||
them if you wish), that you receive source code or can get it if you |
|||
want it, that you can change the software or use pieces of it in new |
|||
free programs, and that you know you can do these things. |
|||
|
|||
To protect your rights, we need to prevent others from denying you |
|||
these rights or asking you to surrender the rights. Therefore, you have |
|||
certain responsibilities if you distribute copies of the software, or if |
|||
you modify it: responsibilities to respect the freedom of others. |
|||
|
|||
For example, if you distribute copies of such a program, whether |
|||
gratis or for a fee, you must pass on to the recipients the same |
|||
freedoms that you received. You must make sure that they, too, receive |
|||
or can get the source code. And you must show them these terms so they |
|||
know their rights. |
|||
|
|||
Developers that use the GNU GPL protect your rights with two steps: |
|||
(1) assert copyright on the software, and (2) offer you this License |
|||
giving you legal permission to copy, distribute and/or modify it. |
|||
|
|||
For the developers' and authors' protection, the GPL clearly explains |
|||
that there is no warranty for this free software. For both users' and |
|||
authors' sake, the GPL requires that modified versions be marked as |
|||
changed, so that their problems will not be attributed erroneously to |
|||
authors of previous versions. |
|||
|
|||
Some devices are designed to deny users access to install or run |
|||
modified versions of the software inside them, although the manufacturer |
|||
can do so. This is fundamentally incompatible with the aim of |
|||
protecting users' freedom to change the software. The systematic |
|||
pattern of such abuse occurs in the area of products for individuals to |
|||
use, which is precisely where it is most unacceptable. Therefore, we |
|||
have designed this version of the GPL to prohibit the practice for those |
|||
products. If such problems arise substantially in other domains, we |
|||
stand ready to extend this provision to those domains in future versions |
|||
of the GPL, as needed to protect the freedom of users. |
|||
|
|||
Finally, every program is threatened constantly by software patents. |
|||
States should not allow patents to restrict development and use of |
|||
software on general-purpose computers, but in those that do, we wish to |
|||
avoid the special danger that patents applied to a free program could |
|||
make it effectively proprietary. To prevent this, the GPL assures that |
|||
patents cannot be used to render the program non-free. |
|||
|
|||
The precise terms and conditions for copying, distribution and |
|||
modification follow. |
|||
|
|||
\section*{TERMS AND CONDITIONS} |
|||
|
|||
\subsubsection*{0. Definitions.} |
|||
|
|||
``This License'' refers to version 3 of the GNU General Public |
|||
License. |
|||
|
|||
``Copyright'' also means copyright-like laws that apply to other kinds |
|||
of works, such as semiconductor masks. |
|||
|
|||
``The Program'' refers to any copyrightable work licensed under this |
|||
License. Each licensee is addressed as ``you''. ``Licensees'' and |
|||
``recipients'' may be individuals or organizations. |
|||
|
|||
To ``modify'' a work means to copy from or adapt all or part of the |
|||
work in a fashion requiring copyright permission, other than the making |
|||
of an exact copy. The resulting work is called a ``modified version'' |
|||
of the earlier work or a work ``based on'' the earlier work. |
|||
|
|||
A ``covered work'' means either the unmodified Program or a work based |
|||
on the Program. |
|||
|
|||
To ``propagate'' a work means to do anything with it that, without |
|||
permission, would make you directly or secondarily liable for |
|||
infringement under applicable copyright law, except executing it on a |
|||
computer or modifying a private copy. Propagation includes copying, |
|||
distribution (with or without modification), making available to the |
|||
public, and in some countries other activities as well. |
|||
|
|||
To ``convey'' a work means any kind of propagation that enables other |
|||
parties to make or receive copies. Mere interaction with a user through |
|||
a computer network, with no transfer of a copy, is not conveying. |
|||
|
|||
An interactive user interface displays ``Appropriate Legal Notices'' |
|||
to the extent that it includes a convenient and prominently visible |
|||
feature that (1) displays an appropriate copyright notice, and (2) |
|||
tells the user that there is no warranty for the work (except to the |
|||
extent that warranties are provided), that licensees may convey the |
|||
work under this License, and how to view a copy of this License. If |
|||
the interface presents a list of user commands or options, such as a |
|||
menu, a prominent item in the list meets this criterion. |
|||
|
|||
\subsubsection*{1. Source Code.} |
|||
|
|||
The ``source code'' for a work means the preferred form of the work |
|||
for making modifications to it. ``Object code'' means any non-source |
|||
form of a work. |
|||
|
|||
A ``Standard Interface'' means an interface that either is an official |
|||
standard defined by a recognized standards body, or, in the case of |
|||
interfaces specified for a particular programming language, one that |
|||
is widely used among developers working in that language. |
|||
|
|||
The ``System Libraries'' of an executable work include anything, other |
|||
than the work as a whole, that (a) is included in the normal form of |
|||
packaging a Major Component, but which is not part of that Major |
|||
Component, and (b) serves only to enable use of the work with that |
|||
Major Component, or to implement a Standard Interface for which an |
|||
implementation is available to the public in source code form. A |
|||
``Major Component'', in this context, means a major essential component |
|||
(kernel, window system, and so on) of the specific operating system |
|||
(if any) on which the executable work runs, or a compiler used to |
|||
produce the work, or an object code interpreter used to run it. |
|||
|
|||
The ``Corresponding Source'' for a work in object code form means all |
|||
the source code needed to generate, install, and (for an executable |
|||
work) run the object code and to modify the work, including scripts to |
|||
control those activities. However, it does not include the work's |
|||
System Libraries, or general-purpose tools or generally available free |
|||
programs which are used unmodified in performing those activities but |
|||
which are not part of the work. For example, Corresponding Source |
|||
includes interface definition files associated with source files for |
|||
the work, and the source code for shared libraries and dynamically |
|||
linked subprograms that the work is specifically designed to require, |
|||
such as by intimate data communication or control flow between those |
|||
subprograms and other parts of the work. |
|||
|
|||
The Corresponding Source need not include anything that users |
|||
can regenerate automatically from other parts of the Corresponding |
|||
Source. |
|||
|
|||
The Corresponding Source for a work in source code form is that |
|||
same work. |
|||
|
|||
\subsubsection*{2. Basic Permissions.} |
|||
|
|||
All rights granted under this License are granted for the term of |
|||
copyright on the Program, and are irrevocable provided the stated |
|||
conditions are met. This License explicitly affirms your unlimited |
|||
permission to run the unmodified Program. The output from running a |
|||
covered work is covered by this License only if the output, given its |
|||
content, constitutes a covered work. This License acknowledges your |
|||
rights of fair use or other equivalent, as provided by copyright law. |
|||
|
|||
You may make, run and propagate covered works that you do not |
|||
convey, without conditions so long as your license otherwise remains |
|||
in force. You may convey covered works to others for the sole purpose |
|||
of having them make modifications exclusively for you, or provide you |
|||
with facilities for running those works, provided that you comply with |
|||
the terms of this License in conveying all material for which you do |
|||
not control copyright. Those thus making or running the covered works |
|||
for you must do so exclusively on your behalf, under your direction |
|||
and control, on terms that prohibit them from making any copies of |
|||
your copyrighted material outside their relationship with you. |
|||
|
|||
Conveying under any other circumstances is permitted solely under |
|||
the conditions stated below. Sublicensing is not allowed; section 10 |
|||
makes it unnecessary. |
|||
|
|||
\subsubsection*{3. Protecting Users' Legal Rights From |
|||
Anti-Circumvention Law.} |
|||
|
|||
No covered work shall be deemed part of an effective technological |
|||
measure under any applicable law fulfilling obligations under article |
|||
11 of the WIPO copyright treaty adopted on 20 December 1996, or |
|||
similar laws prohibiting or restricting circumvention of such |
|||
measures. |
|||
|
|||
When you convey a covered work, you waive any legal power to forbid |
|||
circumvention of technological measures to the extent such circumvention |
|||
is effected by exercising rights under this License with respect to |
|||
the covered work, and you disclaim any intention to limit operation or |
|||
modification of the work as a means of enforcing, against the work's |
|||
users, your or third parties' legal rights to forbid circumvention of |
|||
technological measures. |
|||
|
|||
\subsubsection*{4. Conveying Verbatim Copies.} |
|||
|
|||
You may convey verbatim copies of the Program's source code as you |
|||
receive it, in any medium, provided that you conspicuously and |
|||
appropriately publish on each copy an appropriate copyright notice; |
|||
keep intact all notices stating that this License and any |
|||
non-permissive terms added in accord with section 7 apply to the code; |
|||
keep intact all notices of the absence of any warranty; and give all |
|||
recipients a copy of this License along with the Program. |
|||
|
|||
You may charge any price or no price for each copy that you convey, |
|||
and you may offer support or warranty protection for a fee. |
|||
|
|||
\subsubsection*{5. Conveying Modified Source Versions.} |
|||
|
|||
You may convey a work based on the Program, or the modifications to |
|||
produce it from the Program, in the form of source code under the |
|||
terms of section 4, provided that you also meet all of these conditions: |
|||
|
|||
a) The work must carry prominent notices stating that you modified |
|||
it, and giving a relevant date. |
|||
|
|||
b) The work must carry prominent notices stating that it is |
|||
released under this License and any conditions added under section |
|||
7. This requirement modifies the requirement in section 4 to |
|||
``keep intact all notices''. |
|||
|
|||
c) You must license the entire work, as a whole, under this |
|||
License to anyone who comes into possession of a copy. This |
|||
License will therefore apply, along with any applicable section 7 |
|||
additional terms, to the whole of the work, and all its parts, |
|||
regardless of how they are packaged. This License gives no |
|||
permission to license the work in any other way, but it does not |
|||
invalidate such permission if you have separately received it. |
|||
|
|||
d) If the work has interactive user interfaces, each must display |
|||
Appropriate Legal Notices; however, if the Program has interactive |
|||
interfaces that do not display Appropriate Legal Notices, your |
|||
work need not make them do so. |
|||
|
|||
A compilation of a covered work with other separate and independent |
|||
works, which are not by their nature extensions of the covered work, |
|||
and which are not combined with it such as to form a larger program, |
|||
in or on a volume of a storage or distribution medium, is called an |
|||
``aggregate'' if the compilation and its resulting copyright are not |
|||
used to limit the access or legal rights of the compilation's users |
|||
beyond what the individual works permit. Inclusion of a covered work |
|||
in an aggregate does not cause this License to apply to the other |
|||
parts of the aggregate. |
|||
|
|||
\subsubsection*{6. Conveying Non-Source Forms.} |
|||
|
|||
You may convey a covered work in object code form under the terms |
|||
of sections 4 and 5, provided that you also convey the |
|||
machine-readable Corresponding Source under the terms of this License, |
|||
in one of these ways: |
|||
|
|||
a) Convey the object code in, or embodied in, a physical product |
|||
(including a physical distribution medium), accompanied by the |
|||
Corresponding Source fixed on a durable physical medium |
|||
customarily used for software interchange. |
|||
|
|||
b) Convey the object code in, or embodied in, a physical product |
|||
(including a physical distribution medium), accompanied by a |
|||
written offer, valid for at least three years and valid for as |
|||
long as you offer spare parts or customer support for that product |
|||
model, to give anyone who possesses the object code either (1) a |
|||
copy of the Corresponding Source for all the software in the |
|||
product that is covered by this License, on a durable physical |
|||
medium customarily used for software interchange, for a price no |
|||
more than your reasonable cost of physically performing this |
|||
conveying of source, or (2) access to copy the |
|||
Corresponding Source from a network server at no charge. |
|||
|
|||
c) Convey individual copies of the object code with a copy of the |
|||
written offer to provide the Corresponding Source. This |
|||
alternative is allowed only occasionally and noncommercially, and |
|||
only if you received the object code with such an offer, in accord |
|||
with subsection 6b. |
|||
|
|||
d) Convey the object code by offering access from a designated |
|||
place (gratis or for a charge), and offer equivalent access to the |
|||
Corresponding Source in the same way through the same place at no |
|||
further charge. You need not require recipients to copy the |
|||
Corresponding Source along with the object code. If the place to |
|||
copy the object code is a network server, the Corresponding Source |
|||
may be on a different server (operated by you or a third party) |
|||
that supports equivalent copying facilities, provided you maintain |
|||
clear directions next to the object code saying where to find the |
|||
Corresponding Source. Regardless of what server hosts the |
|||
Corresponding Source, you remain obligated to ensure that it is |
|||
available for as long as needed to satisfy these requirements. |
|||
|
|||
e) Convey the object code using peer-to-peer transmission, provided |
|||
you inform other peers where the object code and Corresponding |
|||
Source of the work are being offered to the general public at no |
|||
charge under subsection 6d. |
|||
|
|||
A separable portion of the object code, whose source code is excluded |
|||
from the Corresponding Source as a System Library, need not be |
|||
included in conveying the object code work. |
|||
|
|||
A ``User Product'' is either (1) a ``consumer product'', which means |
|||
any tangible personal property which is normally used for personal, |
|||
family, or household purposes, or (2) anything designed or sold for |
|||
incorporation into a dwelling. In determining whether a product is a |
|||
consumer product, doubtful cases shall be resolved in favor of coverage. |
|||
For a particular product received by a particular user, ``normally |
|||
used'' refers to a typical or common use of that class of product, |
|||
regardless of the status of the particular user or of the way in which |
|||
the particular user actually uses, or expects or is expected to use, the |
|||
product. A product is a consumer product regardless of whether the |
|||
product has substantial commercial, industrial or non-consumer uses, |
|||
unless such uses represent the only significant mode of use of the |
|||
product. |
|||
|
|||
``Installation Information'' for a User Product means any methods, |
|||
procedures, authorization keys, or other information required to install |
|||
and execute modified versions of a covered work in that User Product |
|||
from a modified version of its Corresponding Source. The information |
|||
must suffice to ensure that the continued functioning of the modified |
|||
object code is in no case prevented or interfered with solely because |
|||
modification has been made. |
|||
|
|||
If you convey an object code work under this section in, or with, or |
|||
specifically for use in, a User Product, and the conveying occurs as |
|||
part of a transaction in which the right of possession and use of the |
|||
User Product is transferred to the recipient in perpetuity or for a |
|||
fixed term (regardless of how the transaction is characterized), the |
|||
Corresponding Source conveyed under this section must be accompanied |
|||
by the Installation Information. But this requirement does not apply |
|||
if neither you nor any third party retains the ability to install |
|||
modified object code on the User Product (for example, the work has |
|||
been installed in ROM). |
|||
|
|||
The requirement to provide Installation Information does not include a |
|||
requirement to continue to provide support service, warranty, or updates |
|||
for a work that has been modified or installed by the recipient, or for |
|||
the User Product in which it has been modified or installed. Access to |
|||
a network may be denied when the modification itself materially and |
|||
adversely affects the operation of the network or violates the rules and |
|||
protocols for communication across the network. |
|||
|
|||
Corresponding Source conveyed, and Installation Information provided, |
|||
in accord with this section must be in a format that is publicly |
|||
documented (and with an implementation available to the public in |
|||
source code form), and must require no special password or key for |
|||
unpacking, reading or copying. |
|||
|
|||
\subsubsection*{7. Additional Terms.} |
|||
|
|||
``Additional permissions'' are terms that supplement the terms of this |
|||
License by making exceptions from one or more of its conditions. |
|||
Additional permissions that are applicable to the entire Program shall |
|||
be treated as though they were included in this License, to the extent |
|||
that they are valid under applicable law. If additional permissions |
|||
apply only to part of the Program, that part may be used separately |
|||
under those permissions, but the entire Program remains governed by |
|||
this License without regard to the additional permissions. |
|||
|
|||
When you convey a copy of a covered work, you may at your option |
|||
remove any additional permissions from that copy, or from any part of |
|||
it. (Additional permissions may be written to require their own |
|||
removal in certain cases when you modify the work.) You may place |
|||
additional permissions on material, added by you to a covered work, |
|||
for which you have or can give appropriate copyright permission. |
|||
|
|||
Notwithstanding any other provision of this License, for material you |
|||
add to a covered work, you may (if authorized by the copyright holders |
|||
of that material) supplement the terms of this License with terms: |
|||
|
|||
a) Disclaiming warranty or limiting liability differently from the |
|||
terms of sections 15 and 16 of this License; or |
|||
|
|||
b) Requiring preservation of specified reasonable legal notices or |
|||
author attributions in that material or in the Appropriate Legal |
|||
Notices displayed by works containing it; or |
|||
|
|||
c) Prohibiting misrepresentation of the origin of that material, or |
|||
requiring that modified versions of such material be marked in |
|||
reasonable ways as different from the original version; or |
|||
|
|||
d) Limiting the use for publicity purposes of names of licensors or |
|||
authors of the material; or |
|||
|
|||
e) Declining to grant rights under trademark law for use of some |
|||
trade names, trademarks, or service marks; or |
|||
|
|||
f) Requiring indemnification of licensors and authors of that |
|||
material by anyone who conveys the material (or modified versions of |
|||
it) with contractual assumptions of liability to the recipient, for |
|||
any liability that these contractual assumptions directly impose on |
|||
those licensors and authors. |
|||
|
|||
All other non-permissive additional terms are considered ``further |
|||
restrictions'' within the meaning of section 10. If the Program as you |
|||
received it, or any part of it, contains a notice stating that it is |
|||
governed by this License along with a term that is a further |
|||
restriction, you may remove that term. If a license document contains |
|||
a further restriction but permits relicensing or conveying under this |
|||
License, you may add to a covered work material governed by the terms |
|||
of that license document, provided that the further restriction does |
|||
not survive such relicensing or conveying. |
|||
|
|||
If you add terms to a covered work in accord with this section, you |
|||
must place, in the relevant source files, a statement of the |
|||
additional terms that apply to those files, or a notice indicating |
|||
where to find the applicable terms. |
|||
|
|||
Additional terms, permissive or non-permissive, may be stated in the |
|||
form of a separately written license, or stated as exceptions; |
|||
the above requirements apply either way. |
|||
|
|||
\subsubsection*{8. Termination.} |
|||
|
|||
You may not propagate or modify a covered work except as expressly |
|||
provided under this License. Any attempt otherwise to propagate or |
|||
modify it is void, and will automatically terminate your rights under |
|||
this License (including any patent licenses granted under the third |
|||
paragraph of section 11). |
|||
|
|||
However, if you cease all violation of this License, then your |
|||
license from a particular copyright holder is reinstated (a) |
|||
provisionally, unless and until the copyright holder explicitly and |
|||
finally terminates your license, and (b) permanently, if the copyright |
|||
holder fails to notify you of the violation by some reasonable means |
|||
prior to 60 days after the cessation. |
|||
|
|||
Moreover, your license from a particular copyright holder is |
|||
reinstated permanently if the copyright holder notifies you of the |
|||
violation by some reasonable means, this is the first time you have |
|||
received notice of violation of this License (for any work) from that |
|||
copyright holder, and you cure the violation prior to 30 days after |
|||
your receipt of the notice. |
|||
|
|||
Termination of your rights under this section does not terminate the |
|||
licenses of parties who have received copies or rights from you under |
|||
this License. If your rights have been terminated and not permanently |
|||
reinstated, you do not qualify to receive new licenses for the same |
|||
material under section 10. |
|||
|
|||
\subsubsection*{9. Acceptance Not Required for Having Copies.} |
|||
|
|||
You are not required to accept this License in order to receive or |
|||
run a copy of the Program. Ancillary propagation of a covered work |
|||
occurring solely as a consequence of using peer-to-peer transmission |
|||
to receive a copy likewise does not require acceptance. However, |
|||
nothing other than this License grants you permission to propagate or |
|||
modify any covered work. These actions infringe copyright if you do |
|||
not accept this License. Therefore, by modifying or propagating a |
|||
covered work, you indicate your acceptance of this License to do so. |
|||
|
|||
\subsubsection*{10. Automatic Licensing of Downstream Recipients.} |
|||
|
|||
Each time you convey a covered work, the recipient automatically |
|||
receives a license from the original licensors, to run, modify and |
|||
propagate that work, subject to this License. You are not responsible |
|||
for enforcing compliance by third parties with this License. |
|||
|
|||
An ``entity transaction'' is a transaction transferring control of an |
|||
organization, or substantially all assets of one, or subdividing an |
|||
organization, or merging organizations. If propagation of a covered |
|||
work results from an entity transaction, each party to that |
|||
transaction who receives a copy of the work also receives whatever |
|||
licenses to the work the party's predecessor in interest had or could |
|||
give under the previous paragraph, plus a right to possession of the |
|||
Corresponding Source of the work from the predecessor in interest, if |
|||
the predecessor has it or can get it with reasonable efforts. |
|||
|
|||
You may not impose any further restrictions on the exercise of the |
|||
rights granted or affirmed under this License. For example, you may |
|||
not impose a license fee, royalty, or other charge for exercise of |
|||
rights granted under this License, and you may not initiate litigation |
|||
(including a cross-claim or counterclaim in a lawsuit) alleging that |
|||
any patent claim is infringed by making, using, selling, offering for |
|||
sale, or importing the Program or any portion of it. |
|||
|
|||
\subsubsection*{11. Patents.} |
|||
|
|||
A ``contributor'' is a copyright holder who authorizes use under this |
|||
License of the Program or a work on which the Program is based. The |
|||
work thus licensed is called the contributor's ``contributor version''. |
|||
|
|||
A contributor's ``essential patent claims'' are all patent claims |
|||
owned or controlled by the contributor, whether already acquired or |
|||
hereafter acquired, that would be infringed by some manner, permitted |
|||
by this License, of making, using, or selling its contributor version, |
|||
but do not include claims that would be infringed only as a |
|||
consequence of further modification of the contributor version. For |
|||
purposes of this definition, ``control'' includes the right to grant |
|||
patent sublicenses in a manner consistent with the requirements of |
|||
this License. |
|||
|
|||
Each contributor grants you a non-exclusive, worldwide, royalty-free |
|||
patent license under the contributor's essential patent claims, to |
|||
make, use, sell, offer for sale, import and otherwise run, modify and |
|||
propagate the contents of its contributor version. |
|||
|
|||
In the following three paragraphs, a ``patent license'' is any express |
|||
agreement or commitment, however denominated, not to enforce a patent |
|||
(such as an express permission to practice a patent or covenant not to |
|||
sue for patent infringement). To ``grant'' such a patent license to a |
|||
party means to make such an agreement or commitment not to enforce a |
|||
patent against the party. |
|||
|
|||
If you convey a covered work, knowingly relying on a patent license, |
|||
and the Corresponding Source of the work is not available for anyone |
|||
to copy, free of charge and under the terms of this License, through a |
|||
publicly available network server or other readily accessible means, |
|||
then you must either (1) cause the Corresponding Source to be so |
|||
available, or (2) arrange to deprive yourself of the benefit of the |
|||
patent license for this particular work, or (3) arrange, in a manner |
|||
consistent with the requirements of this License, to extend the patent |
|||
license to downstream recipients. ``Knowingly relying'' means you have |
|||
actual knowledge that, but for the patent license, your conveying the |
|||
covered work in a country, or your recipient's use of the covered work |
|||
in a country, would infringe one or more identifiable patents in that |
|||
country that you have reason to believe are valid. |
|||
|
|||
If, pursuant to or in connection with a single transaction or |
|||
arrangement, you convey, or propagate by procuring conveyance of, a |
|||
covered work, and grant a patent license to some of the parties |
|||
receiving the covered work authorizing them to use, propagate, modify |
|||
or convey a specific copy of the covered work, then the patent license |
|||
you grant is automatically extended to all recipients of the covered |
|||
work and works based on it. |
|||
|
|||
A patent license is ``discriminatory'' if it does not include within |
|||
the scope of its coverage, prohibits the exercise of, or is |
|||
conditioned on the non-exercise of one or more of the rights that are |
|||
specifically granted under this License. You may not convey a covered |
|||
work if you are a party to an arrangement with a third party that is |
|||
in the business of distributing software, under which you make payment |
|||
to the third party based on the extent of your activity of conveying |
|||
the work, and under which the third party grants, to any of the |
|||
parties who would receive the covered work from you, a discriminatory |
|||
patent license (a) in connection with copies of the covered work |
|||
conveyed by you (or copies made from those copies), or (b) primarily |
|||
for and in connection with specific products or compilations that |
|||
contain the covered work, unless you entered into that arrangement, |
|||
or that patent license was granted, prior to 28 March 2007. |
|||
|
|||
Nothing in this License shall be construed as excluding or limiting |
|||
any implied license or other defenses to infringement that may |
|||
otherwise be available to you under applicable patent law. |
|||
|
|||
\subsubsection*{12. No Surrender of Others' Freedom.} |
|||
|
|||
If conditions are imposed on you (whether by court order, agreement or |
|||
otherwise) that contradict the conditions of this License, they do not |
|||
excuse you from the conditions of this License. If you cannot convey a |
|||
covered work so as to satisfy simultaneously your obligations under this |
|||
License and any other pertinent obligations, then as a consequence you |
|||
may not convey it at all. For example, if you agree to terms that |
|||
obligate you to collect a royalty for further conveying from those to |
|||
whom you convey the Program, the only way you could satisfy both those |
|||
terms and this License would be to refrain entirely from conveying the |
|||
Program. |
|||
|
|||
\subsubsection*{13. Use with the GNU Affero General Public License.} |
|||
|
|||
Notwithstanding any other provision of this License, you have |
|||
permission to link or combine any covered work with a work licensed |
|||
under version 3 of the GNU Affero General Public License into a single |
|||
combined work, and to convey the resulting work. The terms of this |
|||
License will continue to apply to the part which is the covered work, |
|||
but the special requirements of the GNU Affero General Public License, |
|||
section 13, concerning interaction through a network will apply to the |
|||
combination as such. |
|||
|
|||
\subsubsection*{14. Revised Versions of this License.} |
|||
|
|||
The Free Software Foundation may publish revised and/or new versions |
|||
of the GNU General Public License from time to time. Such new versions |
|||
will be similar in spirit to the present version, but may differ in |
|||
detail to address new problems or concerns. |
|||
|
|||
Each version is given a distinguishing version number. If the |
|||
Program specifies that a certain numbered version of the GNU General |
|||
Public License ``or any later version'' applies to it, you have the |
|||
option of following the terms and conditions either of that numbered |
|||
version or of any later version published by the Free Software |
|||
Foundation. If the Program does not specify a version number of the |
|||
GNU General Public License, you may choose any version ever published |
|||
by the Free Software Foundation. |
|||
|
|||
If the Program specifies that a proxy can decide which future |
|||
versions of the GNU General Public License can be used, that proxy's |
|||
public statement of acceptance of a version permanently authorizes you |
|||
to choose that version for the Program. |
|||
|
|||
Later license versions may give you additional or different |
|||
permissions. However, no additional obligations are imposed on any |
|||
author or copyright holder as a result of your choosing to follow a |
|||
later version. |
|||
|
|||
\subsubsection*{15. Disclaimer of Warranty.} |
|||
|
|||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY |
|||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT |
|||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM ``AS IS'' WITHOUT |
|||
WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT |
|||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A |
|||
PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE |
|||
OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU |
|||
ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. |
|||
|
|||
\subsubsection*{16. Limitation of Liability.} |
|||
|
|||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING |
|||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR |
|||
CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, |
|||
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES |
|||
ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT |
|||
NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES |
|||
SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE |
|||
WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN |
|||
ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. |
|||
|
|||
\subsubsection*{17. Interpretation of Sections 15 and 16.} |
|||
|
|||
If the disclaimer of warranty and limitation of liability provided |
|||
above cannot be given local legal effect according to their terms, |
|||
reviewing courts shall apply local law that most closely approximates |
|||
an absolute waiver of all civil liability in connection with the |
|||
Program, unless a warranty or assumption of liability accompanies a |
|||
copy of the Program in return for a fee. |
|||
|
|||
\section*{END OF TERMS AND CONDITIONS} |
|||
|
|||
\newpage |
|||
|
|||
\section*{How to Apply These Terms to Your New Programs} |
|||
|
|||
If you develop a new program, and you want it to be of the greatest |
|||
possible use to the public, the best way to achieve this is to make it |
|||
free software which everyone can redistribute and change under these |
|||
terms. |
|||
|
|||
To do so, attach the following notices to the program. It is safest |
|||
to attach them to the start of each source file to most effectively |
|||
state the exclusion of warranty; and each file should have at least |
|||
the ``copyright'' line and a pointer to where the full notice is found. |
|||
|
|||
\begin{verbatim} |
|||
<one line to give the program's name and a brief idea of what it does.> |
|||
Copyright (C) <year> <name of author> |
|||
|
|||
This program is free software: you can redistribute it and/or modify |
|||
it under the terms of the GNU General Public License as published by |
|||
the Free Software Foundation, either version 3 of the License, or |
|||
(at your option) any later version. |
|||
|
|||
This program is distributed in the hope that it will be useful, |
|||
but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
GNU General Public License for more details. |
|||
|
|||
You should have received a copy of the GNU General Public License |
|||
along with this program. If not, see <http://www.gnu.org/licenses/>. |
|||
\end{verbatim} |
|||
|
|||
Also add information on how to contact you by electronic and paper mail. |
|||
|
|||
If the program does terminal interaction, make it output a short |
|||
notice like this when it starts in an interactive mode: |
|||
|
|||
\begin{verbatim} |
|||
<program> Copyright (C) <year> <name of author> |
|||
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. |
|||
This is free software, and you are welcome to redistribute it |
|||
under certain conditions; type `show c' for details. |
|||
\end{verbatim} |
|||
|
|||
\noindent |
|||
The hypothetical commands `show w' and `show c' should show the |
|||
appropriate parts of the General Public License. Of course, your |
|||
program's commands might be different; for a GUI interface, you would |
|||
use an ``about box''. |
|||
|
|||
You should also get your employer (if you work as a programmer) or |
|||
school, if any, to sign a ``copyright disclaimer'' for the program, if |
|||
necessary. For more information on this, and how to apply and follow the |
|||
GNU GPL, see \verb|<http://www.gnu.org/licenses/>|. |
|||
|
|||
The GNU General Public License does not permit incorporating your |
|||
program into proprietary programs. If your program is a subroutine |
|||
library, you may consider it more useful to permit linking proprietary |
|||
applications with the library. If this is what you want to do, use the |
|||
GNU Lesser General Public License instead of this License. But first, |
|||
please read \verb|<http://www.gnu.org/philosophy/why-not-lgpl.html>|. |
|||
|
|||
\end{footnotesize} |
|||
|
|||
%* eof *% |
4295
resources/3rdparty/glpk-4.57/doc/gmpl.tex
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
3233
resources/3rdparty/glpk-4.57/doc/gmpl_es.tex
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
4150
resources/3rdparty/glpk-4.57/doc/graphs.tex
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
@ -0,0 +1,135 @@ |
|||
Solver: GLPSOL 4.40 (options used: --pcost) |
|||
Computer: Intel Pentium 4, 3.0 GHz |
|||
Platform: Cygwin 1.5.25 |
|||
Compiler: GCC 3.4.4 (options used: -O3) |
|||
Test set: MIPLIB 2.0 <http://miplib.zib.de/miplib3/miplib/> |
|||
|
|||
Problem Optimal Solution Cuts Used Nodes Iters Time,s Mem,MB |
|||
-------- ---------------- --------- -------- ------ ------ ------ |
|||
air01 +6.796000000e+03 3 41 < 1 1.2 |
|||
air02 +7.810000000e+03 43 201 6 13.8 |
|||
air03 +3.401600000e+05 33 414 12 21.0 |
|||
air04 +5.613700000e+04 1901 109800 396 32.4 |
|||
air05 +2.637400000e+04 6445 201649 452 45.0 |
|||
air06 +4.964900000e+04 11 6868 31 18.1 |
|||
bell3a +8.784303160e+05 --gomory 7965 42363 17 6.1 |
|||
bell3b +1.178616062e+07 --gomory 6031 30467 19 3.2 |
|||
bell4 +1.854148420e+07 --gomory 7203 25019 16 2.9 |
|||
bell5 +8.966406492e+06 --gomory 5605 18555 8 1.5 |
|||
bm23 +3.400000000e+01 373 878 < 1 0.2 |
|||
cracpb1 +2.219900000e+04 47 5258 2 1.3 |
|||
dcmulti +1.881820000e+05 743 3366 2 1.1 |
|||
diamond infeasible 3 4 < 1 0.1 |
|||
dsbmip -3.051981750e+02 --mir 217 46088 24 4.5 |
|||
egout +5.681007000e+02 91 137 < 1 0.3 |
|||
enigma +0.000000000e+00 16419 55071 6 3.2 |
|||
fixnet3 +5.197300000e+04 81 380 < 1 1.4 |
|||
fixnet4 +8.936000000e+03 211 1095 1 1.4 |
|||
fixnet6 +3.983000000e+03 1031 3136 2 1.7 |
|||
flugpl +1.201500000e+06 397 231 < 1 0.1 |
|||
gen +1.123133627e+05 195 3991 1 1.7 |
|||
khb05250 +1.069402260e+08 2163 14498 5 2.8 |
|||
l152lav +4.722000000e+03 7419 95299 68 12.0 |
|||
lp4l +2.967000000e+03 173 1331 2 1.7 |
|||
lseu +1.120000000e+03 10821 31954 5 2.5 |
|||
misc01 +5.635000000e+02 769 4593 1 0.5 |
|||
misc02 +1.690000000e+03 29 282 < 1 0.2 |
|||
misc03 +3.360000000e+03 957 6742 2 1.1 |
|||
misc04 +2.666699247e+03 17 2052 1 7.0 |
|||
misc05 +2.984500000e+03 293 2520 1 1.1 |
|||
misc06 +1.285086074e+04 57 941 < 1 2.7 |
|||
misc07 +2.810000000e+03 --mir 66075 579129 424 33.4 |
|||
mod008 +3.070000000e+02 8185 24245 8 2.3 |
|||
mod010 +6.548000000e+03 315 6283 7 5.3 |
|||
mod011 |
|||
mod013 +2.809500000e+02 545 1155 < 1 0.3 |
|||
modglob +2.074050809e+07 --mir 5197 31985 20 2.8 |
|||
noswot |
|||
p0033 +3.089000000e+03 305 955 < 1 0.2 |
|||
p0040 +6.202700000e+04 17 66 < 1 0.1 |
|||
p0201 +7.615000000e+03 521 3660 1 0.9 |
|||
p0282 +2.584110000e+05 623 1204 1 0.8 |
|||
p0291 +5.223749000e+03 71 154 < 1 0.7 |
|||
p0548 +8.691000000e+03 7617 23556 9 2.9 |
|||
p2756 +3.124000000e+03 --mir 3911 15157 57 10.9 |
|||
p6000 -2.451377000e+06 19209 40906 570 15.8 |
|||
pipex +7.882630000e+02 1569 2469 < 1 0.4 |
|||
qiu -1.328731369e+02 80473 1918742 1174 69.2 |
|||
rentacar +3.035676098e+07 43 1649 3 12.1 |
|||
rgn +8.219999924e+01 3325 18700 2 1.2 |
|||
sample2 +3.750000000e+02 163 347 < 1 0.2 |
|||
sentoy -7.772000000e+03 335 723 < 1 0.4 |
|||
set1al +1.586975000e+04 --mir 17 532 < 1 1.5 |
|||
set1ch |
|||
set1cl +6.484250000e+03 --mir 1 502 < 1 1.1 |
|||
stein15 +9.000000000e+00 87 375 < 1 0.2 |
|||
stein27 +1.800000000e+01 3255 15327 2 1.0 |
|||
stein45 +3.000000000e+01 52301 389140 139 19.2 |
|||
stein9 +5.000000000e+00 17 45 < 1 0.1 |
|||
vpm1 +2.000000000e+01 --mir 9 836 < 1 0.9 |
|||
|
|||
PROBLEM CHARACTERISTICS |
|||
|
|||
Problem Rows Cols ( Int 0/1) Nonz Best Solution |
|||
-------- ------ ---------------------- ------ -------------------------- |
|||
air01 24 771 ( all all) 4986 6796 (opt) |
|||
air02 51 6774 ( all all) 68329 7810 (opt) |
|||
air03 125 10757 ( all all) 101785 340160 (opt) |
|||
air04 824 8904 ( all all) 81869 56138 (opt) |
|||
air05 427 7195 ( all all) 59316 26402 (not opt) |
|||
air06 826 8627 ( all all) 79433 49649 (opt) |
|||
bell3a 124 133 ( 71 39) 441 878430.32 (opt) |
|||
bell3b 124 133 ( 71 39) 441 11786160.62 (opt) |
|||
bell4 106 117 ( 64 34) 385 18541484.20 (opt) |
|||
bell5 92 104 ( 58 30) 340 8966406.49 (opt) |
|||
bm23 21 27 ( all all) 505 34 (opt) |
|||
cracpb1 144 572 ( all all) 4730 22199 (opt) |
|||
dcmulti 291 548 ( 75 all) 1833 188182.0000 (opt) |
|||
diamond 5 2 ( all all) 9 integer infeasible |
|||
dsbmip 1855 1886 ( 192 160) 9768 -305.198 (opt) |
|||
egout 99 141 ( 55 all) 392 568.101 (opt) |
|||
enigma 22 100 ( all all) 298 0.0 (opt) |
|||
fixnet3 479 878 ( 378 all) 2631 51973 (opt) |
|||
fixnet4 479 878 ( 378 all) 2621 8936 (opt) |
|||
fixnet6 479 878 ( 378 all) 2550 3983 (opt) |
|||
flugpl 19 18 ( 11 none) 64 1201500 (opt) |
|||
gen 781 870 ( 150 144) 3174 112313 (opt) |
|||
khb05250 102 1350 ( 24 all) 3973 106940226 (opt) |
|||
l152lav 98 1989 ( all all) 11911 4750 (not opt) |
|||
lp4l 86 1086 ( all all) 5763 2967 (opt) |
|||
lseu 29 89 ( all all) 394 1120 (opt) |
|||
misc01 55 83 ( 82 all) 746 563.5 (opt) |
|||
misc02 40 59 ( 58 all) 414 1690 (opt) |
|||
misc03 97 160 ( 159 all) 2054 3360 (opt) |
|||
misc04 1726 4897 ( 30 all) 17253 2666.699 (opt) |
|||
misc05 301 136 ( 74 all) 2946 2984.5 (opt) |
|||
misc06 821 1808 ( 112 all) 5860 12850.8607 (opt) |
|||
misc07 213 260 ( 259 all) 8620 2810 (not opt) |
|||
mod008 7 319 ( all all) 1562 307 (opt) |
|||
mod010 147 2655 ( all all) 13858 6548 (opt) |
|||
mod011 4482 10958 ( 96 all) 37425 -54558535 (opt) |
|||
mod013 63 96 ( 48 all) 288 280.95 (opt) |
|||
modglob 292 422 ( 98 all) 1390 20740508 (opt) |
|||
noswot 183 128 ( 100 75) 760 -43 (opt) |
|||
p0033 17 33 ( all all) 131 3089 (opt) |
|||
p0040 24 40 ( all all) 150 62027 (opt) |
|||
p0201 134 201 ( all all) 2124 7615 (opt) |
|||
p0282 242 282 ( all all) 2248 258411 (opt) |
|||
p0291 253 291 ( all all) 349 5223.7490 (opt) |
|||
p0548 177 548 ( all all) 2127 8691 (opt) |
|||
p2756 756 2756 ( all all) 11103 3124 (opt) |
|||
p6000 2177 6000 ( all all) 54238 -2451377 (opt) |
|||
pipex 26 48 ( all all) 240 788.263 (opt) |
|||
qiu 1193 840 ( 48 all) 3432 -132.873137 (opt) |
|||
rentacar 6804 9557 ( 55 all) 42019 30356761 (opt) |
|||
rgn 25 180 ( 100 all) 540 82.1999 (opt) |
|||
sample2 46 67 ( 21 all) 179 375 (opt) |
|||
sentoy 31 60 ( all all) 1860 -7772 (opt) |
|||
set1al 493 712 ( 240 all) 1884 15869.7 (opt) |
|||
set1ch 493 712 ( 240 all) 1884 54537.7 (opt) |
|||
set1cl 493 712 ( 240 all) 1884 6484.25 (opt) |
|||
stein15 37 15 ( all all) 135 9 (opt) |
|||
stein27 119 27 ( all all) 405 18 (opt) |
|||
stein45 332 45 ( all all) 1079 30 (opt) |
|||
stein9 14 9 ( all all) 54 5 (opt) |
|||
vpm1 235 378 ( 168 all) 917 20 (opt) |
@ -0,0 +1,143 @@ |
|||
Solver: GLPSOL 4.40 |
|||
Computer: Intel Pentium 4, 3.0 GHz |
|||
Platform: Cygwin 1.5.25 |
|||
Compiler: GCC 3.4.4 (options used: -O3) |
|||
Test set: MIPLIB 3.0 <http://miplib.zib.de/miplib3/miplib.html> |
|||
|
|||
Problem Optimal Solution Options Used Nodes Iters Time,s Mem,MB |
|||
-------- ---------------- ---------------- -------- ------ ------ ------ |
|||
10teams +9.240000000e+02 --pcost --gomory 6013 349276 207 12.7 |
|||
air03 +3.401600000e+05 --pcost 33 414 12 21.0 |
|||
air04 +5.613700000e+04 --pcost 1901 109800 396 32.4 |
|||
air05 +2.637400000e+04 --pcost 6445 201649 452 45.0 |
|||
arki001 |
|||
bell3a +8.784303160e+05 --pcost --gomory 7965 42363 17 6.1 |
|||
bell5 +8.966406492e+06 --pcost --gomory 5605 18555 8 1.5 |
|||
blend2 +7.598985000e+00 --pcost 7185 24256 7 2.1 |
|||
cap6000 -2.451377000e+06 --pcost 19209 40906 569 15.8 |
|||
dano3mip |
|||
danoint |
|||
dcmulti +1.881820000e+05 --pcost 743 3366 2 1.1 |
|||
dsbmip -3.051981750e+02 --pcost --mir 217 46088 24 4.5 |
|||
egout +5.681007000e+02 --pcost 91 137 < 1 0.3 |
|||
enigma +0.000000000e+00 --pcost 16419 55071 6 3.2 |
|||
fast0507 |
|||
fiber +4.059351800e+05 --pcost --mir 407 3108 4 2.4 |
|||
fixnet6 +3.983000000e+03 --pcost 1031 3136 2 1.7 |
|||
flugpl +1.201500000e+06 --pcost 397 231 < 1 0.1 |
|||
gen +1.123133627e+05 --pcost 195 3991 1 1.7 |
|||
gesa2 +2.577985637e+07 --pcost --mir 59 2723 4 4.1 |
|||
gesa2_o +2.577985637e+07 --pcost --mir 69 2588 5 3.7 |
|||
gesa3 +2.799104265e+07 --pcost --mir 93 2774 5 3.7 |
|||
gesa3_o +2.799104265e+07 --pcost --mir 117 3271 6 3.6 |
|||
gt2 +2.116600000e+04 --pcost 5613 26115 2 1.2 |
|||
harp2 |
|||
khb05250 +1.069402260e+08 --pcost 2163 14498 5 2.8 |
|||
l152lav +4.722000000e+03 --pcost 7419 95299 68 12.0 |
|||
lseu +1.120000000e+03 --pcost 10821 31954 5 2.5 |
|||
marksh1 |
|||
marksh2 |
|||
mas74 |
|||
mas76 |
|||
misc03 +3.360000000e+03 --pcost 957 6742 2 1.1 |
|||
misc06 +1.285086074e+04 --pcost 57 941 < 1 2.7 |
|||
misc07 +2.810000000e+03 --pcost --mir 66075 579129 424 33.4 |
|||
mitre |
|||
mkc |
|||
mod008 +3.070000000e+02 --pcost 8185 24245 8 2.3 |
|||
mod010 +6.548000000e+03 --pcost 315 6283 7 5.3 |
|||
mod011 |
|||
modglob +2.074050809e+07 --pcost --mir 5197 31985 20 2.8 |
|||
noswot |
|||
nw04 +1.686200000e+04 (none) 361 5544 345 138.3 |
|||
p0033 +3.089000000e+03 --pcost 305 955 < 1 0.2 |
|||
p0201 +7.615000000e+03 --pcost 521 3660 1 0.9 |
|||
p0282 +2.584110000e+05 --pcost 623 1204 1 0.8 |
|||
p0548 +8.691000000e+03 --pcost 7617 23556 9 2.9 |
|||
p2756 +3.124000000e+03 --pcost --mir 3911 15157 57 10.9 |
|||
pk1 |
|||
pp08a +7.350000000e+03 --pcost --mir 663 9196 4 1.3 |
|||
pp08acut +7.350000000e+03 --pcost --mir 17233 260160 154 21.1 |
|||
qiu -1.328731369e+02 --pcost 80473 1918742 1174 69.2 |
|||
qnet1 +1.602969268e+04 --pcost --mir 183 20352 16 3.6 |
|||
qnet1_o +1.602969268e+04 --pcost --mir 75 7645 9 3.3 |
|||
rentacar +3.035676098e+07 --pcost 43 1649 3 12.1 |
|||
rgn +8.219999924e+01 --pcost 3325 18700 2 1.2 |
|||
rout |
|||
set1ch |
|||
seymour |
|||
stein27 +1.800000000e+01 --pcost 3255 15327 2 1.0 |
|||
stein45 +3.000000000e+01 --pcost 52301 389140 139 19.2 |
|||
swath |
|||
vpm1 +2.000000000e+01 --pcost --mir 9 836 < 1 0.9 |
|||
vpm2 +1.375000000e+01 --pcost --mir 11729 164856 91 9.2 |
|||
|
|||
PROBLEM CHARACTERISTICS |
|||
|
|||
Problem Rows Cols ( Int 0/1) Nonz Best Solution |
|||
-------- ------ ---------------------- ------ -------------------------- |
|||
10teams 230 2025 ( 1800 all) 12150 924 (opt) |
|||
air03 125 10757 ( all all) 101785 340160 (opt) |
|||
air04 824 8904 ( all all) 81869 56138 (opt) |
|||
air05 427 7195 ( all all) 59316 26402 (not opt) |
|||
arki001 1048 1388 ( 538 415) 20439 7580813.0459 (not opt) |
|||
bell3a 124 133 ( 71 39) 441 878430.32 (opt) |
|||
bell5 92 104 ( 58 30) 340 8966406.49 (opt) |
|||
blend2 274 353 ( 264 231) 1409 7.598985 (opt) |
|||
cap6000 2176 6000 ( all all) 48249 -2451377 (opt) |
|||
dano3mip 3202 13873 ( 552 all) 79655 728.1111 (not opt) |
|||
danoint 664 521 ( 56 all) 3232 65.67 (opt) |
|||
dcmulti 291 548 ( 75 all) 1833 188182.0000 (opt) |
|||
dsbmip 1855 1886 ( 192 160) 9768 -305.198 (opt) |
|||
egout 99 141 ( 55 all) 392 568.101 (opt) |
|||
enigma 22 100 ( all all) 298 0.0 (opt) |
|||
fast0507 507 63009 ( all all) 409439 174 (opt) |
|||
fiber 363 1298 ( 1254 all) 2944 405935.18000 (opt) |
|||
fixnet6 479 878 ( 378 all) 2550 3983 (opt) |
|||
flugpl 19 18 ( 11 none) 64 1201500 (opt) |
|||
gen 781 870 ( 150 144) 3174 112313 (opt) |
|||
gesa2 1392 1224 ( 408 240) 5064 25779856.372 (opt) |
|||
gesa2_o 1248 1224 ( 720 384) 3672 25779856.372 (opt) |
|||
gesa3 1368 1152 ( 384 216) 4944 27991042.648 (opt) |
|||
gesa3_o 1224 1152 ( 672 336) 3624 27991042.648 (opt) |
|||
gt2 29 188 ( all 24) 376 21166.000 (opt) |
|||
harp2 112 2993 ( all all) 5840 -73899798.00 (opt) |
|||
khb05250 102 1350 ( 24 all) 3973 106940226 (opt) |
|||
l152lav 98 1989 ( all all) 11911 4750 (not opt) |
|||
lseu 29 89 ( all all) 394 1120 (opt) |
|||
marksh1 7 62 ( 50 all) 324 |
|||
marksh2 8 74 ( 60 all) 448 |
|||
mas74 13 151 ( 150 all) 1705 11801.1857 (opt) |
|||
mas76 12 151 ( 150 all) 1639 40005.0541 (opt) |
|||
misc03 97 160 ( 159 all) 2054 3360 (opt) |
|||
misc06 821 1808 ( 112 all) 5860 12850.8607 (opt) |
|||
misc07 213 260 ( 259 all) 8620 2810 (not opt) |
|||
mitre 2054 10724 ( all all) 39704 115155 (opt) |
|||
mkc 3412 5325 ( 5323 all) 20621 |
|||
mod008 7 319 ( all all) 1562 307 (opt) |
|||
mod010 147 2655 ( all all) 13858 6548 (opt) |
|||
mod011 4482 10958 ( 96 all) 37425 -54558535 (opt) |
|||
modglob 292 422 ( 98 all) 1390 20740508 (opt) |
|||
noswot 183 128 ( 100 75) 760 -43 (opt) |
|||
nw04 36 87482 ( all all) 636666 16862 (opt) |
|||
p0033 17 33 ( all all) 131 3089 (opt) |
|||
p0201 134 201 ( all all) 2124 7615 (opt) |
|||
p0282 242 282 ( all all) 2248 258411 (opt) |
|||
p0548 177 548 ( all all) 2127 8691 (opt) |
|||
p2756 756 2756 ( all all) 11103 3124 (opt) |
|||
pk1 45 86 ( 55 all) 915 11 (opt) |
|||
pp08a 136 240 ( 64 all) 480 7350 (opt) |
|||
pp08acut 246 240 ( 64 all) 839 7350 (opt) |
|||
qiu 1193 840 ( 48 all) 3432 -132.873137 (opt) |
|||
qnet1 503 1541 ( 1417 1288) 4622 16029.692681 (opt) |
|||
qnet1_o 456 1541 ( 1417 1288) 4214 16029.692681 (opt) |
|||
rentacar 6804 9557 ( 55 all) 42019 30356761 (opt) |
|||
rgn 25 180 ( 100 all) 540 82.1999 (opt) |
|||
rout 291 556 ( 315 300) 2431 1077.56 (opt) |
|||
set1ch 493 712 ( 240 all) 1884 54537.7 (opt) |
|||
seymour 4944 1372 ( all all) 33549 423 (not opt) |
|||
stein27 119 27 ( all all) 405 18 (opt) |
|||
stein45 332 45 ( all all) 1079 30 (opt) |
|||
swath 885 6805 ( 6724 all) 34966 |
|||
vpm1 235 378 ( 168 all) 917 20 (opt) |
|||
vpm2 234 378 ( 168 all) 917 13.75 (opt) |
@ -0,0 +1,103 @@ |
|||
Solver: GLPSOL 4.40 (default options used) |
|||
Computer: Intel Pentium 4, 3.0 GHz |
|||
Platform: Cygwin 1.5.25 |
|||
Compiler: GCC 3.4.4 (options used: -O3) |
|||
Test set: Netlib LP collection <ftp://ftp.netlib.org/lp/data/> |
|||
|
|||
Problem Rows Cols Nonz Optimum Iters Time,s Mem,MB |
|||
-------- ----- ----- ------ ---------------- ------ ------ ------ |
|||
25fv47 822 1571 11127 +5.501845888e+03 1651 < 1 2.1 |
|||
80bau3b 2263 9799 29063 +9.872241924e+05 5358 3 6.4 |
|||
adlittle 57 97 465 +2.254949632e+05 71 < 1 0.1 |
|||
afiro 28 32 88 -4.647531429e+02 10 < 1 0.1 |
|||
agg 489 163 2541 -3.599176729e+07 100 < 1 0.5 |
|||
agg2 517 302 4515 -2.023925236e+07 178 < 1 0.8 |
|||
agg3 517 302 4531 +1.031211594e+07 182 < 1 0.8 |
|||
bandm 306 472 2659 -1.586280185e+02 252 < 1 0.6 |
|||
beaconfd 174 262 3476 +3.359248581e+04 61 < 1 0.4 |
|||
blend 75 83 521 -3.081214985e+01 41 < 1 0.1 |
|||
bnl1 644 1175 6129 +1.977629562e+03 581 < 1 1.4 |
|||
bnl2 2325 3489 16124 +1.811236540e+03 1730 1 3.7 |
|||
boeing1 351 384 3865 -3.352135675e+02 419 < 1 0.7 |
|||
boeing2 167 143 1339 -3.150187280e+02 161 < 1 0.3 |
|||
bore3d 234 315 1525 +1.373080394e+03 38 < 1 0.3 |
|||
brandy 221 249 2150 +1.518509896e+03 191 < 1 0.5 |
|||
capri 272 353 1786 +2.690012914e+03 203 < 1 0.4 |
|||
cycle 1904 2857 21322 -5.226393025e+00 953 < 1 3.5 |
|||
czprob 930 3523 14173 +2.185196699e+06 754 < 1 2.6 |
|||
d2q06c 2172 5167 35674 +1.227842108e+05 5368 7 6.2 |
|||
d6cube 416 6184 43888 +3.154916667e+02 6596 6 6.0 |
|||
degen2 445 534 4449 -1.435178000e+03 506 < 1 1.0 |
|||
degen3 1504 1818 26230 -9.872940000e+02 2205 2 4.1 |
|||
dfl001 6072 12230 41873 +1.126639605e+07 39863 117 11.0 |
|||
e226 224 282 2767 -2.586492907e+01 206 < 1 0.5 |
|||
etamacro 401 688 2489 -7.557152333e+02 444 < 1 0.7 |
|||
fffff800 525 854 6235 +5.556795648e+05 167 < 1 1.0 |
|||
finnis 498 614 2714 +1.727910656e+05 338 < 1 0.6 |
|||
fit1d 25 1026 14430 -9.146378092e+03 488 < 1 1.7 |
|||
fit1p 628 1677 10894 +9.146378092e+03 1379 < 1 1.9 |
|||
fit2d 26 10500 138018 -6.846429329e+04 5751 16 15.8 |
|||
fit2p 3001 13525 60784 +6.846429329e+04 11960 17 11.3 |
|||
forplan 162 421 4916 -6.642189613e+02 170 < 1 0.7 |
|||
ganges 1310 1681 7021 -1.095857361e+05 724 < 1 1.9 |
|||
gfrd-pnc 617 1092 3467 +6.902236000e+06 416 < 1 1.0 |
|||
greenbea 2393 5405 31499 -7.255524813e+07 3012 3 5.8 |
|||
greenbeb 2393 5405 31499 -4.302260261e+06 2153 2 5.8 |
|||
grow15 301 645 5665 -1.068709413e+08 358 < 1 1.1 |
|||
grow22 441 946 8318 -1.608343365e+08 606 < 1 1.6 |
|||
grow7 141 301 2633 -4.778781181e+07 159 < 1 0.5 |
|||
israel 175 142 2358 -8.966448219e+05 123 < 1 0.4 |
|||
kb2 44 41 291 -1.749900130e+03 38 < 1 0.1 |
|||
lotfi 154 308 1086 -2.526470606e+01 104 < 1 0.3 |
|||
maros 847 1443 10006 -5.806374370e+04 703 < 1 1.8 |
|||
maros-r7 3137 9408 151120 +1.497185166e+06 2340 5 16.7 |
|||
modszk1 688 1620 4158 +3.206197291e+02 705 < 1 1.4 |
|||
nesm 663 2923 13988 +1.407603649e+07 2240 1 2.4 |
|||
perold 626 1376 6026 -9.380755278e+03 1103 < 1 1.5 |
|||
pilot 1442 3652 43220 -5.574831533e+02 5726 11 7.8 |
|||
pilot-ja 941 1988 14706 -6.113136466e+03 1697 1 2.5 |
|||
pilot-we 723 2789 9218 -2.720107533e+06 1382 1 2.3 |
|||
pilot4 411 1000 5145 -2.581139259e+03 532 < 1 1.3 |
|||
pilot87 2031 4883 73804 +3.017103744e+02 7573 28 12.2 |
|||
pilotnov 976 2172 13129 -4.497276188e+03 988 1 2.5 |
|||
recipe 92 180 752 -2.666160000e+02 17 < 1 0.2 |
|||
sc105 106 103 281 -5.220206121e+01 51 < 1 0.2 |
|||
sc205 206 203 552 -5.220206121e+01 124 < 1 0.3 |
|||
sc50a 51 48 131 -6.457507706e+01 25 < 1 0.1 |
|||
sc50b 51 48 119 -7.000000000e+01 30 < 1 0.1 |
|||
scagr25 472 500 2029 -1.475343306e+07 352 < 1 0.7 |
|||
scagr7 130 140 553 -2.331389824e+06 94 < 1 0.2 |
|||
scfxm1 331 457 2612 +1.841675903e+04 281 < 1 0.6 |
|||
scfxm2 661 914 5229 +3.666026156e+04 587 < 1 1.1 |
|||
scfxm3 991 1371 7846 +5.490125455e+04 881 < 1 1.7 |
|||
scorpion 389 358 1708 +1.878124823e+03 146 < 1 0.4 |
|||
scrs8 491 1169 4029 +9.042969538e+02 545 < 1 1.1 |
|||
scsd1 78 760 3148 +8.666666674e+00 91 < 1 0.6 |
|||
scsd6 148 1350 5666 +5.050000008e+01 182 < 1 1.0 |
|||
scsd8 398 2750 11334 +9.049999999e+02 397 < 1 2.1 |
|||
sctap1 301 480 2052 +1.412250000e+03 196 < 1 0.5 |
|||
sctap2 1091 1880 8124 +1.724807143e+03 425 < 1 1.7 |
|||
sctap3 1481 2480 10734 +1.424000000e+03 729 < 1 2.4 |
|||
seba 516 1028 4874 +1.571160000e+04 883 < 1 1.0 |
|||
share1b 118 225 1182 -7.658931858e+04 167 < 1 0.3 |
|||
share2b 97 79 730 -4.157322407e+02 87 < 1 0.2 |
|||
shell 537 1775 4900 +1.208825346e+09 467 < 1 1.2 |
|||
ship04l 403 2118 8450 +1.793324538e+06 373 < 1 1.5 |
|||
ship04s 403 1458 5810 +1.798714700e+06 262 < 1 1.0 |
|||
ship08l 779 4283 17085 +1.909055211e+06 516 < 1 2.9 |
|||
ship08s 779 2387 9501 +1.920098211e+06 274 < 1 1.7 |
|||
ship12l 1152 5427 21597 +1.470187919e+06 686 < 1 3.7 |
|||
ship12s 1152 2763 10941 +1.489236134e+06 383 < 1 2.0 |
|||
sierra 1228 2036 9252 +1.539436218e+07 857 < 1 2.1 |
|||
stair 357 467 3857 -2.512669512e+02 399 < 1 1.0 |
|||
standata 360 1075 3038 +1.257699500e+03 140 < 1 0.7 |
|||
standgub 362 1184 3147 +1.257699500e+03 140 < 1 0.8 |
|||
standmps 468 1075 3686 +1.406017500e+03 299 < 1 0.9 |
|||
stocfor1 118 111 474 -4.113197622e+04 24 < 1 0.2 |
|||
stocfor2 2158 2031 9492 -3.902440854e+04 499 < 1 2.6 |
|||
stocfor3 16676 15695 74004 -3.997678394e+04 4456 11 19.7 |
|||
truss 1001 8806 36642 +4.588158472e+05 4744 4 6.5 |
|||
tuff 334 587 4523 +2.921477651e-01 61 < 1 0.8 |
|||
vtp-base 199 203 914 +1.298314625e+05 69 < 1 0.2 |
|||
wood1p 245 2594 70216 +1.442902412e+00 326 < 1 7.1 |
|||
woodw 1099 8405 37478 +1.304476333e+00 1093 < 1 6.0 |
@ -0,0 +1,58 @@ |
|||
alloy.mps Aluminium alloy blending |
|||
assign.mod Assignment problem |
|||
bpp.mod Bin packing problem |
|||
cal.mod Print an ASCII calendar of the given year |
|||
cf12a.mod Curve fitting problem |
|||
cf12b.mod Curve fitting problem |
|||
cflsq.mod Curve fitting problem by least squares |
|||
color.mod Graph coloring problem |
|||
cpp.mod Critical path problem |
|||
crypto.mod A crypto-arithmetic puzzle |
|||
dea.mod Data envelopment analysis (DEA) |
|||
diet.mod Stigler's nutrition model |
|||
dist.mod A product distribution model |
|||
egypt.mod A static model for fertilizer production |
|||
fctp.mod Fixed-charge transportation problem |
|||
food.mod Food manufacture model |
|||
food2.mod Food manufacture model |
|||
furnace.mps Electric-arc furnace steelmaking |
|||
gap.mod Generalized assignment problem |
|||
graph.mod Graph visualization |
|||
hashi.mod A solver for the Japanese number-puzzle Hashiwokakero |
|||
huge.mod Arithmetic mean of a large number of integers |
|||
icecream.mps Ice cream blending |
|||
jssp.mod Job-shop scheduling problem |
|||
magic.mod Magic square |
|||
maxcut.mod Maximum cut problem |
|||
maxflow.mod Maximum flow problem |
|||
mfasp.mod Minimum feedback arc set problem |
|||
mfvsp.mod Minimum feedback vertex set problem |
|||
min01ks.mod Finding minimal equivalent 0-1 knapsack inequality |
|||
misp.mod Maximum independent set problem |
|||
money.mod A crypto-arithmetic puzzle |
|||
murtagh.mps Oil refinery model |
|||
mvcp.mod Minimum vertex cover problem |
|||
numbrix.mod Number placement puzzle |
|||
pbn/*.* Paint-by-numbers puzzle |
|||
plan.lp A simple LP problem (CPLEX LP format) |
|||
plan.mod A simple LP problem (MathProg format) |
|||
plan.mps A simple LP problem (MPS format) |
|||
prod.mod A multiperiod production model |
|||
qfit.mod Quadratic curve fitting solution |
|||
queens.mod A classic combinatorial optimization problem |
|||
sat.mod Satisfiability problem |
|||
shiftcov.mod Workforce shift coverage assignment problem |
|||
shikaku.mod A solver for the logic puzzle Shikaku |
|||
sorting.mod How to sort arrays in MathProg |
|||
spp.mod Shortest path problem |
|||
stigler.mod Original Stigler's 1939 diet problem |
|||
sudoku.mod Number placement puzzle |
|||
tas.mod Tail assignment problem |
|||
todd.mod A class of hard instances of 0-1 knapsack problems |
|||
train.mod A model of railroad passenger car allocation |
|||
transp.mod A transportation problem |
|||
trick.mod A transportation design problem |
|||
tsp.mod Traveling salesman problem |
|||
xyacfs.mod Extended yet another curve fitting solution |
|||
yacfs.mod Yet another curve fitting solution |
|||
zebra.mod Who owns the zebra? |
@ -0,0 +1,15 @@ |
|||
## Process this file with automake to produce Makefile.in ##
|
|||
|
|||
AM_CPPFLAGS = -I$(srcdir)/../src |
|||
|
|||
LDADD = ../src/libglpk.la |
|||
|
|||
bin_PROGRAMS = glpsol |
|||
|
|||
glpsol_SOURCES = glpsol.c |
|||
|
|||
check: glpsol$(EXEEXT) |
|||
./glpsol$(EXEEXT) --version |
|||
./glpsol$(EXEEXT) --mps $(srcdir)/plan.mps |
|||
|
|||
## eof ##
|
@ -0,0 +1,558 @@ |
|||
# Makefile.in generated by automake 1.12.5 from Makefile.am.
|
|||
# @configure_input@
|
|||
|
|||
# Copyright (C) 1994-2012 Free Software Foundation, Inc.
|
|||
|
|||
# This Makefile.in is free software; the Free Software Foundation
|
|||
# gives unlimited permission to copy and/or distribute it,
|
|||
# with or without modifications, as long as this notice is preserved.
|
|||
|
|||
# This program is distributed in the hope that it will be useful,
|
|||
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
|||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
|||
# PARTICULAR PURPOSE.
|
|||
|
|||
@SET_MAKE@ |
|||
|
|||
VPATH = @srcdir@ |
|||
am__make_dryrun = \
|
|||
{ \
|
|||
am__dry=no; \
|
|||
case $$MAKEFLAGS in \
|
|||
*\\[\ \ ]*) \
|
|||
echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \
|
|||
| grep '^AM OK$$' >/dev/null || am__dry=yes;; \
|
|||
*) \
|
|||
for am__flg in $$MAKEFLAGS; do \
|
|||
case $$am__flg in \
|
|||
*=*|--*) ;; \
|
|||
*n*) am__dry=yes; break;; \
|
|||
esac; \
|
|||
done;; \
|
|||
esac; \
|
|||
test $$am__dry = yes; \
|
|||
} |
|||
pkgdatadir = $(datadir)/@PACKAGE@ |
|||
pkgincludedir = $(includedir)/@PACKAGE@ |
|||
pkglibdir = $(libdir)/@PACKAGE@ |
|||
pkglibexecdir = $(libexecdir)/@PACKAGE@ |
|||
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd |
|||
install_sh_DATA = $(install_sh) -c -m 644 |
|||
install_sh_PROGRAM = $(install_sh) -c |
|||
install_sh_SCRIPT = $(install_sh) -c |
|||
INSTALL_HEADER = $(INSTALL_DATA) |
|||
transform = $(program_transform_name) |
|||
NORMAL_INSTALL = : |
|||
PRE_INSTALL = : |
|||
POST_INSTALL = : |
|||
NORMAL_UNINSTALL = : |
|||
PRE_UNINSTALL = : |
|||
POST_UNINSTALL = : |
|||
build_triplet = @build@ |
|||
host_triplet = @host@ |
|||
bin_PROGRAMS = glpsol$(EXEEXT) |
|||
subdir = examples |
|||
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
|
|||
$(top_srcdir)/depcomp |
|||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 |
|||
am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
|
|||
$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
|
|||
$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
|
|||
$(top_srcdir)/configure.ac |
|||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
|||
$(ACLOCAL_M4) |
|||
mkinstalldirs = $(install_sh) -d |
|||
CONFIG_HEADER = $(top_builddir)/config.h |
|||
CONFIG_CLEAN_FILES = |
|||
CONFIG_CLEAN_VPATH_FILES = |
|||
am__installdirs = "$(DESTDIR)$(bindir)" |
|||
PROGRAMS = $(bin_PROGRAMS) |
|||
am_glpsol_OBJECTS = glpsol.$(OBJEXT) |
|||
glpsol_OBJECTS = $(am_glpsol_OBJECTS) |
|||
glpsol_LDADD = $(LDADD) |
|||
glpsol_DEPENDENCIES = ../src/libglpk.la |
|||
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) |
|||
depcomp = $(SHELL) $(top_srcdir)/depcomp |
|||
am__depfiles_maybe = depfiles |
|||
am__mv = mv -f |
|||
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
|
|||
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) |
|||
LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
|
|||
--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
|
|||
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) |
|||
CCLD = $(CC) |
|||
LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
|
|||
--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
|
|||
$(LDFLAGS) -o $@ |
|||
SOURCES = $(glpsol_SOURCES) |
|||
DIST_SOURCES = $(glpsol_SOURCES) |
|||
am__can_run_installinfo = \
|
|||
case $$AM_UPDATE_INFO_DIR in \
|
|||
n|no|NO) false;; \
|
|||
*) (install-info --version) >/dev/null 2>&1;; \
|
|||
esac |
|||
ETAGS = etags |
|||
CTAGS = ctags |
|||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) |
|||
ACLOCAL = @ACLOCAL@ |
|||
AMTAR = @AMTAR@ |
|||
AR = @AR@ |
|||
AUTOCONF = @AUTOCONF@ |
|||
AUTOHEADER = @AUTOHEADER@ |
|||
AUTOMAKE = @AUTOMAKE@ |
|||
AWK = @AWK@ |
|||
CC = @CC@ |
|||
CCDEPMODE = @CCDEPMODE@ |
|||
CFLAGS = @CFLAGS@ |
|||
CPP = @CPP@ |
|||
CPPFLAGS = @CPPFLAGS@ |
|||
CYGPATH_W = @CYGPATH_W@ |
|||
DEFS = @DEFS@ |
|||
DEPDIR = @DEPDIR@ |
|||
DLLTOOL = @DLLTOOL@ |
|||
DSYMUTIL = @DSYMUTIL@ |
|||
DUMPBIN = @DUMPBIN@ |
|||
ECHO_C = @ECHO_C@ |
|||
ECHO_N = @ECHO_N@ |
|||
ECHO_T = @ECHO_T@ |
|||
EGREP = @EGREP@ |
|||
EXEEXT = @EXEEXT@ |
|||
FGREP = @FGREP@ |
|||
GREP = @GREP@ |
|||
INSTALL = @INSTALL@ |
|||
INSTALL_DATA = @INSTALL_DATA@ |
|||
INSTALL_PROGRAM = @INSTALL_PROGRAM@ |
|||
INSTALL_SCRIPT = @INSTALL_SCRIPT@ |
|||
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ |
|||
LD = @LD@ |
|||
LDFLAGS = @LDFLAGS@ |
|||
LIBOBJS = @LIBOBJS@ |
|||
LIBS = @LIBS@ |
|||
LIBTOOL = @LIBTOOL@ |
|||
LIPO = @LIPO@ |
|||
LN_S = @LN_S@ |
|||
LTLIBOBJS = @LTLIBOBJS@ |
|||
MAKEINFO = @MAKEINFO@ |
|||
MANIFEST_TOOL = @MANIFEST_TOOL@ |
|||
MKDIR_P = @MKDIR_P@ |
|||
NM = @NM@ |
|||
NMEDIT = @NMEDIT@ |
|||
OBJDUMP = @OBJDUMP@ |
|||
OBJEXT = @OBJEXT@ |
|||
OTOOL = @OTOOL@ |
|||
OTOOL64 = @OTOOL64@ |
|||
PACKAGE = @PACKAGE@ |
|||
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ |
|||
PACKAGE_NAME = @PACKAGE_NAME@ |
|||
PACKAGE_STRING = @PACKAGE_STRING@ |
|||
PACKAGE_TARNAME = @PACKAGE_TARNAME@ |
|||
PACKAGE_URL = @PACKAGE_URL@ |
|||
PACKAGE_VERSION = @PACKAGE_VERSION@ |
|||
PATH_SEPARATOR = @PATH_SEPARATOR@ |
|||
RANLIB = @RANLIB@ |
|||
SED = @SED@ |
|||
SET_MAKE = @SET_MAKE@ |
|||
SHELL = @SHELL@ |
|||
STRIP = @STRIP@ |
|||
VERSION = @VERSION@ |
|||
abs_builddir = @abs_builddir@ |
|||
abs_srcdir = @abs_srcdir@ |
|||
abs_top_builddir = @abs_top_builddir@ |
|||
abs_top_srcdir = @abs_top_srcdir@ |
|||
ac_ct_AR = @ac_ct_AR@ |
|||
ac_ct_CC = @ac_ct_CC@ |
|||
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ |
|||
am__include = @am__include@ |
|||
am__leading_dot = @am__leading_dot@ |
|||
am__quote = @am__quote@ |
|||
am__tar = @am__tar@ |
|||
am__untar = @am__untar@ |
|||
bindir = @bindir@ |
|||
build = @build@ |
|||
build_alias = @build_alias@ |
|||
build_cpu = @build_cpu@ |
|||
build_os = @build_os@ |
|||
build_vendor = @build_vendor@ |
|||
builddir = @builddir@ |
|||
datadir = @datadir@ |
|||
datarootdir = @datarootdir@ |
|||
docdir = @docdir@ |
|||
dvidir = @dvidir@ |
|||
exec_prefix = @exec_prefix@ |
|||
host = @host@ |
|||
host_alias = @host_alias@ |
|||
host_cpu = @host_cpu@ |
|||
host_os = @host_os@ |
|||
host_vendor = @host_vendor@ |
|||
htmldir = @htmldir@ |
|||
includedir = @includedir@ |
|||
infodir = @infodir@ |
|||
install_sh = @install_sh@ |
|||
libdir = @libdir@ |
|||
libexecdir = @libexecdir@ |
|||
localedir = @localedir@ |
|||
localstatedir = @localstatedir@ |
|||
mandir = @mandir@ |
|||
mkdir_p = @mkdir_p@ |
|||
oldincludedir = @oldincludedir@ |
|||
pdfdir = @pdfdir@ |
|||
prefix = @prefix@ |
|||
program_transform_name = @program_transform_name@ |
|||
psdir = @psdir@ |
|||
sbindir = @sbindir@ |
|||
sharedstatedir = @sharedstatedir@ |
|||
srcdir = @srcdir@ |
|||
sysconfdir = @sysconfdir@ |
|||
target_alias = @target_alias@ |
|||
top_build_prefix = @top_build_prefix@ |
|||
top_builddir = @top_builddir@ |
|||
top_srcdir = @top_srcdir@ |
|||
AM_CPPFLAGS = -I$(srcdir)/../src |
|||
LDADD = ../src/libglpk.la |
|||
glpsol_SOURCES = glpsol.c |
|||
all: all-am |
|||
|
|||
.SUFFIXES: |
|||
.SUFFIXES: .c .lo .o .obj |
|||
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) |
|||
@for dep in $?; do \
|
|||
case '$(am__configure_deps)' in \
|
|||
*$$dep*) \
|
|||
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
|
|||
&& { if test -f $@; then exit 0; else break; fi; }; \
|
|||
exit 1;; \
|
|||
esac; \
|
|||
done; \
|
|||
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu examples/Makefile'; \
|
|||
$(am__cd) $(top_srcdir) && \
|
|||
$(AUTOMAKE) --gnu examples/Makefile |
|||
.PRECIOUS: Makefile |
|||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status |
|||
@case '$?' in \
|
|||
*config.status*) \
|
|||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
|
|||
*) \
|
|||
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
|
|||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
|
|||
esac; |
|||
|
|||
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) |
|||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh |
|||
|
|||
$(top_srcdir)/configure: $(am__configure_deps) |
|||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh |
|||
$(ACLOCAL_M4): $(am__aclocal_m4_deps) |
|||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh |
|||
$(am__aclocal_m4_deps): |
|||
install-binPROGRAMS: $(bin_PROGRAMS) |
|||
@$(NORMAL_INSTALL) |
|||
@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
|
|||
if test -n "$$list"; then \
|
|||
echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \
|
|||
$(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \
|
|||
fi; \
|
|||
for p in $$list; do echo "$$p $$p"; done | \
|
|||
sed 's/$(EXEEXT)$$//' | \
|
|||
while read p p1; do if test -f $$p || test -f $$p1; \
|
|||
then echo "$$p"; echo "$$p"; else :; fi; \
|
|||
done | \
|
|||
sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \
|
|||
-e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
|
|||
sed 'N;N;N;s,\n, ,g' | \
|
|||
$(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
|
|||
{ d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
|
|||
if ($$2 == $$4) files[d] = files[d] " " $$1; \
|
|||
else { print "f", $$3 "/" $$4, $$1; } } \
|
|||
END { for (d in files) print "f", d, files[d] }' | \
|
|||
while read type dir files; do \
|
|||
if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
|
|||
test -z "$$files" || { \
|
|||
echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
|
|||
$(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
|
|||
} \
|
|||
; done |
|||
|
|||
uninstall-binPROGRAMS: |
|||
@$(NORMAL_UNINSTALL) |
|||
@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
|
|||
files=`for p in $$list; do echo "$$p"; done | \
|
|||
sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
|
|||
-e 's/$$/$(EXEEXT)/' `; \
|
|||
test -n "$$list" || exit 0; \
|
|||
echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
|
|||
cd "$(DESTDIR)$(bindir)" && rm -f $$files |
|||
|
|||
clean-binPROGRAMS: |
|||
@list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \
|
|||
echo " rm -f" $$list; \
|
|||
rm -f $$list || exit $$?; \
|
|||
test -n "$(EXEEXT)" || exit 0; \
|
|||
list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
|
|||
echo " rm -f" $$list; \
|
|||
rm -f $$list |
|||
glpsol$(EXEEXT): $(glpsol_OBJECTS) $(glpsol_DEPENDENCIES) $(EXTRA_glpsol_DEPENDENCIES) |
|||
@rm -f glpsol$(EXEEXT) |
|||
$(LINK) $(glpsol_OBJECTS) $(glpsol_LDADD) $(LIBS) |
|||
|
|||
mostlyclean-compile: |
|||
-rm -f *.$(OBJEXT) |
|||
|
|||
distclean-compile: |
|||
-rm -f *.tab.c |
|||
|
|||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/glpsol.Po@am__quote@ |
|||
|
|||
.c.o: |
|||
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< |
|||
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po |
|||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ |
|||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ |
|||
@am__fastdepCC_FALSE@ $(COMPILE) -c $< |
|||
|
|||
.c.obj: |
|||
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` |
|||
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po |
|||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ |
|||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ |
|||
@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` |
|||
|
|||
.c.lo: |
|||
@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< |
|||
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo |
|||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ |
|||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ |
|||
@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< |
|||
|
|||
mostlyclean-libtool: |
|||
-rm -f *.lo |
|||
|
|||
clean-libtool: |
|||
-rm -rf .libs _libs |
|||
|
|||
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) |
|||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
|||
unique=`for i in $$list; do \
|
|||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
|||
done | \
|
|||
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
|
|||
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
|||
mkid -fID $$unique |
|||
tags: TAGS |
|||
|
|||
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ |
|||
$(TAGS_FILES) $(LISP) |
|||
set x; \
|
|||
here=`pwd`; \
|
|||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
|||
unique=`for i in $$list; do \
|
|||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
|||
done | \
|
|||
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
|
|||
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
|||
shift; \
|
|||
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
|
|||
test -n "$$unique" || unique=$$empty_fix; \
|
|||
if test $$# -gt 0; then \ |
|||
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
|||
"$$@" $$unique; \
|
|||
else \
|
|||
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
|||
$$unique; \
|
|||
fi; \
|
|||
fi |
|||
ctags: CTAGS |
|||
CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ |
|||
$(TAGS_FILES) $(LISP) |
|||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
|||
unique=`for i in $$list; do \
|
|||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
|||
done | \
|
|||
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
|
|||
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
|||
test -z "$(CTAGS_ARGS)$$unique" \
|
|||
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
|
|||
$$unique |
|||
|
|||
GTAGS: |
|||
here=`$(am__cd) $(top_builddir) && pwd` \
|
|||
&& $(am__cd) $(top_srcdir) \
|
|||
&& gtags -i $(GTAGS_ARGS) "$$here" |
|||
|
|||
cscopelist: $(HEADERS) $(SOURCES) $(LISP) |
|||
list='$(SOURCES) $(HEADERS) $(LISP)'; \
|
|||
case "$(srcdir)" in \
|
|||
[\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
|
|||
*) sdir=$(subdir)/$(srcdir) ;; \
|
|||
esac; \
|
|||
for i in $$list; do \
|
|||
if test -f "$$i"; then \
|
|||
echo "$(subdir)/$$i"; \
|
|||
else \
|
|||
echo "$$sdir/$$i"; \
|
|||
fi; \
|
|||
done >> $(top_builddir)/cscope.files |
|||
|
|||
distclean-tags: |
|||
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags |
|||
|
|||
distdir: $(DISTFILES) |
|||
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
|||
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
|||
list='$(DISTFILES)'; \
|
|||
dist_files=`for file in $$list; do echo $$file; done | \
|
|||
sed -e "s|^$$srcdirstrip/||;t" \
|
|||
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
|
|||
case $$dist_files in \
|
|||
*/*) $(MKDIR_P) `echo "$$dist_files" | \
|
|||
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
|
|||
sort -u` ;; \
|
|||
esac; \
|
|||
for file in $$dist_files; do \
|
|||
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
|
|||
if test -d $$d/$$file; then \
|
|||
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
|
|||
if test -d "$(distdir)/$$file"; then \
|
|||
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
|
|||
fi; \
|
|||
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
|
|||
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
|
|||
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
|
|||
fi; \
|
|||
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
|
|||
else \
|
|||
test -f "$(distdir)/$$file" \
|
|||
|| cp -p $$d/$$file "$(distdir)/$$file" \
|
|||
|| exit 1; \
|
|||
fi; \
|
|||
done |
|||
check-am: all-am |
|||
check: check-am |
|||
all-am: Makefile $(PROGRAMS) |
|||
installdirs: |
|||
for dir in "$(DESTDIR)$(bindir)"; do \
|
|||
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
|
|||
done |
|||
install: install-am |
|||
install-exec: install-exec-am |
|||
install-data: install-data-am |
|||
uninstall: uninstall-am |
|||
|
|||
install-am: all-am |
|||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am |
|||
|
|||
installcheck: installcheck-am |
|||
install-strip: |
|||
if test -z '$(STRIP)'; then \
|
|||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
|||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
|||
install; \
|
|||
else \
|
|||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
|||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
|||
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
|
|||
fi |
|||
mostlyclean-generic: |
|||
|
|||
clean-generic: |
|||
|
|||
distclean-generic: |
|||
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) |
|||
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) |
|||
|
|||
maintainer-clean-generic: |
|||
@echo "This command is intended for maintainers to use" |
|||
@echo "it deletes files that may require special tools to rebuild." |
|||
clean: clean-am |
|||
|
|||
clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am |
|||
|
|||
distclean: distclean-am |
|||
-rm -rf ./$(DEPDIR) |
|||
-rm -f Makefile |
|||
distclean-am: clean-am distclean-compile distclean-generic \ |
|||
distclean-tags |
|||
|
|||
dvi: dvi-am |
|||
|
|||
dvi-am: |
|||
|
|||
html: html-am |
|||
|
|||
html-am: |
|||
|
|||
info: info-am |
|||
|
|||
info-am: |
|||
|
|||
install-data-am: |
|||
|
|||
install-dvi: install-dvi-am |
|||
|
|||
install-dvi-am: |
|||
|
|||
install-exec-am: install-binPROGRAMS |
|||
|
|||
install-html: install-html-am |
|||
|
|||
install-html-am: |
|||
|
|||
install-info: install-info-am |
|||
|
|||
install-info-am: |
|||
|
|||
install-man: |
|||
|
|||
install-pdf: install-pdf-am |
|||
|
|||
install-pdf-am: |
|||
|
|||
install-ps: install-ps-am |
|||
|
|||
install-ps-am: |
|||
|
|||
installcheck-am: |
|||
|
|||
maintainer-clean: maintainer-clean-am |
|||
-rm -rf ./$(DEPDIR) |
|||
-rm -f Makefile |
|||
maintainer-clean-am: distclean-am maintainer-clean-generic |
|||
|
|||
mostlyclean: mostlyclean-am |
|||
|
|||
mostlyclean-am: mostlyclean-compile mostlyclean-generic \ |
|||
mostlyclean-libtool |
|||
|
|||
pdf: pdf-am |
|||
|
|||
pdf-am: |
|||
|
|||
ps: ps-am |
|||
|
|||
ps-am: |
|||
|
|||
uninstall-am: uninstall-binPROGRAMS |
|||
|
|||
.MAKE: install-am install-strip |
|||
|
|||
.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ |
|||
clean-generic clean-libtool cscopelist ctags distclean \
|
|||
distclean-compile distclean-generic distclean-libtool \
|
|||
distclean-tags distdir dvi dvi-am html html-am info info-am \
|
|||
install install-am install-binPROGRAMS install-data \
|
|||
install-data-am install-dvi install-dvi-am install-exec \
|
|||
install-exec-am install-html install-html-am install-info \
|
|||
install-info-am install-man install-pdf install-pdf-am \
|
|||
install-ps install-ps-am install-strip installcheck \
|
|||
installcheck-am installdirs maintainer-clean \
|
|||
maintainer-clean-generic mostlyclean mostlyclean-compile \
|
|||
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
|
|||
tags uninstall uninstall-am uninstall-binPROGRAMS |
|||
|
|||
|
|||
check: glpsol$(EXEEXT) |
|||
./glpsol$(EXEEXT) --version |
|||
./glpsol$(EXEEXT) --mps $(srcdir)/plan.mps |
|||
|
|||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
|||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
|||
.NOEXPORT: |
@ -0,0 +1,282 @@ |
|||
*NAME: ALLOY |
|||
*ROWS: 22 |
|||
*COLUMNS: 20 |
|||
*NONZERO: 203 |
|||
*OPT SOLN: 2149.247891 |
|||
*SOURCE: Linear Programming--Aluminium Alloy Blending |
|||
* Data Processing Application. N.Y.: IBM Corp. |
|||
*APPLICATION: Aluminium Alloy Blending |
|||
*COMMENTS: fixed MPS format |
|||
* encoded by Andrew Makhorin <mao@gnu.org> |
|||
* |
|||
NAME ALLOY |
|||
ROWS |
|||
N COST $ Cost $ |
|||
G ZN $ Zinc Minimum lbs |
|||
L ZX $ Zinc Maximum lbs |
|||
G CN $ Copper Minimum lbs |
|||
L CX $ Copper Maximum lbs |
|||
G MN $ Magnesium Minimum lbs |
|||
L MX $ Magnesium Maximum lbs |
|||
G CHN $ Chromium Minimum lbs |
|||
L CHX $ Chromium Maximum lbs |
|||
G BN $ Beryllium Minimum lbs |
|||
L BX $ Beryllium Maximum lbs |
|||
L IX $ Iron Maximum lbs |
|||
L SX $ Silicon Maximum lbs |
|||
L MGX $ Manganese Maximum lbs |
|||
L NX $ Nickel Maximum lbs |
|||
L TX $ Titanium Maximum lbs |
|||
L LX $ Lead Maximum lbs |
|||
L TNX $ Tin Maximum lbs |
|||
L BIX $ Bismuth Maximum lbs |
|||
L GX $ General Impurities lbs |
|||
L SCX $ Scrap 1 Limit lbs |
|||
G FL $ Furnance Load lbs |
|||
COLUMNS |
|||
* Pure Aluminium 1 |
|||
A1 COST .28 |
|||
IX .0004 |
|||
SX .0005 |
|||
FL 1.0 |
|||
* Pure Aluminium 2 |
|||
A2 COST .26 |
|||
IX .0006 |
|||
SX .0006 |
|||
FL 1.0 |
|||
* Pure Aluminium 3 |
|||
A3 COST .25 |
|||
IX .0011 |
|||
SX .0007 |
|||
FL 1.0 |
|||
* Pure Aluminium 4 |
|||
A4 COST .23 |
|||
IX .0026 |
|||
SX .0012 |
|||
FL 1.0 |
|||
* Pure Copper |
|||
C COST .31 |
|||
CN 1.00 |
|||
CX 1.00 |
|||
FL 1.0 |
|||
* Pure Magnesium |
|||
M COST .38 |
|||
MN 1.00 |
|||
MX 1.00 |
|||
FL 1.0 |
|||
* Beryllium/Aluminium Alloy |
|||
B/A COST 3.60 |
|||
BN 0.0600 |
|||
BX 0.0600 |
|||
FL 1.0 |
|||
* Pure Zinc |
|||
Z COST .22 |
|||
ZN .95 |
|||
ZX .95 |
|||
FL 1.0 |
|||
* Chromium Aluminium Alloy |
|||
C/A COST .27 |
|||
CHN .0300 |
|||
CHX .0300 |
|||
FL 1.0 |
|||
* Scrap 1 |
|||
SC1 COST .21 |
|||
ZN .0009 |
|||
ZX .0009 |
|||
CN .0444 |
|||
CX .0444 |
|||
MN .0042 |
|||
MX .0042 |
|||
CHN .0001 |
|||
CHX .0001 |
|||
IX .0024 |
|||
SX .0101 |
|||
MGX .0079 |
|||
NX .0001 |
|||
TX .0004 |
|||
LX .0001 |
|||
TNX .0001 |
|||
GX .0001 |
|||
SCX 1.00 |
|||
FL 1.0 |
|||
* Scrap 2 |
|||
SC2 COST .20 |
|||
ZN .0012 |
|||
ZX .0012 |
|||
CN .0026 |
|||
CX .0026 |
|||
MN .0060 |
|||
MX .0060 |
|||
CHN .0018 |
|||
CHX .0018 |
|||
IX .0026 |
|||
SX .0106 |
|||
MGX .0003 |
|||
NX .0002 |
|||
TX .0004 |
|||
LX .0001 |
|||
TNX .0001 |
|||
GX .0002 |
|||
FL 1.0 |
|||
* Scrap 3 |
|||
SC3 COST .21 |
|||
ZN .0568 |
|||
ZX .0568 |
|||
CN .0152 |
|||
CX .0152 |
|||
MN .0248 |
|||
MX .0248 |
|||
CHN .0020 |
|||
CHX .0020 |
|||
IX .0016 |
|||
SX .0013 |
|||
MGX .0005 |
|||
TX .0004 |
|||
LX .0003 |
|||
TNX .0003 |
|||
FL 1.0 |
|||
* Scrap 4 |
|||
SC4 COST .20 |
|||
ZN .0563 |
|||
ZX .0563 |
|||
CN .0149 |
|||
CX .0149 |
|||
MN .0238 |
|||
MX .0238 |
|||
CHN .0019 |
|||
CHX .0019 |
|||
IX .0019 |
|||
SX .0011 |
|||
MGX .0004 |
|||
TX .0004 |
|||
LX .0003 |
|||
TNX .0003 |
|||
FL 1.0 |
|||
* Scrap 5 |
|||
SC5 COST .21 |
|||
ZN .0460 |
|||
ZX .0460 |
|||
CN .0071 |
|||
CX .0071 |
|||
MN .0343 |
|||
MX .0343 |
|||
CHN .0013 |
|||
CHX .0013 |
|||
IX .0017 |
|||
SX .0013 |
|||
MGX .0018 |
|||
TX .0002 |
|||
LX .0002 |
|||
TNX .0002 |
|||
FL 1.0 |
|||
* Scrap 6 |
|||
SC6 COST .20 |
|||
ZN .0455 |
|||
ZX .0455 |
|||
CN .0071 |
|||
CX .0071 |
|||
MN .0343 |
|||
MX .0343 |
|||
IX .0016 |
|||
SX .0011 |
|||
MGX .0017 |
|||
TX .0002 |
|||
LX .0002 |
|||
TNX .0002 |
|||
FL 1.0 |
|||
* Scrap 7 |
|||
SC7 COST .21 |
|||
ZN .0009 |
|||
ZX .0009 |
|||
CN .0447 |
|||
CX .0447 |
|||
MN .0143 |
|||
MX .0143 |
|||
IX .0026 |
|||
SX .0013 |
|||
MGX .0052 |
|||
TX .0003 |
|||
LX .0001 |
|||
TNX .0001 |
|||
FL 1.0 |
|||
* Scrap 8 |
|||
SC8 COST .20 |
|||
ZN .0006 |
|||
ZX .0006 |
|||
CN .0623 |
|||
CX .0623 |
|||
IX .0017 |
|||
SX .0010 |
|||
MGX .0025 |
|||
TX .0005 |
|||
LX .0001 |
|||
TNX .0001 |
|||
GX .0025 |
|||
FL 1.0 |
|||
* Scrap 9 |
|||
SC9 COST .21 |
|||
ZN .0009 |
|||
ZX .0009 |
|||
CN .0034 |
|||
CX .0034 |
|||
MN .0093 |
|||
MX .0093 |
|||
CHN .0019 |
|||
CHX .0019 |
|||
IX .0030 |
|||
SX .0062 |
|||
MGX .0002 |
|||
TX .0003 |
|||
BIX .0005 |
|||
FL 1.0 |
|||
* Scrap 10 |
|||
SC10 COST .20 |
|||
ZN .0008 |
|||
ZX .0008 |
|||
CN .0003 |
|||
CX .0003 |
|||
MN .0249 |
|||
MX .0249 |
|||
CHN .0016 |
|||
CHX .0016 |
|||
IX .0015 |
|||
SX .0011 |
|||
MGX .0002 |
|||
FL 1.0 |
|||
* Scrap 11 |
|||
SC11 COST .21 |
|||
ZN .0675 |
|||
ZX .0675 |
|||
CN .0195 |
|||
CX .0195 |
|||
MN .0265 |
|||
MX .0265 |
|||
CHN .0020 |
|||
CHX .0020 |
|||
IX .0014 |
|||
SX .0008 |
|||
MGX .0002 |
|||
FL 1.0 |
|||
RHS |
|||
ZN 555. |
|||
ZX 590. |
|||
CN 140.0 |
|||
CX 190.0 |
|||
MN 245.0 |
|||
MX 275.0 |
|||
CHN 19.0 |
|||
CHX 22.0 |
|||
BN 2.0 |
|||
BX 4.0 |
|||
IX 15.0 |
|||
SX 10.0 |
|||
MGX 3.0 |
|||
NX 2.0 |
|||
TX 2.0 |
|||
LX 2.0 |
|||
TNX 2.0 |
|||
BIX 8.0 |
|||
GX 8.0 |
|||
SCX 900.0 |
|||
FL 10000. |
|||
ENDATA |
@ -0,0 +1,77 @@ |
|||
/* ASSIGN, Assignment Problem */ |
|||
|
|||
/* Written in GNU MathProg by Andrew Makhorin <mao@gnu.org> */ |
|||
|
|||
/* The assignment problem is one of the fundamental combinatorial |
|||
optimization problems. |
|||
|
|||
In its most general form, the problem is as follows: |
|||
|
|||
There are a number of agents and a number of tasks. Any agent can be |
|||
assigned to perform any task, incurring some cost that may vary |
|||
depending on the agent-task assignment. It is required to perform all |
|||
tasks by assigning exactly one agent to each task in such a way that |
|||
the total cost of the assignment is minimized. |
|||
|
|||
(From Wikipedia, the free encyclopedia.) */ |
|||
|
|||
param m, integer, > 0; |
|||
/* number of agents */ |
|||
|
|||
param n, integer, > 0; |
|||
/* number of tasks */ |
|||
|
|||
set I := 1..m; |
|||
/* set of agents */ |
|||
|
|||
set J := 1..n; |
|||
/* set of tasks */ |
|||
|
|||
param c{i in I, j in J}, >= 0; |
|||
/* cost of allocating task j to agent i */ |
|||
|
|||
var x{i in I, j in J}, >= 0; |
|||
/* x[i,j] = 1 means task j is assigned to agent i |
|||
note that variables x[i,j] are binary, however, there is no need to |
|||
declare them so due to the totally unimodular constraint matrix */ |
|||
|
|||
s.t. phi{i in I}: sum{j in J} x[i,j] <= 1; |
|||
/* each agent can perform at most one task */ |
|||
|
|||
s.t. psi{j in J}: sum{i in I} x[i,j] = 1; |
|||
/* each task must be assigned exactly to one agent */ |
|||
|
|||
minimize obj: sum{i in I, j in J} c[i,j] * x[i,j]; |
|||
/* the objective is to find a cheapest assignment */ |
|||
|
|||
solve; |
|||
|
|||
printf "\n"; |
|||
printf "Agent Task Cost\n"; |
|||
printf{i in I} "%5d %5d %10g\n", i, sum{j in J} j * x[i,j], |
|||
sum{j in J} c[i,j] * x[i,j]; |
|||
printf "----------------------\n"; |
|||
printf " Total: %10g\n", sum{i in I, j in J} c[i,j] * x[i,j]; |
|||
printf "\n"; |
|||
|
|||
data; |
|||
|
|||
/* These data correspond to an example from [Christofides]. */ |
|||
|
|||
/* Optimal solution is 76 */ |
|||
|
|||
param m := 8; |
|||
|
|||
param n := 8; |
|||
|
|||
param c : 1 2 3 4 5 6 7 8 := |
|||
1 13 21 20 12 8 26 22 11 |
|||
2 12 36 25 41 40 11 4 8 |
|||
3 35 32 13 36 26 21 13 37 |
|||
4 34 54 7 8 12 22 11 40 |
|||
5 21 6 45 18 24 34 12 48 |
|||
6 42 19 39 15 14 16 28 46 |
|||
7 16 34 38 3 34 40 22 24 |
|||
8 26 20 5 17 45 31 37 43 ; |
|||
|
|||
end; |
@ -0,0 +1,83 @@ |
|||
/* BPP, Bin Packing Problem */ |
|||
|
|||
/* Written in GNU MathProg by Andrew Makhorin <mao@gnu.org> */ |
|||
|
|||
/* Given a set of items I = {1,...,m} with weight w[i] > 0, the Bin |
|||
Packing Problem (BPP) is to pack the items into bins of capacity c |
|||
in such a way that the number of bins used is minimal. */ |
|||
|
|||
param m, integer, > 0; |
|||
/* number of items */ |
|||
|
|||
set I := 1..m; |
|||
/* set of items */ |
|||
|
|||
param w{i in 1..m}, > 0; |
|||
/* w[i] is weight of item i */ |
|||
|
|||
param c, > 0; |
|||
/* bin capacity */ |
|||
|
|||
/* We need to estimate an upper bound of the number of bins sufficient |
|||
to contain all items. The number of items m can be used, however, it |
|||
is not a good idea. To obtain a more suitable estimation an easy |
|||
heuristic is used: we put items into a bin while it is possible, and |
|||
if the bin is full, we use another bin. The number of bins used in |
|||
this way gives us a more appropriate estimation. */ |
|||
|
|||
param z{i in I, j in 1..m} := |
|||
/* z[i,j] = 1 if item i is in bin j, otherwise z[i,j] = 0 */ |
|||
|
|||
if i = 1 and j = 1 then 1 |
|||
/* put item 1 into bin 1 */ |
|||
|
|||
else if exists{jj in 1..j-1} z[i,jj] then 0 |
|||
/* if item i is already in some bin, do not put it into bin j */ |
|||
|
|||
else if sum{ii in 1..i-1} w[ii] * z[ii,j] + w[i] > c then 0 |
|||
/* if item i does not fit into bin j, do not put it into bin j */ |
|||
|
|||
else 1; |
|||
/* otherwise put item i into bin j */ |
|||
|
|||
check{i in I}: sum{j in 1..m} z[i,j] = 1; |
|||
/* each item must be exactly in one bin */ |
|||
|
|||
check{j in 1..m}: sum{i in I} w[i] * z[i,j] <= c; |
|||
/* no bin must be overflowed */ |
|||
|
|||
param n := sum{j in 1..m} if exists{i in I} z[i,j] then 1; |
|||
/* determine the number of bins used by the heuristic; obviously it is |
|||
an upper bound of the optimal solution */ |
|||
|
|||
display n; |
|||
|
|||
set J := 1..n; |
|||
/* set of bins */ |
|||
|
|||
var x{i in I, j in J}, binary; |
|||
/* x[i,j] = 1 means item i is in bin j */ |
|||
|
|||
var used{j in J}, binary; |
|||
/* used[j] = 1 means bin j contains at least one item */ |
|||
|
|||
s.t. one{i in I}: sum{j in J} x[i,j] = 1; |
|||
/* each item must be exactly in one bin */ |
|||
|
|||
s.t. lim{j in J}: sum{i in I} w[i] * x[i,j] <= c * used[j]; |
|||
/* if bin j is used, it must not be overflowed */ |
|||
|
|||
minimize obj: sum{j in J} used[j]; |
|||
/* objective is to minimize the number of bins used */ |
|||
|
|||
data; |
|||
|
|||
/* The optimal solution is 3 bins */ |
|||
|
|||
param m := 6; |
|||
|
|||
param w := 1 50, 2 60, 3 30, 4 70, 5 50, 6 40; |
|||
|
|||
param c := 100; |
|||
|
|||
end; |
@ -0,0 +1,49 @@ |
|||
/* cal.mod - print an ASCII calendar of the given year */ |
|||
|
|||
/* Written in GNU MathProg by Andrew Makhorin <mao@gnu.org> */ |
|||
|
|||
param year, integer, >= 0001, <= 3999, default 2010; |
|||
|
|||
param first_day{m in 1..12}, integer, >= 0, <= 6, := |
|||
time2str(str2time(year & "-" & m & "-01", "%Y-%m-%d"), "%w"); |
|||
|
|||
param days_in_month{m in 1..12}, integer, >= 28, <= 31, := |
|||
(str2time(year + (if m < 12 then 0 else 1) & "-" & |
|||
(if m < 12 then m+1 else 1) & "-01", "%Y-%m-%d") - |
|||
str2time(year & "-" & m & "-01", "%Y-%m-%d")) / 86400; |
|||
|
|||
param foo{m in 1..12, k in 0..5, d in 0..6}, integer, := |
|||
7 * k + d + 1 - first_day[m]; |
|||
|
|||
param cal{m in 1..12, k in 0..5, d in 0..6}, integer, := |
|||
if 1 <= foo[m,k,d] and foo[m,k,d] <= days_in_month[m] then |
|||
foo[m,k,d]; |
|||
|
|||
printf "\n"; |
|||
printf "%33s%04d\n", "", year; |
|||
printf "\n"; |
|||
for {t in 1..12 by 3} |
|||
{ for {m in t..t+2} |
|||
{ printf "%7s%-14s", "", time2str(str2time(m, "%m"), "%B"); |
|||
printf{0..0: m < t+2} " "; |
|||
} |
|||
printf "\n"; |
|||
for {m in t..t+2} |
|||
{ printf " S M Tu W Th F S"; |
|||
printf{0..0: m < t+2} " "; |
|||
} |
|||
printf "\n"; |
|||
for {k in 0..5} |
|||
{ for {m in t..t+2} |
|||
{ for {d in 0..6} |
|||
{ printf{0..0: cal[m,k,d] = 0} " "; |
|||
printf{0..0: cal[m,k,d] != 0} " %2d", cal[m,k,d]; |
|||
} |
|||
printf{0..0: m < t+2} " "; |
|||
} |
|||
printf "\n"; |
|||
} |
|||
} |
|||
printf "\n"; |
|||
|
|||
end; |
@ -0,0 +1,81 @@ |
|||
/* |
|||
|
|||
Curve fitting problem 12.11(a) H P Williams "Model Building in Mathematical Programming" |
|||
|
|||
Dr. H J Mackenzie |
|||
HARD software |
|||
hjm@hardsoftware.com |
|||
|
|||
2006-01-05 |
|||
|
|||
*/ |
|||
|
|||
# set of points |
|||
|
|||
set I; |
|||
|
|||
# independent variable |
|||
|
|||
param x {i in I}; |
|||
|
|||
# dependent variable |
|||
|
|||
param y {i in I}; |
|||
|
|||
# output input values |
|||
|
|||
printf {i in I} "x = %.1f; y = %.1f\n", x[i], y[i]; |
|||
|
|||
# define equation variables |
|||
|
|||
var a; |
|||
|
|||
var b; |
|||
|
|||
var u {i in I}, >= 0; |
|||
|
|||
var v {i in I}, >= 0; |
|||
|
|||
# define objective function |
|||
|
|||
minimize error: sum {i in I} u[i] + sum {i in I} v[i]; |
|||
|
|||
# define equation constraint |
|||
|
|||
s.t. equation {i in I} : b * x[i] + a + u[i] - v[i] = y[i]; |
|||
|
|||
solve; |
|||
|
|||
printf "y = %.4fx + %.4f\n", b, a; |
|||
|
|||
/* |
|||
* |
|||
* DATA section |
|||
* |
|||
*/ |
|||
|
|||
data; |
|||
|
|||
param : I : x y := |
|||
1 0 1 |
|||
2 0.5 0.9 |
|||
3 1 0.7 |
|||
4 1.5 1.5 |
|||
5 1.9 2 |
|||
6 2.5 2.4 |
|||
7 3 3.2 |
|||
8 3.5 2 |
|||
9 4 2.7 |
|||
10 4.5 3.5 |
|||
11 5 1 |
|||
12 5.5 4 |
|||
13 6 3.6 |
|||
14 6.6 2.7 |
|||
15 7 5.7 |
|||
16 7.6 4.6 |
|||
17 8.5 6 |
|||
18 9 6.8 |
|||
19 10 7.3 |
|||
; |
|||
|
|||
end; |
@ -0,0 +1,88 @@ |
|||
/* |
|||
|
|||
Curve fitting problem 12.11(b) H P Williams "Model Building in Mathematical Programming" |
|||
|
|||
Dr. H J Mackenzie |
|||
HARD software |
|||
hjm@hardsoftware.com |
|||
|
|||
2006-01-23 |
|||
|
|||
*/ |
|||
|
|||
# set of points |
|||
|
|||
set I; |
|||
|
|||
# independent variable |
|||
|
|||
param x {i in I}; |
|||
|
|||
# dependent variable |
|||
|
|||
param y {i in I}; |
|||
|
|||
# output input values |
|||
|
|||
printf {i in I} "x = %.1f; y = %.1f\n", x[i], y[i]; |
|||
|
|||
# define equation variables |
|||
|
|||
var a; |
|||
|
|||
var b; |
|||
|
|||
var u {i in I}, >= 0; |
|||
|
|||
var v {i in I}, >= 0; |
|||
|
|||
var z; |
|||
|
|||
# define objective function |
|||
|
|||
minimize deviation: z; |
|||
|
|||
# define equation constraint |
|||
|
|||
s.t. equation {i in I} : b * x[i] + a + u[i] - v[i] = y[i]; |
|||
|
|||
# define deviation constrains |
|||
|
|||
s.t. u_deviation {i in I} : z - u[i] >= 0; |
|||
s.t. v_deviation {i in I} : z - v[i] >= 0; |
|||
|
|||
solve; |
|||
|
|||
printf "y = %.4fx + %.4f Max deviation = %.4f\n", b, a, z; |
|||
|
|||
/* |
|||
* |
|||
* DATA section |
|||
* |
|||
*/ |
|||
|
|||
data; |
|||
|
|||
param : I : x y := |
|||
1 0 1 |
|||
2 0.5 0.9 |
|||
3 1 0.7 |
|||
4 1.5 1.5 |
|||
5 1.9 2 |
|||
6 2.5 2.4 |
|||
7 3 3.2 |
|||
8 3.5 2 |
|||
9 4 2.7 |
|||
10 4.5 3.5 |
|||
11 5 1 |
|||
12 5.5 4 |
|||
13 6 3.6 |
|||
14 6.6 2.7 |
|||
15 7 5.7 |
|||
16 7.6 4.6 |
|||
17 8.5 6 |
|||
18 9 6.8 |
|||
19 10 7.3 |
|||
; |
|||
|
|||
end; |
@ -0,0 +1,51 @@ |
|||
/*Curve fitting problem by Least Squares |
|||
Nigel_Galloway@operamail.com |
|||
October 1st., 2007 |
|||
*/ |
|||
set Sample; |
|||
param Sx {z in Sample}; |
|||
param Sy {z in Sample}; |
|||
|
|||
var X; |
|||
var Y; |
|||
var Ex{z in Sample}; |
|||
var Ey{z in Sample}; |
|||
|
|||
/* sum of variances is zero for Sx*/ |
|||
variencesX{z in Sample}: X + Ex[z] = Sx[z]; |
|||
zumVariancesX: sum{z in Sample} Ex[z] = 0; |
|||
/* sum of variances is zero for Sy*/ |
|||
variencesY{z in Sample}: Y + Ey[z] = Sy[z]; |
|||
zumVariancesY: sum{z in Sample} Ey[z] = 0; |
|||
|
|||
solve; |
|||
|
|||
param b1 := (sum{z in Sample} Ex[z]*Ey[z])/(sum{z in Sample} Ex[z]*Ex[z]); |
|||
printf "\nbest linear fit is:\n\ty = %f %s %fx\n\n", Y-b1*X, if b1 < 0 then "-" else "+", abs(b1); |
|||
|
|||
data; |
|||
|
|||
param: |
|||
Sample: Sx Sy := |
|||
1 0 1 |
|||
2 0.5 0.9 |
|||
3 1 0.7 |
|||
4 1.5 1.5 |
|||
5 1.9 2 |
|||
6 2.5 2.4 |
|||
7 3 3.2 |
|||
8 3.5 2 |
|||
9 4 2.7 |
|||
10 4.5 3.5 |
|||
11 5 1 |
|||
12 5.5 4 |
|||
13 6 3.6 |
|||
14 6.6 2.7 |
|||
15 7 5.7 |
|||
16 7.6 4.6 |
|||
17 8.5 6 |
|||
18 9 6.8 |
|||
19 10 7.3 |
|||
; |
|||
|
|||
end; |
@ -0,0 +1,113 @@ |
|||
/* COLOR, Graph Coloring Problem */ |
|||
|
|||
/* Written in GNU MathProg by Andrew Makhorin <mao@gnu.org> */ |
|||
|
|||
/* Given an undirected loopless graph G = (V, E), where V is a set of |
|||
nodes, E <= V x V is a set of arcs, the Graph Coloring Problem is to |
|||
find a mapping (coloring) F: V -> C, where C = {1, 2, ... } is a set |
|||
of colors whose cardinality is as small as possible, such that |
|||
F(i) != F(j) for every arc (i,j) in E, that is adjacent nodes must |
|||
be assigned different colors. */ |
|||
|
|||
param n, integer, >= 2; |
|||
/* number of nodes */ |
|||
|
|||
set V := {1..n}; |
|||
/* set of nodes */ |
|||
|
|||
set E, within V cross V; |
|||
/* set of arcs */ |
|||
|
|||
check{(i,j) in E}: i != j; |
|||
/* there must be no loops */ |
|||
|
|||
/* We need to estimate an upper bound of the number of colors |C|. |
|||
The number of nodes |V| can be used, however, for sparse graphs such |
|||
bound is not very good. To obtain a more suitable estimation we use |
|||
an easy "greedy" heuristic. Let nodes 1, ..., i-1 are already |
|||
assigned some colors. To assign a color to node i we see if there is |
|||
an existing color not used for coloring nodes adjacent to node i. If |
|||
so, we use this color, otherwise we introduce a new color. */ |
|||
|
|||
set EE := setof{(i,j) in E} (i,j) union setof{(i,j) in E} (j,i); |
|||
/* symmetrisized set of arcs */ |
|||
|
|||
param z{i in V, case in 0..1} := |
|||
/* z[i,0] = color index assigned to node i |
|||
z[i,1] = maximal color index used for nodes 1, 2, ..., i-1 which are |
|||
adjacent to node i */ |
|||
( if case = 0 then |
|||
( /* compute z[i,0] */ |
|||
min{c in 1..z[i,1]} |
|||
( if not exists{j in V: j < i and (i,j) in EE} z[j,0] = c then |
|||
c |
|||
else |
|||
z[i,1] + 1 |
|||
) |
|||
) |
|||
else |
|||
( /* compute z[i,1] */ |
|||
if not exists{j in V: j < i} (i,j) in EE then |
|||
1 |
|||
else |
|||
max{j in V: j < i and (i,j) in EE} z[j,0] |
|||
) |
|||
); |
|||
|
|||
check{(i,j) in E}: z[i,0] != z[j,0]; |
|||
/* check that all adjacent nodes are assigned distinct colors */ |
|||
|
|||
param nc := max{i in V} z[i,0]; |
|||
/* number of colors used by the heuristic; obviously, it is an upper |
|||
bound of the optimal solution */ |
|||
|
|||
display nc; |
|||
|
|||
var x{i in V, c in 1..nc}, binary; |
|||
/* x[i,c] = 1 means that node i is assigned color c */ |
|||
|
|||
var u{c in 1..nc}, binary; |
|||
/* u[c] = 1 means that color c is used, i.e. assigned to some node */ |
|||
|
|||
s.t. map{i in V}: sum{c in 1..nc} x[i,c] = 1; |
|||
/* each node must be assigned exactly one color */ |
|||
|
|||
s.t. arc{(i,j) in E, c in 1..nc}: x[i,c] + x[j,c] <= u[c]; |
|||
/* adjacent nodes cannot be assigned the same color */ |
|||
|
|||
minimize obj: sum{c in 1..nc} u[c]; |
|||
/* objective is to minimize the number of colors used */ |
|||
|
|||
data; |
|||
|
|||
/* These data correspond to the instance myciel3.col from: |
|||
http://mat.gsia.cmu.edu/COLOR/instances.html */ |
|||
|
|||
/* The optimal solution is 4 */ |
|||
|
|||
param n := 11; |
|||
|
|||
set E := |
|||
1 2 |
|||
1 4 |
|||
1 7 |
|||
1 9 |
|||
2 3 |
|||
2 6 |
|||
2 8 |
|||
3 5 |
|||
3 7 |
|||
3 10 |
|||
4 5 |
|||
4 6 |
|||
4 10 |
|||
5 8 |
|||
5 9 |
|||
6 11 |
|||
7 11 |
|||
8 11 |
|||
9 11 |
|||
10 11 |
|||
; |
|||
|
|||
end; |
@ -0,0 +1,44 @@ |
|||
The program module in this subdirectory is a crude implementation of |
|||
CPLEX-like interface to GLPK API. It consists of two files: cplex.c and |
|||
cplex.h. |
|||
|
|||
NOTE that this module is NOT a clean room implementation of the CPLEX |
|||
callable library. It only implements a CPLEX-like interface to the GLPK |
|||
API routines, and its main purpose is to provide possibility to build |
|||
and run applications which normally use the CPLEX callable library. |
|||
|
|||
This module approximately corresponds to CPLEX 9.0. |
|||
|
|||
Currently this module can be used as a linear programming solver for |
|||
Concorde, the state-of-the-art computer code for solving the symmetric |
|||
traveling salesman problem (TSP) developed by David Applegate, Robert |
|||
Bixby, Vasek Chvatal, and William Cook. For details about Concorde see |
|||
its web page at http://www.tsp.gatech.edu/concorde.html. |
|||
|
|||
To build Concorde along with GLPK you need to do the following: |
|||
|
|||
1. Configure, build, and install GLPK. |
|||
|
|||
2. Download the Concorde tarball co031219.tgz (version Dec 19, 2003), |
|||
unpack and unarchive it. |
|||
|
|||
3. Copy files cplex.h and cplex.c to subdirectory concorde/LP/. |
|||
|
|||
4. Create file named lpglpk.c in subdirectory concorde/LP/. This file |
|||
must contain the following two lines: |
|||
|
|||
#include "cplex.c" |
|||
#include "lpcplex8.c" |
|||
|
|||
5. Configure Concorde in usual way (./configure) and then build it with |
|||
the following command: |
|||
|
|||
make CPPFLAGS=-I. LPSOLVER_INTERFACE=lpglpk.c LPSOLVER_LIB=-lglpk |
|||
|
|||
The Concorde executable can be found in subdirectory concorde/TSP/. |
|||
|
|||
Please note that currently this GLPK interface module does not support |
|||
some important features (namely, CPXgetijdiv, CPXmdleave, CPXpivotin, |
|||
CPXpivotout, and CPXstrongbranch), so large (more than 1000 nodes) TSP |
|||
instances cannot be solved in a reasonable time, and some instances may |
|||
cause abnormal termination of Concorde (if CPXgetijdiv is called). |
@ -0,0 +1,121 @@ |
|||
Solver: Concorde-03.12.19 (options used: -s 99) |
|||
http://www.tsp.gatech.edu/concorde.html |
|||
LP Solver: GLPK 4.34 (CPLEX-like interface module examples/cplex) |
|||
Computer: Intel Pentium 4 CPU 3GHz, 2GB of RAM |
|||
Platform: Cygwin 1.5.24 (Windows XP 5.1 Build 2600 Service Pack 4) |
|||
Compiler: GCC 3.4.4 (options used: -O2) |
|||
Test set: http://www.iwr.uni-heidelberg.de/groups/comopt/software/ |
|||
TSPLIB95/ |
|||
|
|||
Problem Solution B&B Time, s |
|||
--------- -------- --- ------- |
|||
a280 2579 1 3.09 |
|||
ali535 202339 1 21.88 |
|||
att48 10628 1 0.20 |
|||
att532 27686 7 74.31 |
|||
bayg29 1610 1 0.08 |
|||
bays29 2020 1 0.08 |
|||
berlin52 7542 1 0.11 |
|||
bier127 118282 1 0.62 |
|||
brazil58 25395 1 0.23 |
|||
brd14051 |
|||
brg180 1950 1 0.34 |
|||
burma14 3323 1 0.06 |
|||
ch130 6110 1 0.92 |
|||
ch150 6528 1 1.69 |
|||
d1291 |
|||
d15112 |
|||
d1655 |
|||
d18512 |
|||
d198 15780 3 4.92 |
|||
d2103 |
|||
d493 35002 5 123.89 |
|||
d657 48913 11 148.17 |
|||
dantzig42 699 1 0.08 |
|||
dsj1000 18660188 13 251.00 |
|||
eil101 (failed due to CPXgetijdiv) |
|||
eil51 426 1 0.17 |
|||
eil76 538 1 0.11 |
|||
fl1400 |
|||
fl1577 |
|||
fl3795 |
|||
fl417 11861 1 47.20 |
|||
fnl4461 |
|||
fri26 937 1 0.05 |
|||
gil262 2378 3 10.39 |
|||
gr120 6942 1 0.66 |
|||
gr137 69853 1 2.09 |
|||
gr17 2085 1 0.03 |
|||
gr202 40160 1 3.97 |
|||
gr21 2707 1 0.03 |
|||
gr229 134602 7 19.45 |
|||
gr24 1272 1 0.03 |
|||
gr431 171414 9 40.67 |
|||
gr48 5046 1 0.22 |
|||
gr666 294358 3 40.23 |
|||
gr96 55209 1 1.22 |
|||
hk48 11461 1 0.08 |
|||
kroA100 21282 1 0.41 |
|||
kroA150 26524 1 2.09 |
|||
kroA200 29368 1 2.44 |
|||
kroB100 22141 1 1.20 |
|||
kroB150 26130 1 1.66 |
|||
kroB200 29437 1 1.41 |
|||
kroC100 20749 1 0.42 |
|||
kroD100 21294 1 0.50 |
|||
kroE100 22068 1 0.94 |
|||
lin105 14379 1 0.23 |
|||
lin318 42029 1 4.28 |
|||
nrw1379 |
|||
p654 34643 1 17.08 |
|||
pa561 2763 15 370.70 |
|||
pcb1173 56892 11 370.30 |
|||
pcb3038 |
|||
pcb442 59778 13 35.86 |
|||
pla33810 |
|||
pla7397 |
|||
pla85900 |
|||
pr1002 259045 1 23.08 |
|||
pr107 44303 1 0.38 |
|||
pr124 59030 1 1.23 |
|||
pr136 96772 1 2.19 |
|||
pr144 58537 1 0.89 |
|||
pr152 73682 1 2.73 |
|||
pr226 80369 1 2.72 |
|||
pr2392 |
|||
pr264 49135 1 1.61 |
|||
pr299 48191 3 14.52 |
|||
pr439 107217 15 117.75 |
|||
pr76 108159 1 0.95 |
|||
rat195 2323 5 12.91 |
|||
rat575 6773 19 202.52 |
|||
rat783 8806 1 37.92 |
|||
rat99 1211 1 0.50 |
|||
rd100 7910 1 0.28 |
|||
rd400 15281 11 74.41 |
|||
rl11849 |
|||
rl1304 |
|||
rl1323 |
|||
rl1889 |
|||
rl5915 |
|||
rl5934 |
|||
si1032 92650 1 82.09 |
|||
si175 21407 3 8.97 |
|||
si535 48450 1 71.28 |
|||
st70 675 1 0.20 |
|||
swiss42 1273 1 0.06 |
|||
ts225 126643 1 21.25 |
|||
tsp225 3916 1 10.14 |
|||
u1060 224094 13 507.44 |
|||
u1432 |
|||
u159 42080 1 0.41 |
|||
u1817 |
|||
u2152 |
|||
u2319 |
|||
u574 36905 1 32.84 |
|||
u724 41910 19 238.42 |
|||
ulysses16 6859 1 0.19 |
|||
ulysses22 7013 1 0.47 |
|||
usa13509 |
|||
vm1084 239297 9 543.38 |
|||
vm1748 |
2130
resources/3rdparty/glpk-4.57/examples/cplex/cplex.c
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
@ -0,0 +1,301 @@ |
|||
/* cplex.h (CPLEX-like interface to GLPK API) */ |
|||
|
|||
/*********************************************************************** |
|||
* This code is part of GLPK (GNU Linear Programming Kit). |
|||
* |
|||
* Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, |
|||
* 2009, 2010, 2011, 2013 Andrew Makhorin, Department for Applied |
|||
* Informatics, Moscow Aviation Institute, Moscow, Russia. All rights |
|||
* reserved. E-mail: <mao@gnu.org>. |
|||
* |
|||
* GLPK is free software: you can redistribute it and/or modify it |
|||
* under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* |
|||
* GLPK is distributed in the hope that it will be useful, but WITHOUT |
|||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY |
|||
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public |
|||
* License for more details. |
|||
* |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with GLPK. If not, see <http://www.gnu.org/licenses/>. |
|||
***********************************************************************/ |
|||
|
|||
#ifndef _CPLEX_H |
|||
#define _CPLEX_H |
|||
|
|||
#ifdef __cplusplus |
|||
extern "C" { |
|||
#endif |
|||
|
|||
typedef struct CPXENV CPXENV, *CPXENVptr; |
|||
typedef struct CPXLP CPXLP, *CPXLPptr; |
|||
|
|||
#define CPX_VERSION 900 |
|||
|
|||
#define CPX_OFF 0 |
|||
#define CPX_ON 1 |
|||
|
|||
#define CPX_INFBOUND 1e20 |
|||
|
|||
/* error codes: */ |
|||
#define CPXERR_NO_MEMORY 1001 |
|||
#define CPXERR_NO_ENVIRONMENT 1002 |
|||
#define CPXERR_BAD_ARGUMENT 1003 |
|||
#define CPXERR_NULL_POINTER 1004 |
|||
#define CPXERR_NO_PROBLEM 1009 |
|||
#define CPXERR_BAD_PARAM_NUM 1013 |
|||
#define CPXERR_PARAM_TOO_SMALL 1014 |
|||
#define CPXERR_PARAM_TOO_BIG 1015 |
|||
#define CPXERR_INDEX_RANGE 1200 |
|||
#define CPXERR_COL_INDEX_RANGE 1201 |
|||
#define CPXERR_ROW_INDEX_RANGE 1203 |
|||
#define CPXERR_NEGATIVE_SURPLUS 1207 |
|||
#define CPXERR_BAD_SENSE 1215 |
|||
#define CPXERR_NO_SOLN 1217 |
|||
#define CPXERR_NOT_FIXED 1221 |
|||
#define CPXERR_DUP_ENTRY 1222 |
|||
#define CPXERR_NULL_NAME 1224 |
|||
#define CPXERR_ARRAY_NOT_ASCENDING 1226 |
|||
#define CPXERR_COUNT_RANGE 1227 |
|||
#define CPXERR_BAD_LUB 1229 |
|||
#define CPXERR_BAD_STATUS 1253 |
|||
#define CPXERR_NO_BASIC_SOLN 1261 |
|||
#define CPXERR_NO_FILENAME 1421 |
|||
#define CPXERR_FAIL_OPEN_WRITE 1422 |
|||
#define CPXERR_BAD_FILETYPE 1424 |
|||
#define CPXERR_BAD_CTYPE 3021 |
|||
|
|||
/* control parameters: */ |
|||
#define CPX_PARAM_ADVIND 1001 |
|||
#define CPX_PARAM_AGGIND 1003 |
|||
#define CPX_PARAM_DPRIIND 1009 |
|||
#define CPX_PARAM_EPOPT 1014 |
|||
#define CPX_PARAM_EPPER 1015 |
|||
#define CPX_PARAM_EPRHS 1016 |
|||
#define CPX_PARAM_FASTMIP 1017 /* ??? */ |
|||
#define CPX_PARAM_SIMDISPLAY 1019 |
|||
#define CPX_PARAM_ITLIM 1020 |
|||
#define CPX_PARAM_OBJLLIM 1025 |
|||
#define CPX_PARAM_OBJULIM 1026 |
|||
#define CPX_PARAM_PERIND 1027 |
|||
#define CPX_PARAM_PPRIIND 1029 |
|||
#define CPX_PARAM_PREIND 1030 |
|||
#define CPX_PARAM_REINV 1031 |
|||
#define CPX_PARAM_SCRIND 1035 |
|||
#define CPX_PARAM_DATACHECK 1056 |
|||
|
|||
/* CPX_PARAM_DPRIIND: */ |
|||
#define CPX_DPRIIND_AUTO 0 |
|||
#define CPX_DPRIIND_FULL 1 |
|||
#define CPX_DPRIIND_STEEP 2 |
|||
#define CPX_DPRIIND_FULL_STEEP 3 |
|||
#define CPX_DPRIIND_STEEPQSTART 4 |
|||
#define CPX_DPRIIND_DEVEX 5 |
|||
|
|||
/* CPX_PARAM_PPRIIND: */ |
|||
#define CPX_PPRIIND_PARTIAL (-1) |
|||
#define CPX_PPRIIND_AUTO 0 |
|||
#define CPX_PPRIIND_DEVEX 1 |
|||
#define CPX_PPRIIND_STEEP 2 |
|||
#define CPX_PPRIIND_STEEPQSTART 3 |
|||
#define CPX_PPRIIND_FULL 4 |
|||
|
|||
/* CPXgetprobtype: */ |
|||
#define CPXPROB_LP 0 |
|||
#define CPXPROB_MIP 1 |
|||
#define CPXPROB_RELAXED 2 |
|||
#define CPXPROB_FIXED 3 |
|||
#define CPXPROB_QP 5 |
|||
#define CPXPROB_ZEROEDQP 6 |
|||
|
|||
/* CPXgetobjsen: */ |
|||
#define CPX_MIN 1 |
|||
#define CPX_MAX (-1) |
|||
|
|||
/* CPXgetbase: */ |
|||
#define CPX_AT_LOWER 0 |
|||
#define CPX_BASIC 1 |
|||
#define CPX_AT_UPPER 2 |
|||
#define CPX_FREE_SUPER 3 |
|||
|
|||
/* CPXgetstat: */ |
|||
#define CPX_STAT_OPTIMAL 1 |
|||
#define CPX_STAT_UNBOUNDED 2 |
|||
#define CPX_STAT_INFEASIBLE 3 |
|||
#define CPX_STAT_INForUNBD 4 |
|||
#define CPX_STAT_OPTIMAL_INFEAS 5 |
|||
#define CPX_STAT_ABORT_IT_LIM 10 |
|||
#define CPX_STAT_ABORT_OBJ_LIM 12 |
|||
|
|||
/* CPXgetmethod: */ |
|||
#define CPX_ALG_NONE 0 |
|||
#define CPX_ALG_PRIMAL 1 |
|||
#define CPX_ALG_DUAL 2 |
|||
#define CPX_ALG_BARRIER 4 |
|||
|
|||
/* CPXsolninfo: */ |
|||
#define CPX_NO_SOLN 0 |
|||
#define CPX_BASIC_SOLN 1 |
|||
#define CPX_NONBASIC_SOLN 2 |
|||
#define CPX_PRIMAL_SOLN 3 |
|||
|
|||
int CPXaddcols(CPXENV *env, CPXLP *lp, int ccnt, int nzcnt, |
|||
const double obj[], const int cmatbeg[], const int cmatind[], |
|||
const double cmatval[], const double lb[], const double ub[], |
|||
char *colname[]); |
|||
|
|||
int CPXaddrows(CPXENV *env, CPXLP *lp, int ccnt, int rcnt, int nzcnt, |
|||
const double rhs[], const char sense[], const int rmatbeg[], |
|||
const int rmatind[], const double rmatval[], char *colname[], |
|||
char *rowname[]); |
|||
|
|||
int CPXbaropt(CPXENV *env, CPXLP *lp); |
|||
|
|||
int CPXbinvrow(CPXENV *env, CPXLP *lp, int i, double y[]); |
|||
|
|||
int CPXchgbds(CPXENV *env, CPXLP *lp, int cnt, const int indices[], |
|||
const char lu[], const double bd[]); |
|||
|
|||
int CPXchgcoeflist(CPXENV *env, CPXLP *lp, int numcoefs, |
|||
const int rowlist[], const int collist[], const double vallist[]); |
|||
|
|||
void CPXchgobjsen(CPXENV *env, CPXLP *lp, int maxormin); |
|||
|
|||
int CPXchgsense(CPXENV *env, CPXLP *lp, int cnt, const int indices[], |
|||
const char sense[]); |
|||
|
|||
int CPXcloseCPLEX(CPXENV **env); |
|||
|
|||
int CPXcopybase(CPXENV *env, CPXLP *lp, const int cstat[], |
|||
const int rstat[]); |
|||
|
|||
int CPXcopybasednorms(CPXENV *env, CPXLP *lp, const int cstat[], |
|||
const int rstat[], const double dnorm[]); |
|||
|
|||
int CPXcopylp(CPXENV *env, CPXLP *lp, int numcols, int numrows, |
|||
int objsen, const double obj[], const double rhs[], |
|||
const char sense[], const int matbeg[], const int matcnt[], |
|||
const int matind[], const double matval[], const double lb[], |
|||
const double ub[], const double rngval[]); |
|||
|
|||
int CPXcopylpwnames(CPXENV *env, CPXLP *lp, int numcols, int numrows, |
|||
int objsen, const double obj[], const double rhs[], |
|||
const char sense[], const int matbeg[], const int matcnt[], |
|||
const int matind[], const double matval[], const double lb[], |
|||
const double ub[], const double rngval[], char *colname[], |
|||
char *rowname[]); |
|||
|
|||
CPXLP *CPXcreateprob(CPXENV *env, int *status, const char *probname); |
|||
|
|||
int CPXdelcols(CPXENV *env, CPXLP *lp, int begin, int end); |
|||
|
|||
int CPXdelrows(CPXENV *env, CPXLP *lp, int begin, int end); |
|||
|
|||
int CPXdelsetcols(CPXENV *env, CPXLP *lp, int delstat[]); |
|||
|
|||
int CPXdelsetrows(CPXENV *env, CPXLP *lp, int delstat[]); |
|||
|
|||
int CPXdualopt(CPXENV *env, CPXLP *lp); |
|||
|
|||
int CPXfreeprob(CPXENV *env, CPXLP **lp); |
|||
|
|||
int CPXgetbase(CPXENV *env, CPXLP *lp, int cstat[], int rstat[]); |
|||
|
|||
int CPXgetbasednorms(CPXENV *env, CPXLP *lp, int cstat[], int rstat[], |
|||
double dnorm[]); |
|||
|
|||
int CPXgetbhead(CPXENV *env, CPXLP *lp, int head[], double x[]); |
|||
|
|||
int CPXgetdblparam(CPXENV *env, int whichparam, double *value); |
|||
|
|||
int CPXgetdj(CPXENV *env, CPXLP *lp, double dj[], int begin, int end); |
|||
|
|||
char *CPXgeterrorstring(CPXENV *env, int errcode, char *buffer); |
|||
|
|||
int CPXgetijdiv(CPXENV *env, CPXLP *lp, int *idiv, int *jdiv); |
|||
|
|||
int CPXgetintparam(CPXENV *env, int whichparam, int *value); |
|||
|
|||
int CPXgetlb(CPXENV *env, CPXLP *lp, double lb[], int begin, int end); |
|||
|
|||
int CPXgetmethod(CPXENV *env, CPXLP *lp); |
|||
|
|||
int CPXgetnumcols(CPXENV *env, CPXLP *lp); |
|||
|
|||
int CPXgetnumnz(CPXENV *env, CPXLP *lp); |
|||
|
|||
int CPXgetnumrows(CPXENV *env, CPXLP *lp); |
|||
|
|||
int CPXgetobjval(CPXENV *env, CPXLP *lp, double *objval); |
|||
|
|||
int CPXgetpi(CPXENV *env, CPXLP *lp, double pi[], int begin, int end); |
|||
|
|||
int CPXgetsense(CPXENV *env, CPXLP *lp, char sense[], int begin, |
|||
int end); |
|||
|
|||
int CPXgetslack(CPXENV *env, CPXLP *lp, double slack[], int begin, |
|||
int end); |
|||
|
|||
int CPXgetstat(CPXENV *env, CPXLP *lp); |
|||
|
|||
int CPXgetub(CPXENV *env, CPXLP *lp, double ub[], int begin, int end); |
|||
|
|||
int CPXgetweight(CPXENV *env, CPXLP *lp, int rcnt, const int rmatbeg[], |
|||
const int rmatind[], const double rmatval[], double weight[], |
|||
int dpriind); |
|||
|
|||
int CPXgetx(CPXENV *env, CPXLP *lp, double x[], int begin, int end); |
|||
|
|||
int CPXinfodblparam(CPXENV *env, int whichparam, double *defvalue, |
|||
double *minvalue, double *maxvalue); |
|||
|
|||
int CPXinfointparam(CPXENV *env, int whichparam, int *defvalue, |
|||
int *minvalue, int *maxvalue); |
|||
|
|||
int CPXlpopt(CPXENV *env, CPXLP *lp); |
|||
|
|||
int CPXmdleave(const CPXENV *env, CPXLP *lp, const int goodlist[], |
|||
int goodlen, double downratio[], double upratio[]); |
|||
|
|||
int CPXnewcols(CPXENV *env, CPXLP *lp, int ccnt, const double obj[], |
|||
const double lb[], const double ub[], const char ctype[], |
|||
char *colname[]); |
|||
|
|||
int CPXnewrows(CPXENV *env, CPXLP *lp, int rcnt, const double rhs[], |
|||
const char sense[], const double rngval[], char *rowname[]); |
|||
|
|||
CPXENV *CPXopenCPLEX(int *status); |
|||
|
|||
int CPXpivotin(CPXENV *env, CPXLP *lp, const int rlist[], int rlen); |
|||
|
|||
int CPXpivotout(CPXENV *env, CPXLP *lp, const int clist[], int clen); |
|||
|
|||
int CPXprimopt(CPXENV *env, CPXLP *lp); |
|||
|
|||
int CPXsavwrite(CPXENV *env, CPXLP *lp, const char *filename); |
|||
|
|||
int CPXsetdblparam(CPXENV *env, int whichparam, double newvalue); |
|||
|
|||
int CPXsetintparam(CPXENV *env, int whichparam, int newvalue); |
|||
|
|||
int CPXsolninfo(CPXENV *env, CPXLP *lp, int *solnmethod, int *solntype, |
|||
int *pfeasind, int *dfeasind); |
|||
|
|||
int CPXsolution(CPXENV *env, CPXLP *lp, int *lpstat, double *objval, |
|||
double x[], double pi[], double slack[], double dj[]); |
|||
|
|||
int CPXstrongbranch(CPXENV *env, CPXLP *lp, const int goodlist[], |
|||
int goodlen, double downpen[], double uppen[], int itlim); |
|||
|
|||
int CPXwriteprob(CPXENV *env, CPXLP *lp, const char *filename, |
|||
const char *filetype); |
|||
|
|||
#ifdef __cplusplus |
|||
} |
|||
#endif |
|||
|
|||
#endif |
|||
|
|||
/* eof */ |
@ -0,0 +1,67 @@ |
|||
/* CPP, Critical Path Problem */ |
|||
|
|||
/* Written in GNU MathProg by Andrew Makhorin <mao@gnu.org> */ |
|||
|
|||
/* Note: Reduced costs of auxiliary variables phi[j,k] (see below) |
|||
can be only zero or one. The critical path is defined by the |
|||
constraints, whose reduced cost is one. */ |
|||
|
|||
set J; |
|||
/* set of jobs (activities) */ |
|||
|
|||
set P{j in J}, in J, default {}; |
|||
/* P[j] is a subset of jobs that immediately precede job j */ |
|||
|
|||
param t{j in J}, >= 0; |
|||
/* duration required to perform job j */ |
|||
|
|||
var x{j in J}, >= 0; |
|||
/* starting time of job j */ |
|||
|
|||
s.t. phi{j in J, k in P[j]}: x[j] >= x[k] + t[k]; |
|||
/* job j can start only after all immediately preceding jobs have been |
|||
completely performed */ |
|||
|
|||
var z; |
|||
/* project makespan */ |
|||
|
|||
s.t. fin{j in J}: z >= x[j] + t[j]; |
|||
/* which is the maximum of the completion times of all the jobs */ |
|||
|
|||
minimize obj: z; |
|||
/* the objective is make z as small as possible */ |
|||
|
|||
data; |
|||
|
|||
/* The optimal solution is 46 */ |
|||
|
|||
param : J : t := |
|||
A 3 /* Excavate */ |
|||
B 4 /* Lay foundation */ |
|||
C 3 /* Rough plumbing */ |
|||
D 10 /* Frame */ |
|||
E 8 /* Finish exterior */ |
|||
F 4 /* Install HVAC */ |
|||
G 6 /* Rough electric */ |
|||
H 8 /* Sheet rock */ |
|||
I 5 /* Install cabinets */ |
|||
J 5 /* Paint */ |
|||
K 4 /* Final plumbing */ |
|||
L 2 /* Final electric */ |
|||
M 4 /* Install flooring */ |
|||
; |
|||
|
|||
set P[B] := A; |
|||
set P[C] := B; |
|||
set P[D] := B; |
|||
set P[E] := D; |
|||
set P[F] := D; |
|||
set P[G] := D; |
|||
set P[H] := C E F G; |
|||
set P[I] := H; |
|||
set P[J] := H; |
|||
set P[K] := I; |
|||
set P[L] := J; |
|||
set P[M] := K L; |
|||
|
|||
end; |
@ -0,0 +1,84 @@ |
|||
/* CRYPTO, a crypto-arithmetic puzzle */ |
|||
|
|||
/* Written in GNU MathProg by Andrew Makhorin <mao@gnu.org> */ |
|||
|
|||
/* This problem comes from the newsgroup rec.puzzle. |
|||
The numbers from 1 to 26 are assigned to the letters of the alphabet. |
|||
The numbers beside each word are the total of the values assigned to |
|||
the letters in the word (e.g. for LYRE: L, Y, R, E might be to equal |
|||
5, 9, 20 and 13, or any other combination that add up to 47). |
|||
Find the value of each letter under the equations: |
|||
|
|||
BALLET 45 GLEE 66 POLKA 59 SONG 61 |
|||
CELLO 43 JAZZ 58 QUARTET 50 SOPRANO 82 |
|||
CONCERT 74 LYRE 47 SAXOPHONE 134 THEME 72 |
|||
FLUTE 30 OBOE 53 SCALE 51 VIOLIN 100 |
|||
FUGUE 50 OPERA 65 SOLO 37 WALTZ 34 |
|||
|
|||
Solution: |
|||
A, B,C, D, E,F, G, H, I, J, K,L,M, N, O, P,Q, R, S,T,U, V,W, X, Y, Z |
|||
5,13,9,16,20,4,24,21,25,17,23,2,8,12,10,19,7,11,15,3,1,26,6,22,14,18 |
|||
|
|||
Reference: |
|||
Koalog Constraint Solver <http://www.koalog.com/php/jcs.php>, |
|||
Simple problems, the crypto-arithmetic puzzle ALPHACIPHER. */ |
|||
|
|||
set LETTERS := |
|||
{ 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', |
|||
'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z' |
|||
}; |
|||
/* set of letters */ |
|||
|
|||
set VALUES := 1..card(LETTERS); |
|||
/* set of values assigned to the letters */ |
|||
|
|||
set WORDS; |
|||
/* set of words */ |
|||
|
|||
param total{word in WORDS}; |
|||
/* total[word] is the total of the values assigned to the letters in |
|||
the word */ |
|||
|
|||
var x{i in LETTERS, j in VALUES}, binary; |
|||
/* x[i,j] = 1 means that letter i is assigned value j */ |
|||
|
|||
s.t. phi{i in LETTERS}: sum{j in VALUES} x[i,j] = 1; |
|||
|
|||
s.t. psi{j in VALUES}: sum{i in LETTERS} x[i,j] = 1; |
|||
|
|||
s.t. eqn{word in WORDS}: sum{k in 1..length(word), j in VALUES} |
|||
j * x[substr(word,k,1), j] = total[word]; |
|||
|
|||
solve; |
|||
|
|||
printf{i in LETTERS} " %s", i; |
|||
printf "\n"; |
|||
|
|||
printf{i in LETTERS} " %2d", sum{j in VALUES} j * x[i,j]; |
|||
printf "\n"; |
|||
|
|||
data; |
|||
|
|||
param : WORDS : total := |
|||
BALLET 45 |
|||
CELLO 43 |
|||
CONCERT 74 |
|||
FLUTE 30 |
|||
FUGUE 50 |
|||
GLEE 66 |
|||
JAZZ 58 |
|||
LYRE 47 |
|||
OBOE 53 |
|||
OPERA 65 |
|||
POLKA 59 |
|||
QUARTET 50 |
|||
SAXOPHONE 134 |
|||
SCALE 51 |
|||
SOLO 37 |
|||
SONG 61 |
|||
SOPRANO 82 |
|||
THEME 72 |
|||
VIOLIN 100 |
|||
WALTZ 34 ; |
|||
|
|||
end; |
@ -0,0 +1,7 @@ |
|||
plant,market,distance |
|||
"Seattle","New York",2.5 |
|||
"Seattle","Chicago",1.7 |
|||
"Seattle","Topeka",1.8 |
|||
"San Diego","New York",2.5 |
|||
"San Diego","Chicago",1.8 |
|||
"San Diego","Topeka",1.4 |
@ -0,0 +1,4 @@ |
|||
market,demand |
|||
"New York",325. |
|||
"Chicago",300. |
|||
"Topeka",275. |
@ -0,0 +1,2 @@ |
|||
parameter,value |
|||
"transport cost",90. |
@ -0,0 +1,3 @@ |
|||
plant,capacity |
|||
"Seattle",350. |
|||
"San Diego",600. |
@ -0,0 +1,70 @@ |
|||
# A TRANSPORTATION PROBLEM |
|||
# |
|||
# This problem finds a least cost shipping schedule that meets |
|||
# requirements at markets and supplies at factories. |
|||
# |
|||
# References: |
|||
# Dantzig G B, "Linear Programming and Extensions." |
|||
# Princeton University Press, Princeton, New Jersey, 1963, |
|||
# Chapter 3-3. |
|||
|
|||
set I; |
|||
/* canning plants */ |
|||
|
|||
set J; |
|||
/* markets */ |
|||
|
|||
set K dimen 2; |
|||
/* transportation lane */ |
|||
|
|||
set L; |
|||
/* parameters */ |
|||
|
|||
param a{i in I}; |
|||
/* capacity of plant i in cases */ |
|||
|
|||
param b{j in J}; |
|||
/* demand at market j in cases */ |
|||
|
|||
param d{i in I, j in J}; |
|||
/* distance in thousands of miles */ |
|||
|
|||
param e{l in L}; |
|||
/* parameters */ |
|||
|
|||
param f; |
|||
/* freight in dollars per case per thousand miles */ |
|||
|
|||
table tab_plant IN "CSV" "plants.csv" : |
|||
I <- [plant], a ~ capacity; |
|||
|
|||
table tab_market IN "CSV" "markets.csv" : |
|||
J <- [market], b ~ demand; |
|||
|
|||
table tab_distance IN "CSV" "distances.csv" : |
|||
K <- [plant, market], d ~ distance; |
|||
|
|||
table tab_parameter IN "CSV" "parameters.csv" : |
|||
L <- [parameter], e ~ value ; |
|||
|
|||
param c{i in I, j in J} := e['transport cost'] * d[i,j] / 1000; |
|||
/* transport cost in thousands of dollars per case */ |
|||
|
|||
var x{(i,j) in K} >= 0; |
|||
/* shipment quantities in cases */ |
|||
|
|||
minimize cost: sum{(i,j) in K} c[i,j] * x[i,j]; |
|||
/* total transportation costs in thousands of dollars */ |
|||
|
|||
s.t. supply{i in I}: sum{(i,j) in K} x[i,j] <= a[i]; |
|||
/* observe supply limit at plant i */ |
|||
|
|||
s.t. demand{j in J}: sum{(i,j) in K} x[i,j] >= b[j]; |
|||
/* satisfy demand at market j */ |
|||
|
|||
solve; |
|||
|
|||
table tab_result{(i,j) in K} OUT "CSV" "result.csv" : |
|||
i ~ plant, j ~ market, x[i,j] ~ shipment; |
|||
|
|||
end; |
@ -0,0 +1,226 @@ |
|||
# Model I Forest Estate Modelling using GLPK/MathProg |
|||
# Reading and writing dbf files |
|||
|
|||
# by Noli Sicad --- nsicad@gmail.com |
|||
# 18 December 2009 |
|||
|
|||
# Forest Management 4th Edition |
|||
# by Lawrence Davis, K. Norman Johnson, Pete Bettinger, Theodore Howard |
|||
# Chapter 11 - Daniel Pickett |
|||
# http://warnell.forestry.uga.edu/Warnell/Bettinger/mgtbook/index.htm |
|||
|
|||
# Model I Formulation |
|||
|
|||
/* Note: This is not the full LP model mentioned in the book. |
|||
Some of the constraints are deliberately omitted in this model for the purpose of clarity. |
|||
|
|||
The features of MathProg in this example are: |
|||
* reading and writing dbf from regular dbf files, |
|||
* reading dbf file (database of shapefile (stands.shp)) (e.g. area parameter), |
|||
* using the area data in the constraints and |
|||
* writing dbf file from result of LP model. |
|||
|
|||
Model I - Harvest Scheduling formulation for Sustainable Forest Management (SFM) |
|||
|
|||
Features are: |
|||
* Net Present Value for the objective function (Revenue - Cost) |
|||
* Harvest Constraints by period - Sustainable Yield per Period |
|||
* Even-Flow Constraint / Volume - Harvest Flow Constraint - Alpha (1-Apha) |
|||
* Even-Flow Constraint / Volume - Harvest Flow Constraint - Beta (1 +Beta) |
|||
* Forest / Land Constraint -- Total Area of the forest |
|||
* Forest Stand Constraint -- Individual stands |
|||
|
|||
What is next? -- Forest Mgt Carbon Accounting for Climate Change |
|||
|
|||
Note: The model file that the data containing in |
|||
the dbf files is public domain material (so it is compatible with the |
|||
GNU GPL) and data can be found in |
|||
http://warnell.forestry.uga.edu/Warnell/Bettinger/mgtbook/index.htm |
|||
|
|||
# Noli Sicad --- nsicad@gmail.com |
|||
|
|||
*/ |
|||
|
|||
set G_STAND_TYPE; # A, B, C |
|||
|
|||
set I_CULTURAL_PRES; |
|||
set J_MGT_YEAR; |
|||
|
|||
param K_PERIOD; |
|||
param Forest_Cost{G_STAND_TYPE,I_CULTURAL_PRES, J_MGT_YEAR}; # cost |
|||
|
|||
param Yield_Table_Vol{G_STAND_TYPE, I_CULTURAL_PRES, J_MGT_YEAR, 1..K_PERIOD} >= 0; |
|||
|
|||
|
|||
param Alpha >= 0; |
|||
param Beta >= 0; |
|||
|
|||
param TCost_Table{G_STAND_TYPE, I_CULTURAL_PRES, J_MGT_YEAR, 1..K_PERIOD} >= 0; |
|||
|
|||
param NetRev_Table{G_STAND_TYPE, I_CULTURAL_PRES, J_MGT_YEAR, 1..K_PERIOD}; |
|||
|
|||
|
|||
var XForestLand{g in G_STAND_TYPE, i in I_CULTURAL_PRES, j in J_MGT_YEAR} >= 0; |
|||
|
|||
|
|||
#reading dbf tables |
|||
table tab IN "xBASE" "standtype.dbf": G_STAND_TYPE <- [STAND]; |
|||
display G_STAND_TYPE; |
|||
|
|||
|
|||
table tab2 IN "xBASE" "cultural_pres.dbf": I_CULTURAL_PRES <- [CUL_PRES]; |
|||
display I_CULTURAL_PRES; |
|||
|
|||
table tab3 IN "xBASE" "mgt_year.dbf": J_MGT_YEAR <- [MGT_YEAR]; |
|||
display J_MGT_YEAR; |
|||
|
|||
/* |
|||
param Forest_Cost{G_STAND_TYPE,I_CULTURAL_PRES, J_MGT_YEAR} default 0; # cost |
|||
*/ |
|||
|
|||
set S1, dimen 3; |
|||
table tab4 IN "xBASE" "Forest_Cost.dbf": S1 <- [STAND, CUL_PRES, MGT_YEAR],Forest_Cost ~FCOST; |
|||
display Forest_Cost; |
|||
|
|||
set S2, dimen 4; |
|||
table tab5 IN "xBASE" "Yield_Table_Vol.dbf": S2 <- [STAND, CUL_PRES, MGT_YEAR, PERIOD],Yield_Table_Vol ~YIELD; |
|||
display Yield_Table_Vol; |
|||
|
|||
set S3, dimen 4; |
|||
table tab5 IN "xBASE" "TCost_Table.dbf": S3 <- [STAND, CUL_PRES, MGT_YEAR, PERIOD],TCost_Table ~TCOST; |
|||
display TCost_Table; |
|||
|
|||
|
|||
set S4, dimen 4; |
|||
table tab5 IN "xBASE" "NetRev_Table.dbf": S4 <- [STAND, CUL_PRES, MGT_YEAR, PERIOD],NetRev_Table ~NETREV; |
|||
display NetRev_Table; |
|||
|
|||
|
|||
param MGT; |
|||
|
|||
param Area_Stand_Indi{g in G_STAND_TYPE, m in 1..MGT} default 0; |
|||
|
|||
set ST, dimen 2; |
|||
table tab5 IN "xBASE" "stands.dbf": ST <- [VEG_TYPE, MGT], Area_Stand_Indi ~ACRES; |
|||
display Area_Stand_Indi; |
|||
|
|||
param Area_Stand_Type{g in G_STAND_TYPE}:= sum {m in 1..MGT } Area_Stand_Indi[g,m]; |
|||
display Area_Stand_Type; |
|||
|
|||
|
|||
param Total_Area := sum {g in G_STAND_TYPE, m in 1..MGT } Area_Stand_Indi[g,m]; |
|||
display Total_Area; |
|||
|
|||
param Harvest_Min_Vol_Period; |
|||
|
|||
|
|||
var NetPresentValue; |
|||
|
|||
# Objective function |
|||
maximize Net_Present_Value: NetPresentValue; |
|||
|
|||
subject to NPV: |
|||
NetPresentValue = sum {g in G_STAND_TYPE, i in I_CULTURAL_PRES, j in J_MGT_YEAR} Forest_Cost[g,i,j] * XForestLand[g,i,j]; |
|||
|
|||
# Harvest Constraint by Period |
|||
subject to Harvest_Period_H {k in 1..K_PERIOD}: |
|||
sum {g in G_STAND_TYPE, i in I_CULTURAL_PRES, j in J_MGT_YEAR} Yield_Table_Vol[g,i,j,k] * XForestLand[g,i,j] >= Harvest_Min_Vol_Period; |
|||
|
|||
|
|||
#Even-Flow Constraint / Volume - Harvest Flow Constraint - Alpha |
|||
subject to Even_Flow_Constaints_Alpha {k in 6..K_PERIOD-1}: |
|||
(1 - Alpha) * sum {g in G_STAND_TYPE, i in I_CULTURAL_PRES, j in J_MGT_YEAR} Yield_Table_Vol[g,i,j,k] * XForestLand[g,i,j] - |
|||
sum {g in G_STAND_TYPE,i in I_CULTURAL_PRES, j in J_MGT_YEAR} Yield_Table_Vol[g,i,j,k+1] * XForestLand[g,i,j] <= 0; |
|||
|
|||
# Even-Flow Constraint / Volume - Harvest Flow Constraint - Beta |
|||
subject to Even_Flow_Constaints_Beta {k in 6..K_PERIOD-1}: |
|||
(1 + Beta) * sum {g in G_STAND_TYPE, i in I_CULTURAL_PRES, j in J_MGT_YEAR} Yield_Table_Vol[g,i,j,k] * XForestLand[g,i,j] - |
|||
sum {g in G_STAND_TYPE,i in I_CULTURAL_PRES, j in J_MGT_YEAR} Yield_Table_Vol[g,i,j,k+1] * XForestLand[g,i,j] >= 0; |
|||
|
|||
# Forest / Land Constraints |
|||
subject to Total_Area_Constraint: |
|||
sum {g in G_STAND_TYPE, i in I_CULTURAL_PRES, j in J_MGT_YEAR} XForestLand[g,i,j] <= Total_Area; |
|||
display Total_Area; |
|||
|
|||
# Forest / Land Constraints for A B C |
|||
subject to Area {g in G_STAND_TYPE}: |
|||
sum {i in I_CULTURAL_PRES,j in J_MGT_YEAR} XForestLand[g,i,j] = Area_Stand_Type[g]; |
|||
|
|||
|
|||
|
|||
solve; |
|||
#RESULT SECTION |
|||
printf '#################################\n'; |
|||
printf 'Forest Management Model I - Noli Sicad\n'; |
|||
printf '\n'; |
|||
printf 'Net Present Value = %.2f\n', NetPresentValue; |
|||
printf '\n'; |
|||
|
|||
printf '\n'; |
|||
printf 'Variables\n'; |
|||
printf 'Stand_Type Age_Class Mgt_Presc Sign Value \n'; |
|||
printf{g in G_STAND_TYPE, i in I_CULTURAL_PRES, j in J_MGT_YEAR}:'%5s %10s %11s = %10.2f\n', g,i,j, XForestLand[g,i,j]; |
|||
printf '\n'; |
|||
|
|||
printf 'Constraints\n'; |
|||
printf 'Period Harvest Sign \n'; |
|||
for {k in 1..K_PERIOD} { |
|||
printf '%5s %10.2f >= %.3f\n', k, sum {g in G_STAND_TYPE, i in I_CULTURAL_PRES, j in J_MGT_YEAR} Yield_Table_Vol[g,i,j,k] * XForestLand[g,i,j], Harvest_Min_Vol_Period; |
|||
} |
|||
|
|||
# xbase (dbf) output |
|||
table Harvest{k in 1..K_PERIOD} OUT "xBASE" "HarvestArea1.dbf" "N(5)N(15,2)" : k ~ Period, (sum {g in G_STAND_TYPE, i in I_CULTURAL_PRES, j in J_MGT_YEAR} Yield_Table_Vol[g,i,j,k] * XForestLand[g,i,j]) ~ H_Area; |
|||
|
|||
# xbase (dbf) read |
|||
set S, dimen 2; |
|||
table tab2 IN "xBASE" "HarvestArea1.dbf": S <- [Period, H_Area]; |
|||
display S; |
|||
|
|||
|
|||
|
|||
|
|||
printf '\n'; |
|||
printf 'Constraint\n'; |
|||
printf 'Harvest Period\n'; |
|||
printf 'Type AgeClass PrescMgt Period Value\n'; |
|||
printf{g in G_STAND_TYPE, i in I_CULTURAL_PRES, j in J_MGT_YEAR, k in 1..K_PERIOD}:'%5s %11s %11s %5s %10.2f\n', g,i,j, k, (Yield_Table_Vol[g,i,j,k] * XForestLand[g,i,j]); |
|||
|
|||
|
|||
printf 'Even_Flow_Constaint_Alpha (1-Alpha)\n'; |
|||
printf 'Period Sign \n'; |
|||
for {k in 6..K_PERIOD-1} { |
|||
printf "%s %10.2f <= %s\n", k, ((1 - Alpha) * sum {g in G_STAND_TYPE, i in I_CULTURAL_PRES, j in J_MGT_YEAR} Yield_Table_Vol[g,i,j,k] * XForestLand[g,i,j] - sum {g in G_STAND_TYPE,i in I_CULTURAL_PRES, j in J_MGT_YEAR} Yield_Table_Vol[g,i,j,k+1] * XForestLand[g,i,j]),0; |
|||
} |
|||
printf '\n'; |
|||
|
|||
|
|||
# Forest / Land Constraints |
|||
printf '\n'; |
|||
printf 'Total Area Constraint\n'; |
|||
printf 'Type AgeClass PrescMgt Value Sign Total_Area \n'; |
|||
printf '%5s <= %.3f\n',sum {g in G_STAND_TYPE, i in I_CULTURAL_PRES, j in J_MGT_YEAR} XForestLand[g,i,j], Total_Area; |
|||
|
|||
printf 'Area\n'; |
|||
printf 'Area Value Sign Areas_Stand\n'; |
|||
for {g in G_STAND_TYPE} { |
|||
printf '%5s %10.2f <= %.3f\n', g, sum {i in I_CULTURAL_PRES,j in J_MGT_YEAR} XForestLand[g,i,j], Area_Stand_Type[g]; |
|||
} |
|||
|
|||
|
|||
#DATA SECTION |
|||
|
|||
data; |
|||
|
|||
# Most of the data has been moved to dbf format |
|||
|
|||
param MGT:=31; |
|||
|
|||
param K_PERIOD:= 7; |
|||
|
|||
param Alpha:= 0.20; |
|||
param Beta:= 0.20; |
|||
|
|||
param Harvest_Min_Vol_Period:= 12000; |
|||
|
|||
end; |
|||
|
@ -0,0 +1,2 @@ |
|||
This subdirectory contains an example MathProg model that demonstrates |
|||
using data tables in DBF format. |
@ -0,0 +1,222 @@ |
|||
/* Data Envelopment Analysis (DEA) |
|||
* |
|||
* DEA quantifies the relative efficiency of decision making units (DMUs) by |
|||
* finding the efficient frontier in multiple input multiple output data. The |
|||
* inputs are resources (eg. number of employees, available machines, ...), |
|||
* the outputs are productive outputs (eg. contracts made, total sales, ...). |
|||
* The method is non-parametric. More details are available in the paper |
|||
* below. |
|||
* |
|||
* Models according to: Seiford, Threall, "Recent developments in DEA", 1990. |
|||
* |
|||
* Implementation: Sebastian Nowozin <nowozin@gmail.com> |
|||
*/ |
|||
|
|||
### SETS ### |
|||
|
|||
set dmus; # Decision Making Units (DMU) |
|||
set inputs; # Input parameters |
|||
set outputs; # Output parameters |
|||
|
|||
|
|||
### PARAMETERS ### |
|||
|
|||
param input_data{dmus,inputs} >= 0; |
|||
param output_data{dmus,outputs} >= 0; |
|||
|
|||
|
|||
### PROGRAM ### |
|||
|
|||
var theta{dmus} >= 0; |
|||
var lambda{dmus,dmus} >= 0; |
|||
|
|||
minimize inefficiency: sum{td in dmus} theta[td]; |
|||
|
|||
s.t. output_lower_limit{o in outputs, td in dmus}: |
|||
sum{d in dmus} lambda[d,td]*output_data[d,o] >= output_data[td,o]; |
|||
s.t. input_upper_limit{i in inputs, td in dmus}: |
|||
sum{d in dmus} lambda[d,td]*input_data[d,i] <= theta[td]*input_data[td,i]; |
|||
|
|||
s.t. PI1{td in dmus}: |
|||
sum{d in dmus} lambda[d,td] = 1; |
|||
/* |
|||
possibilities: |
|||
i) (no constraint) |
|||
ii) s.t. PI1{td in dmus}: |
|||
sum{d in dmus} lambda[d,td] <= 1; |
|||
iii) s.t. PI1{td in dmus}: |
|||
sum{d in dmus} lambda[d,td] >= 1; |
|||
*/ |
|||
|
|||
|
|||
### SOLVE AND PRINT SOLUTION ### |
|||
|
|||
solve; |
|||
|
|||
printf "DMU\tEfficiency\n"; |
|||
for {td in dmus} { |
|||
printf "%s\t%1.4f\n", td, theta[td]; |
|||
} |
|||
|
|||
### DATA ### |
|||
|
|||
data; |
|||
|
|||
set dmus := 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
|||
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
|||
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 |
|||
61 62 63 64 65 66 67 68 69 ; |
|||
set inputs := AvgInventory LaborCost OperatingCost Population ; |
|||
set outputs := PrescrVol kDollarValue ; |
|||
|
|||
param input_data default 0.0 : |
|||
|
|||
AvgInventory LaborCost OperatingCost Population := |
|||
|
|||
1 8000 17030 1280 1410 |
|||
2 9000 25890 2779 1523 |
|||
3 13694 29076 2372 1354 |
|||
4 4250 17506 1385 822 |
|||
5 6500 23208 639 746 |
|||
6 7000 12946 802 1281 |
|||
7 4500 18001 1130 1016 |
|||
8 5000 14473 1097 1070 |
|||
9 27000 31760 5559 1694 |
|||
10 21560 50972 15010 1910 |
|||
11 15000 39523 4799 1745 |
|||
12 8500 13076 3489 1353 |
|||
13 35000 35427 1704 500 |
|||
14 18000 27554 2882 1016 |
|||
15 59750 53848 14208 2500 |
|||
16 19200 38253 1480 2293 |
|||
17 40000 109404 83016 2718 |
|||
18 8466 18198 1278 2877 |
|||
19 16000 40891 7599 4150 |
|||
20 10000 45444 5556 4421 |
|||
21 25000 35623 2121 3883 |
|||
22 14000 20192 5515 3519 |
|||
23 12500 34973 10475 32366 |
|||
24 17260 32284 14498 3393 |
|||
25 7000 17920 7585 4489 |
|||
26 14000 42094 3742 2217 |
|||
27 16400 35422 14236 4641 |
|||
28 13000 19100 3529 5968 |
|||
29 30000 72167 8656 8715 |
|||
30 12530 19970 1714 5968 |
|||
31 31500 39183 4919 5607 |
|||
32 10000 32048 3483 7324 |
|||
33 22000 68877 12279 8685 |
|||
34 10000 29812 3332 8685 |
|||
35 16000 47686 2507 5420 |
|||
36 10000 33415 4738 7703 |
|||
37 9000 12359 4603 4665 |
|||
38 16439 23614 2989 6317 |
|||
39 14500 36069 1793 31839 |
|||
40 39000 76307 9539 15619 |
|||
41 24927 40706 12661 30213 |
|||
42 13858 39267 4609 34719 |
|||
43 33375 29509 11323 31839 |
|||
44 29044 44482 5542 34719 |
|||
45 32257 61365 20550 32366 |
|||
46 8800 49671 3306 43561 |
|||
47 47000 40425 10396 31263 |
|||
48 12000 33034 4915 31263 |
|||
49 28000 69163 4688 15173 |
|||
50 13300 28931 16735 73064 |
|||
51 13500 29758 4260 62309 |
|||
52 24000 40927 8285 23166 |
|||
53 16000 40403 2131 99836 |
|||
54 17000 38730 2539 60348 |
|||
55 25000 35978 2502 99836 |
|||
56 16000 37509 6278 99836 |
|||
57 20000 46950 10715 85925 |
|||
58 14000 35966 3144 85925 |
|||
59 22000 68318 8015 108987 |
|||
60 21879 69537 7778 108987 |
|||
61 15000 25425 2812 201404 |
|||
62 10000 19508 2454 201404 |
|||
63 20000 28191 3367 201404 |
|||
64 18000 37073 8624 108987 |
|||
65 19051 23763 3496 201404 |
|||
66 15000 28642 3366 201404 |
|||
67 10000 35919 3868 201404 |
|||
68 24000 54653 26494 108987 |
|||
69 1800 6276 3413 60348 |
|||
; |
|||
|
|||
param output_data default 0.0 : |
|||
|
|||
PrescrVol kDollarValue := |
|||
|
|||
1 12293 61.00 |
|||
2 18400 92.00 |
|||
3 16789 92.65 |
|||
4 10700 45.00 |
|||
5 9800 50.00 |
|||
6 6500 29.00 |
|||
7 8200 56.00 |
|||
8 8680 45.00 |
|||
9 33800 183.00 |
|||
10 23710 156.00 |
|||
11 24000 120.00 |
|||
12 17500 75.00 |
|||
13 25000 130.00 |
|||
14 26000 122.00 |
|||
15 26830 178.513 |
|||
16 16600 106.00 |
|||
17 90000 450.00 |
|||
18 11140 73.624 |
|||
19 25868 136.00 |
|||
20 32700 191.295 |
|||
21 29117 152.864 |
|||
22 18000 100.00 |
|||
23 11100 60.00 |
|||
24 23030 137.778 |
|||
25 10656 58.00 |
|||
26 24682 152.095 |
|||
27 26908 120.00 |
|||
28 16464 80.00 |
|||
29 57000 321.00 |
|||
30 17532 94.747 |
|||
31 30035 168.00 |
|||
32 16000 100.00 |
|||
33 63700 277.00 |
|||
34 18000 90.00 |
|||
35 27339 139.134 |
|||
36 19500 116.00 |
|||
37 13000 80.00 |
|||
38 15370 102.00 |
|||
39 18446 90.00 |
|||
40 56000 260.00 |
|||
41 73845 364.951 |
|||
42 28600 145.00 |
|||
43 27000 243.00 |
|||
44 52423 279.816 |
|||
45 73759 363.388 |
|||
46 20500 80.00 |
|||
47 27100 115.00 |
|||
48 15000 110.00 |
|||
49 50895 277.852 |
|||
50 19707 128.00 |
|||
51 17994 78.80 |
|||
52 36135 167.222 |
|||
53 30000 153.00 |
|||
54 26195 125.00 |
|||
55 28000 216.00 |
|||
56 24658 152.551 |
|||
57 36850 190.00 |
|||
58 29250 183.69 |
|||
59 50000 250.00 |
|||
60 40078 265.443 |
|||
61 20200 110.00 |
|||
62 12500 75.00 |
|||
63 30890 195.00 |
|||
64 31000 175.00 |
|||
65 31277 192.992 |
|||
66 11500 75.00 |
|||
67 30000 175.668 |
|||
68 38383 190.00 |
|||
69 2075 8.650 |
|||
; |
|||
|
|||
end; |
@ -0,0 +1,99 @@ |
|||
# STIGLER'S NUTRITION MODEL |
|||
# |
|||
# This model determines a least cost diet which meets the daily |
|||
# allowances of nutrients for a moderately active man weighing 154 lbs. |
|||
# |
|||
# References: |
|||
# Dantzig G B, "Linear Programming and Extensions." |
|||
# Princeton University Press, Princeton, New Jersey, 1963, |
|||
# Chapter 27-1. |
|||
|
|||
set N; |
|||
/* nutrients */ |
|||
|
|||
set F; |
|||
/* foods */ |
|||
|
|||
param b{N}; |
|||
/* required daily allowances of nutrients */ |
|||
|
|||
param a{F,N}; |
|||
/* nutritive value of foods (per dollar spent) */ |
|||
|
|||
var x{f in F} >= 0; |
|||
/* dollars of food f to be purchased daily */ |
|||
|
|||
s.t. nb{n in N}: sum{f in F} a[f,n] * x[f] = b[n]; |
|||
/* nutrient balance (units) */ |
|||
|
|||
minimize cost: sum{f in F} x[f]; |
|||
/* total food bill (dollars) */ |
|||
|
|||
data; |
|||
|
|||
param : N : b := |
|||
Calorie 3 /* thousands */ |
|||
Protein 70 /* grams */ |
|||
Calcium 0.8 /* grams */ |
|||
Iron 12 /* milligrams */ |
|||
Vitamin-A 5 /* thousands IUs */ |
|||
Vitamin-B1 1.8 /* milligrams */ |
|||
Vitamin-B2 2.7 /* milligrams */ |
|||
Niacin 18 /* milligrams */ |
|||
Vitamin-C 75 /* milligrams */ ; |
|||
|
|||
set F := Wheat Cornmeal Cannedmilk Margarine Cheese Peanut-B Lard |
|||
Liver Porkroast Salmon Greenbeans Cabbage Onions Potatoes |
|||
Spinach Sweet-Pot Peaches Prunes Limabeans Navybeans; |
|||
|
|||
param a default 0 |
|||
|
|||
: Calorie Protein Calcium Iron Vitamin-A Vitamin-B1 := |
|||
# (1000) (g) (g) (mg) (1000IU) (mg) |
|||
|
|||
Wheat 44.7 1411 2.0 365 . 55.4 |
|||
Cornmeal 36 897 1.7 99 30.9 17.4 |
|||
Cannedmilk 8.4 422 15.1 9 26 3 |
|||
Margarine 20.6 17 .6 6 55.8 .2 |
|||
Cheese 7.4 448 16.4 19 28.1 .8 |
|||
Peanut-B 15.7 661 1 48 . 9.6 |
|||
Lard 41.7 . . . .2 . |
|||
Liver 2.2 333 .2 139 169.2 6.4 |
|||
Porkroast 4.4 249 .3 37 . 18.2 |
|||
Salmon 5.8 705 6.8 45 3.5 1 |
|||
Greenbeans 2.4 138 3.7 80 69 4.3 |
|||
Cabbage 2.6 125 4 36 7.2 9 |
|||
Onions 5.8 166 3.8 59 16.6 4.7 |
|||
Potatoes 14.3 336 1.8 118 6.7 29.4 |
|||
Spinach 1.1 106 . 138 918.4 5.7 |
|||
Sweet-Pot 9.6 138 2.7 54 290.7 8.4 |
|||
Peaches 8.5 87 1.7 173 86.8 1.2 |
|||
Prunes 12.8 99 2.5 154 85.7 3.9 |
|||
Limabeans 17.4 1055 3.7 459 5.1 26.9 |
|||
Navybeans 26.9 1691 11.4 792 . 38.4 |
|||
|
|||
: Vitamin-B2 Niacin Vitamin-C := |
|||
# (mg) (mg) (mg) |
|||
|
|||
Wheat 33.3 441 . |
|||
Cornmeal 7.9 106 . |
|||
Cannedmilk 23.5 11 60 |
|||
Margarine . . . |
|||
Cheese 10.3 4 . |
|||
Peanut-B 8.1 471 . |
|||
Lard .5 5 . |
|||
Liver 50.8 316 525 |
|||
Porkroast 3.6 79 . |
|||
Salmon 4.9 209 . |
|||
Greenbeans 5.8 37 862 |
|||
Cabbage 4.5 26 5369 |
|||
Onions 5.9 21 1184 |
|||
Potatoes 7.1 198 2522 |
|||
Spinach 13.8 33 2755 |
|||
Sweet-Pot 5.4 83 1912 |
|||
Peaches 4.3 55 57 |
|||
Prunes 4.3 65 257 |
|||
Limabeans 38.2 93 . |
|||
Navybeans 24.6 217 . ; |
|||
|
|||
end; |
@ -0,0 +1,565 @@ |
|||
# DIST, a product distribution model |
|||
# |
|||
# References: |
|||
# Robert Fourer, David M. Gay and Brian W. Kernighan, "A Modeling Language |
|||
# for Mathematical Programming." Management Science 36 (1990) 519-554. |
|||
|
|||
### SHIPPING SETS AND PARAMETERS ### |
|||
|
|||
set whse 'warehouses'; # Locations from which demand is satisfied |
|||
|
|||
set dctr 'distribution centers' within whse; |
|||
|
|||
# Locations from which product may be shipped |
|||
|
|||
param sc 'shipping cost' {dctr,whse} >= 0; |
|||
|
|||
# Shipping costs, to whse from dctr, in $ / 100 lb |
|||
|
|||
param huge 'largest shipping cost' > 0; |
|||
|
|||
# Largest cost allowed for a usable shipping route |
|||
|
|||
param msr 'minimum size restriction' {dctr,whse} logical; |
|||
|
|||
# True indicates a minimum-size restriction on |
|||
# direct shipments using this dctr --> whse route |
|||
|
|||
param dsr 'direct shipment requirement' {dctr} >= 0; |
|||
|
|||
# Minimum total demand, in pallets, needed to |
|||
# allow shipment on routes subject to the |
|||
# minimum size restriction |
|||
|
|||
### PLANT SETS AND PARAMETERS ### |
|||
|
|||
set fact 'factories' within dctr; |
|||
|
|||
# Locations where product is manufactured |
|||
|
|||
param rtmin 'regular-time total minimum' >= 0; |
|||
|
|||
# Lower limit on (average) total regular-time |
|||
# crews employed at all factories |
|||
|
|||
param rtmax 'regular-time total maximum' >= rtmin; |
|||
|
|||
# Upper limit on (average) total regular-time |
|||
# crews employed at all factories |
|||
|
|||
param otmin 'overtime total minimum' >= 0; |
|||
|
|||
# Lower limit on total overtime hours at all factories |
|||
|
|||
param otmax 'overtime total maximum' >= otmin; |
|||
|
|||
# Upper limit on total overtime hours at all factories |
|||
|
|||
param rmin 'regular-time minimums' {fact} >= 0; |
|||
|
|||
# Lower limits on (average) regular-time crews |
|||
|
|||
param rmax 'regular-time maximums' {f in fact} >= rmin[f]; |
|||
|
|||
# Upper limits on (average) regular-time crews |
|||
|
|||
param omin 'overtime minimums' {fact} >= 0; |
|||
|
|||
# Lower limits on overtime hours |
|||
|
|||
param omax 'overtime maximums' {f in fact} >= omin[f]; |
|||
|
|||
# Upper limits on overtime hours |
|||
|
|||
param hd 'hours per day' {fact} >= 0; |
|||
|
|||
# Regular-time hours per working day |
|||
|
|||
param dp 'days in period' {fact} > 0; |
|||
|
|||
# Working days in the current planning period |
|||
|
|||
### PRODUCT SETS AND PARAMETERS ### |
|||
|
|||
set prd 'products'; # Elements of the product group |
|||
|
|||
param wt 'weight' {prd} > 0; |
|||
|
|||
# Weight in 100 lb / 1000 cases |
|||
|
|||
param cpp 'cases per pallet' {prd} > 0; |
|||
|
|||
# Cases of product per shipping pallet |
|||
|
|||
param tc 'transshipment cost' {prd} >= 0; |
|||
|
|||
# Transshipment cost in $ / 1000 cases |
|||
|
|||
param pt 'production time' {prd,fact} >= 0; |
|||
|
|||
# Crew-hours to produce 1000 cases |
|||
|
|||
param rpc 'regular-time production cost' {prd,fact} >= 0; |
|||
|
|||
# Cost of production on regular time, |
|||
# in $ / 1000 cases |
|||
|
|||
param opc 'overtime production cost' {prd,fact} >= 0; |
|||
|
|||
# Cost of production on overtime, in $ / 1000 cases |
|||
|
|||
### DEMAND SETS AND PARAMETERS ### |
|||
|
|||
param dt 'total demand' {prd} >= 0; |
|||
|
|||
# Total demands for products, in 1000s |
|||
|
|||
param ds 'demand shares' {prd,whse} >= 0.0, <= 1.0; |
|||
|
|||
# Historical demand data, from which each |
|||
# warehouse's share of total demand is deduced |
|||
|
|||
param dstot {p in prd} := sum {w in whse} ds[p,w]; |
|||
|
|||
# Total of demand shares; should be 1, but often isn't |
|||
|
|||
param dem 'demand' {p in prd, w in whse} := dt[p] * ds[p,w] / dstot[p]; |
|||
|
|||
# Projected demands to be satisfied, in 1000s |
|||
|
|||
set rt 'shipping routes available' := |
|||
|
|||
{d in dctr, w in whse: |
|||
d <> w and sc[d,w] < huge and |
|||
(w in dctr or sum {p in prd} dem[p,w] > 0) and |
|||
not (msr[d,w] and sum {p in prd} 1000*dem[p,w]/cpp[p] < dsr[d]) }; |
|||
|
|||
# List of ordered pairs that represent routes |
|||
# on which shipments are allowed |
|||
|
|||
### VARIABLES ### |
|||
|
|||
var Rprd 'regular-time production' {prd,fact} >= 0; |
|||
|
|||
# Regular-time production of each product |
|||
# at each factory, in 1000s of cases |
|||
|
|||
var Oprd 'overtime production' {prd,fact} >= 0; |
|||
|
|||
# Overtime production of each product |
|||
# at each factory, in 1000s of cases |
|||
|
|||
var Ship 'shipments' {prd,rt} >= 0; |
|||
|
|||
# Shipments of each product on each allowed route, |
|||
# in 1000s of cases |
|||
|
|||
var Trans 'transshipments' {prd,dctr} >= 0; |
|||
|
|||
# Transshipments of each product at each |
|||
# distribution center, in 1000s of cases |
|||
|
|||
### OBJECTIVE ### |
|||
|
|||
minimize cost: sum {p in prd, f in fact} rpc[p,f] * Rprd[p,f] + |
|||
sum {p in prd, f in fact} opc[p,f] * Oprd[p,f] + |
|||
sum {p in prd, (d,w) in rt} sc[d,w] * wt[p] * Ship[p,d,w] + |
|||
sum {p in prd, d in dctr} tc[p] * Trans[p,d]; |
|||
|
|||
# Total cost: regular production, overtime |
|||
# production, shipping, and transshipment |
|||
|
|||
### CONSTRAINTS ### |
|||
|
|||
rtlim 'regular-time total limits': |
|||
|
|||
rtmin <= sum {p in prd, f in fact} |
|||
(pt[p,f] * Rprd[p,f]) / (dp[f] * hd[f]) <= rtmax; |
|||
|
|||
# Total crews must lie between limits |
|||
|
|||
otlim 'overtime total limits': |
|||
|
|||
otmin <= sum {p in prd, f in fact} pt[p,f] * Oprd[p,f] <= otmax; |
|||
|
|||
# Total overtime must lie between limits |
|||
|
|||
rlim 'regular-time limits' {f in fact}: |
|||
|
|||
rmin[f] <= sum {p in prd} |
|||
(pt[p,f] * Rprd[p,f]) / (dp[f] * hd[f]) <= rmax[f]; |
|||
|
|||
# Crews at each factory must lie between limits |
|||
|
|||
olim 'overtime limits' {f in fact}: |
|||
|
|||
omin[f] <= sum {p in prd} pt[p,f] * Oprd[p,f] <= omax[f]; |
|||
|
|||
# Overtime at each factory must lie between limits |
|||
|
|||
noRprd 'no regular production' {p in prd, f in fact: rpc[p,f] = 0}: |
|||
|
|||
Rprd[p,f] = 0; |
|||
|
|||
noOprd 'no overtime production' {p in prd, f in fact: opc[p,f] = 0}: |
|||
|
|||
Oprd[p,f] = 0; # Do not produce where specified cost is zero |
|||
|
|||
bal 'material balance' {p in prd, w in whse}: |
|||
|
|||
sum {(v,w) in rt} |
|||
Ship [p,v,w] + (if w in fact then Rprd[p,w] + Oprd[p,w]) = |
|||
|
|||
dem[p,w] + (if w in dctr then sum {(w,v) in rt} Ship[p,w,v]); |
|||
|
|||
# Demand is satisfied by shipment into warehouse |
|||
# plus production (if it is a factory) |
|||
# minus shipment out (if it is a distn. center) |
|||
|
|||
trdef 'transshipment definition' {p in prd, d in dctr}: |
|||
|
|||
Trans[p,d] >= sum {(d,w) in rt} Ship [p,d,w] - |
|||
(if d in fact then Rprd[p,d] + Oprd[p,d]); |
|||
|
|||
# Transshipment at a distribution center is |
|||
# shipments out less production (if any) |
|||
|
|||
### DATA -- 3 PRODUCTS ### |
|||
|
|||
data; |
|||
|
|||
set prd := 18REG 24REG 24PRO ; |
|||
|
|||
set whse := w01 w02 w03 w04 w05 w06 w08 w09 w12 w14 w15 w17 |
|||
w18 w19 w20 w21 w24 w25 w26 w27 w28 w29 w30 w31 |
|||
w32 w33 w34 w35 w36 w37 w38 w39 w40 w41 w42 w43 |
|||
w44 w45 w46 w47 w48 w49 w50 w51 w53 w54 w55 w56 |
|||
w57 w59 w60 w61 w62 w63 w64 w65 w66 w68 w69 w71 |
|||
w72 w73 w74 w75 w76 w77 w78 w79 w80 w81 w82 w83 |
|||
w84 w85 w86 w87 w89 w90 w91 w92 w93 w94 w95 w96 |
|||
w98 x22 x23 ; |
|||
|
|||
set dctr := w01 w02 w03 w04 w05 w62 w76 w96 ; |
|||
|
|||
set fact := w01 w05 w96 ; |
|||
|
|||
param huge := 99. ; |
|||
|
|||
param rtmin := 0.0 ; |
|||
param rtmax := 8.0 ; |
|||
|
|||
param otmin := 0.0 ; |
|||
param otmax := 96.0 ; |
|||
|
|||
param rmin := w01 0.00 w05 0.00 w96 0.00 ; |
|||
param rmax := w01 3.00 w05 2.00 w96 3.00 ; |
|||
|
|||
param omin := w01 0.0 w05 0.0 w96 0.0 ; |
|||
param omax := w01 48.0 w05 0.0 w96 48.0 ; |
|||
|
|||
param hd := w01 8.0 w05 8.0 w96 8.0 ; |
|||
|
|||
param dp := w01 19.0 w05 19.0 w96 19.0 ; |
|||
|
|||
param wt := 18REG 47.3 24REG 63.0 24PRO 63.0 ; |
|||
|
|||
param tc := 18REG 40.00 24REG 45.00 24PRO 45.00 ; |
|||
|
|||
param dt := 18REG 376.0 24REG 172.4 24PRO 316.3 ; |
|||
|
|||
param cpp := 18REG 102. 24REG 91. 24PRO 91. ; |
|||
|
|||
param dsr := w01 96. w02 96. w03 96. w04 96. w05 96. |
|||
w62 96. w76 96. w96 96. ; |
|||
|
|||
param pt (tr) : |
|||
|
|||
18REG 24REG 24PRO := |
|||
|
|||
w01 1.194 1.429 1.429 |
|||
w05 1.194 1.509 1.509 |
|||
w96 0.000 1.600 1.600 ; |
|||
|
|||
param rpc (tr) : |
|||
|
|||
18REG 24REG 24PRO := |
|||
|
|||
w01 2119. 2653. 2617. |
|||
w05 2489. 3182. 3176. |
|||
w96 0. 2925. 2918. ; |
|||
|
|||
param opc (tr) : |
|||
|
|||
18REG 24REG 24PRO := |
|||
|
|||
w01 2903. 3585. 3579. |
|||
w05 0. 0. 0. |
|||
w96 0. 3629. 3622. ; |
|||
|
|||
param sc default 99.99 (tr) : |
|||
|
|||
w01 w02 w03 w04 w05 w62 w76 w96 := |
|||
|
|||
w01 . 2.97 1.14 2.08 2.37 1.26 2.42 1.43 |
|||
w02 4.74 . 4.17 6.12 7.41 3.78 7.04 5.21 |
|||
w03 2.45 4.74 . 3.67 2.84 0.90 2.41 2.55 |
|||
w04 1.74 5.03 2.43 . 3.19 2.45 2.69 0.58 |
|||
w05 2.70 5.16 2.84 2.85 . 3.26 3.34 2.71 |
|||
w06 1.99 4.17 2.13 2.19 2.52 2.06 2.00 1.51 |
|||
w08 0.21 2.92 1.24 2.07 2.29 1.25 2.32 1.55 |
|||
w09 0.66 3.76 1.41 2.47 1.82 1.66 . 1.87 |
|||
w12 1.38 3.83 1.68 2.53 2.39 . 1.96 1.94 |
|||
w14 2.47 1.58 2.40 3.59 3.85 2.25 . 3.05 |
|||
w15 1.06 4.95 2.48 1.39 3.41 1.96 . 1.02 |
|||
w17 0.88 3.39 1.46 2.00 2.67 1.45 . 1.46 |
|||
w18 7.90 6.57 7.79 9.59 10.81 . . 6.70 |
|||
w19 1.42 4.12 1.96 1.99 3.52 1.88 . 1.26 |
|||
w20 3.03 1.59 2.34 4.76 3.98 1.88 . 3.73 |
|||
w24 1.58 2.80 2.27 2.87 3.19 1.31 . 2.05 |
|||
w25 1.51 5.05 2.74 0.57 2.98 . 2.95 0.27 |
|||
w26 1.75 3.61 2.70 1.54 4.07 3.52 . 1.03 |
|||
w27 2.48 6.87 3.17 1.59 2.08 3.45 . 0.99 |
|||
w28 2.05 6.83 2.97 1.13 2.91 . . 1.26 |
|||
w29 4.03 3.68 4.46 3.20 5.50 . . 3.20 |
|||
w30 2.48 5.78 2.99 2.24 1.79 3.10 . 1.39 |
|||
w31 2.34 5.41 2.87 1.67 1.66 . . 1.39 |
|||
w32 14.36 . . . . . . . |
|||
w33 3.87 4.27 5.11 3.48 5.66 4.03 . 3.05 |
|||
w34 3.26 4.80 3.21 2.70 4.14 . . 1.77 |
|||
w35 2.34 2.84 2.89 3.35 3.78 2.68 . 2.52 |
|||
w36 2.43 5.69 2.96 2.95 1.02 2.61 1.07 2.54 |
|||
w37 2.23 4.64 2.41 1.99 4.30 2.61 . 1.44 |
|||
w38 4.66 4.36 5.23 3.04 4.46 . . 3.82 |
|||
w39 1.11 3.51 1.10 2.53 3.07 1.12 . 2.23 |
|||
w40 2.99 4.78 4.23 1.57 3.92 . . 1.80 |
|||
w41 4.93 4.00 5.43 4.45 6.31 . . 3.81 |
|||
w42 3.86 6.55 5.03 2.11 4.41 . . 2.63 |
|||
w43 4.61 4.45 3.77 1.22 4.31 . . 2.35 |
|||
w44 2.05 4.48 1.06 3.70 3.46 1.10 . 3.21 |
|||
w45 0.92 3.42 1.58 3.04 1.82 1.94 . 2.52 |
|||
w46 1.36 2.44 0.95 3.08 2.78 0.39 2.16 2.37 |
|||
w47 1.30 3.39 1.60 2.49 4.29 2.04 . 1.68 |
|||
w48 1.65 3.78 1.03 2.97 2.21 1.31 . 2.74 |
|||
w49 1.96 3.00 1.50 3.24 3.68 1.00 . 2.99 |
|||
w50 0.90 4.14 1.60 1.95 3.61 1.61 . 1.52 |
|||
w51 1.59 3.95 0.25 2.96 2.58 1.00 2.41 2.71 |
|||
w53 1.59 3.79 1.28 3.12 3.10 0.89 . 2.98 |
|||
w54 1.72 4.36 1.61 2.92 2.34 1.91 1.97 3.05 |
|||
w55 2.45 2.73 2.21 4.47 4.30 2.57 . 4.48 |
|||
w56 1.10 3.73 1.59 2.74 2.33 1.45 . 2.44 |
|||
w57 0.95 3.39 1.37 2.30 2.47 1.15 . 1.95 |
|||
w59 3.29 5.35 3.32 3.81 1.52 3.38 1.34 4.08 |
|||
w60 2.41 6.12 2.46 3.65 2.35 . 1.37 4.06 |
|||
w61 3.32 5.50 3.41 3.38 1.23 . 0.99 4.28 |
|||
w62 1.12 3.00 0.82 3.22 2.95 . 3.33 2.53 |
|||
w63 3.59 6.36 3.25 4.12 1.84 3.59 1.46 4.03 |
|||
w64 1.85 4.45 2.17 3.43 2.13 2.03 . 4.02 |
|||
w65 2.78 4.79 2.81 2.94 1.54 2.90 1.07 2.94 |
|||
w66 3.90 5.79 3.05 3.65 1.36 3.39 1.22 3.57 |
|||
w68 2.61 5.20 2.90 2.34 1.68 3.19 1.48 2.31 |
|||
w69 2.94 5.21 2.78 3.43 0.21 3.26 0.68 2.54 |
|||
w71 2.06 4.98 2.38 2.44 1.59 2.97 1.05 2.55 |
|||
w72 2.61 5.50 2.83 3.12 1.35 3.23 0.88 2.99 |
|||
w73 8.52 6.16 8.03 8.83 10.44 7.38 10.26 . |
|||
w74 6.11 5.46 9.07 9.38 10.80 . . 8.25 |
|||
w75 2.66 4.94 2.87 3.69 1.52 3.15 1.24 4.00 |
|||
w76 1.99 5.26 2.23 3.36 0.58 3.17 . 2.50 |
|||
w77 4.32 3.07 5.05 3.88 6.04 . . 4.15 |
|||
w78 5.60 2.59 5.78 5.56 7.10 . . 5.60 |
|||
w79 4.25 2.32 4.93 4.57 6.04 . . 4.58 |
|||
w80 5.94 4.00 5.60 7.02 9.46 . . 7.51 |
|||
w81 5.39 2.21 5.10 6.22 6.46 . . 6.58 |
|||
w82 8.80 5.69 9.29 9.88 11.69 8.63 11.52 . |
|||
w83 4.40 . 5.24 5.21 5.81 3.91 7.04 5.33 |
|||
w84 5.87 5.43 6.17 5.70 7.63 . . 5.70 |
|||
w85 3.90 3.65 3.38 4.57 5.64 3.05 . 5.04 |
|||
w86 5.48 2.10 5.70 6.37 7.33 . . 6.19 |
|||
w87 8.88 5.54 9.50 9.71 11.64 8.85 11.68 . |
|||
w89 4.62 4.01 4.03 6.30 6.30 3.81 . 7.77 |
|||
w90 4.35 2.72 4.61 4.01 5.60 . . 3.20 |
|||
w91 7.61 4.42 7.83 6.85 8.79 . . 7.66 |
|||
w92 7.15 2.69 6.91 7.20 . . . 7.06 |
|||
w93 3.17 3.95 4.37 3.74 5.05 . . 2.40 |
|||
w94 1.21 3.07 0.90 2.74 3.17 . 2.63 2.39 |
|||
w95 5.82 3.29 6.55 7.06 11.47 . . 7.83 |
|||
w96 1.77 5.20 2.72 0.59 3.47 2.48 . . |
|||
w98 3.04 1.92 3.64 3.70 4.90 3.05 . 3.88 |
|||
x22 4.08 6.25 4.15 4.30 1.77 . 1.77 . |
|||
x23 3.39 5.74 3.55 4.08 1.69 . 1.47 . ; |
|||
|
|||
param msr (tr) : |
|||
|
|||
w01 w02 w03 w04 w05 w62 w76 w96 := |
|||
|
|||
w01 0 0 0 0 0 0 1 0 |
|||
w02 0 0 0 0 0 0 1 0 |
|||
w03 0 0 0 0 0 0 1 0 |
|||
w04 0 0 0 0 0 0 1 0 |
|||
w05 0 0 0 0 0 0 0 0 |
|||
w06 0 1 1 1 1 1 1 1 |
|||
w08 0 1 1 1 1 1 1 1 |
|||
w09 0 1 1 1 1 1 0 1 |
|||
w12 0 1 1 1 1 0 1 1 |
|||
w14 1 1 1 1 1 0 0 1 |
|||
w15 0 1 1 1 1 1 0 1 |
|||
w17 0 1 1 1 1 1 0 1 |
|||
w18 0 1 1 1 1 0 0 1 |
|||
w19 0 1 1 1 1 0 0 1 |
|||
w20 1 1 1 1 1 0 0 1 |
|||
w24 0 1 1 1 1 0 0 1 |
|||
w25 0 1 1 1 1 0 1 0 |
|||
w26 1 1 1 0 1 1 0 1 |
|||
w27 1 1 1 0 1 1 0 1 |
|||
w28 1 1 1 0 1 0 0 1 |
|||
w29 0 1 1 1 1 0 0 1 |
|||
w30 1 1 1 0 1 1 0 1 |
|||
w31 1 1 1 0 1 0 0 1 |
|||
w32 0 0 0 0 0 0 0 0 |
|||
w33 1 0 1 1 1 1 0 1 |
|||
w34 1 1 1 0 1 0 0 1 |
|||
w35 1 1 1 1 1 0 0 1 |
|||
w36 0 1 1 1 0 1 1 1 |
|||
w37 1 1 1 0 1 1 0 1 |
|||
w38 1 1 1 0 1 0 0 1 |
|||
w39 0 1 1 1 1 1 0 1 |
|||
w40 1 1 1 0 1 0 0 1 |
|||
w41 1 0 1 1 1 0 0 1 |
|||
w42 1 1 1 0 1 0 0 1 |
|||
w43 1 1 1 0 1 0 0 1 |
|||
w44 1 1 1 1 1 0 0 1 |
|||
w45 0 1 1 1 1 1 0 1 |
|||
w46 0 1 1 1 1 0 1 1 |
|||
w47 0 1 1 1 1 1 0 1 |
|||
w48 0 1 1 1 1 0 0 1 |
|||
w49 1 1 1 1 1 0 0 1 |
|||
w50 0 1 1 1 1 1 0 1 |
|||
w51 0 1 1 1 1 0 1 1 |
|||
w53 1 1 1 1 1 0 0 1 |
|||
w54 0 1 1 1 1 1 1 1 |
|||
w55 0 1 1 1 1 0 0 1 |
|||
w56 0 1 1 1 1 1 0 1 |
|||
w57 0 1 1 1 1 1 0 1 |
|||
w59 0 1 1 1 0 1 1 1 |
|||
w60 0 1 1 1 1 0 1 1 |
|||
w61 0 1 1 1 0 0 1 1 |
|||
w62 0 0 0 0 0 0 1 0 |
|||
w63 0 1 1 1 0 1 1 1 |
|||
w64 0 1 1 1 1 1 0 1 |
|||
w65 0 1 1 1 0 1 1 1 |
|||
w66 0 1 1 1 0 1 1 1 |
|||
w68 0 1 1 1 0 1 1 1 |
|||
w69 0 1 1 1 0 1 1 1 |
|||
w71 0 1 1 1 0 1 1 1 |
|||
w72 0 1 1 1 0 1 1 1 |
|||
w73 0 1 1 1 0 1 1 0 |
|||
w74 0 1 1 1 0 0 0 1 |
|||
w75 0 1 1 1 0 1 1 1 |
|||
w76 0 0 0 0 0 0 0 0 |
|||
w77 1 0 1 1 1 0 0 1 |
|||
w78 1 0 1 1 1 0 0 1 |
|||
w79 1 0 1 1 1 0 0 1 |
|||
w80 1 0 1 1 1 0 0 1 |
|||
w81 1 0 1 1 1 0 0 1 |
|||
w82 1 0 1 1 1 1 1 0 |
|||
w83 1 0 1 1 1 0 1 1 |
|||
w84 1 0 1 1 1 0 0 1 |
|||
w85 1 1 1 1 1 0 0 1 |
|||
w86 1 0 1 1 1 0 0 1 |
|||
w87 1 0 1 1 1 1 1 0 |
|||
w89 1 0 1 1 1 1 0 1 |
|||
w90 0 1 1 1 1 0 0 1 |
|||
w91 1 0 1 1 1 0 0 1 |
|||
w92 1 0 1 1 1 0 0 1 |
|||
w93 1 1 1 0 1 0 0 1 |
|||
w94 0 0 1 1 1 0 1 1 |
|||
w95 1 0 1 1 1 0 0 1 |
|||
w96 0 0 0 0 0 0 0 0 |
|||
w98 1 0 1 1 1 1 0 1 |
|||
x22 1 1 1 1 0 0 1 0 |
|||
x23 1 1 1 1 0 0 1 0 ; |
|||
|
|||
param ds default 0.000 (tr) : |
|||
|
|||
18REG 24REG 24PRO := |
|||
|
|||
w01 0.000 0.000 0.008 |
|||
w02 0.004 0.000 0.000 |
|||
w03 0.000 0.000 0.000 |
|||
w04 0.010 0.002 0.000 |
|||
w05 0.000 0.000 0.000 |
|||
w06 0.010 0.008 0.008 |
|||
w08 0.030 0.024 0.024 |
|||
w09 0.014 0.018 0.020 |
|||
w12 0.014 0.012 0.010 |
|||
w14 0.007 0.007 0.012 |
|||
w15 0.010 0.019 0.018 |
|||
w17 0.013 0.010 0.011 |
|||
w19 0.015 0.012 0.009 |
|||
w20 0.012 0.021 0.022 |
|||
w21 0.000 0.000 0.000 |
|||
w24 0.012 0.022 0.018 |
|||
w25 0.019 0.025 0.020 |
|||
w26 0.006 0.015 0.021 |
|||
w27 0.008 0.010 0.015 |
|||
w28 0.011 0.016 0.019 |
|||
w29 0.008 0.020 0.013 |
|||
w30 0.011 0.013 0.015 |
|||
w31 0.011 0.013 0.017 |
|||
w32 0.006 0.000 0.000 |
|||
w33 0.000 0.015 0.014 |
|||
w34 0.008 0.007 0.005 |
|||
w35 0.002 0.006 0.014 |
|||
w36 0.015 0.013 0.005 |
|||
w37 0.017 0.016 0.015 |
|||
w38 0.015 0.009 0.012 |
|||
w39 0.007 0.017 0.022 |
|||
w40 0.009 0.014 0.020 |
|||
w41 0.003 0.014 0.011 |
|||
w42 0.017 0.011 0.012 |
|||
w43 0.009 0.013 0.011 |
|||
w44 0.002 0.012 0.012 |
|||
w45 0.016 0.025 0.028 |
|||
w46 0.038 0.062 0.040 |
|||
w47 0.007 0.010 0.010 |
|||
w48 0.003 0.015 0.016 |
|||
w49 0.005 0.016 0.017 |
|||
w50 0.011 0.008 0.007 |
|||
w51 0.010 0.022 0.021 |
|||
w53 0.004 0.026 0.020 |
|||
w54 0.020 0.017 0.025 |
|||
w55 0.004 0.019 0.028 |
|||
w56 0.004 0.010 0.008 |
|||
w57 0.014 0.020 0.018 |
|||
w59 0.012 0.006 0.007 |
|||
w60 0.019 0.010 0.009 |
|||
w61 0.028 0.010 0.012 |
|||
w62 0.000 0.000 0.000 |
|||
w63 0.070 0.027 0.037 |
|||
w64 0.009 0.004 0.005 |
|||
w65 0.022 0.015 0.016 |
|||
w66 0.046 0.017 0.020 |
|||
w68 0.005 0.012 0.016 |
|||
w69 0.085 0.036 0.039 |
|||
w71 0.011 0.013 0.010 |
|||
w72 0.089 0.031 0.034 |
|||
w75 0.026 0.012 0.010 |
|||
w77 0.001 0.004 0.002 |
|||
w78 0.002 0.004 0.002 |
|||
w79 0.001 0.004 0.002 |
|||
w80 0.001 0.001 0.002 |
|||
w81 0.001 0.003 0.002 |
|||
w83 0.009 0.010 0.008 |
|||
w84 0.001 0.002 0.002 |
|||
w85 0.001 0.004 0.005 |
|||
w86 0.001 0.002 0.002 |
|||
w87 0.002 0.003 0.000 |
|||
w89 0.001 0.001 0.002 |
|||
w90 0.006 0.017 0.013 |
|||
w91 0.002 0.010 0.013 |
|||
w92 0.000 0.003 0.002 |
|||
w93 0.002 0.006 0.007 |
|||
w95 0.001 0.007 0.007 |
|||
w96 0.000 0.000 0.000 |
|||
w98 0.006 0.005 0.002 ; |
|||
|
|||
end; |
@ -0,0 +1,519 @@ |
|||
# EGYPT, a static model of fertilizer production |
|||
# |
|||
# References: |
|||
# Robert Fourer, David M. Gay and Brian W. Kernighan, "A Modeling Language |
|||
# for Mathematical Programming." Management Science 36 (1990) 519-554. |
|||
|
|||
### SETS ### |
|||
|
|||
set center; # Locations from which final product may be shipped |
|||
set port within center; # Locations at which imports can be received |
|||
set plant within center; # Locations of plants |
|||
|
|||
set region; # Demand regions |
|||
|
|||
set unit; # Productive units |
|||
set proc; # Processes |
|||
|
|||
set nutr; # Nutrients |
|||
|
|||
set c_final; # Final products (fertilizers) |
|||
set c_inter; # Intermediate products |
|||
set c_ship within c_inter; # Intermediates for shipment |
|||
set c_raw; # Domestic raw materials and miscellaneous inputs |
|||
|
|||
set commod := c_final union c_inter union c_raw; |
|||
|
|||
# All commodities |
|||
|
|||
### PARAMETERS ### |
|||
|
|||
param cf75 {region,c_final} >= 0; |
|||
|
|||
# Consumption of fertilizer 1974-75 (1000 tpy) |
|||
|
|||
param fn {c_final,nutr} >= 0; |
|||
|
|||
# Nutrient content of fertilizers |
|||
|
|||
param cn75 {r in region, n in nutr} := sum {c in c_final} cf75[r,c] * fn[c,n]; |
|||
|
|||
# Consumption of nutrients 1974-75 (1000 tpy) |
|||
|
|||
param road {region,center} >= 0; |
|||
|
|||
# Road distances |
|||
|
|||
param rail_half {plant,plant} >= 0; |
|||
param rail {p1 in plant, p2 in plant} := |
|||
if rail_half[p1,p2] > 0 then rail_half[p1,p2] else rail_half[p2,p1]; |
|||
|
|||
# Interplant rail distances (kms) |
|||
|
|||
param impd_barg {plant} >= 0; |
|||
param impd_road {plant} >= 0; |
|||
|
|||
# Import distances (kms) by barge and road |
|||
|
|||
param tran_final {pl in plant, r in region} := |
|||
if road[r,pl] > 0 then .5 + .0144 * road[r,pl] else 0; |
|||
|
|||
param tran_import {r in region, po in port} := |
|||
if road[r,po] > 0 then .5 + .0144 * road[r,po] else 0; |
|||
|
|||
param tran_inter {p1 in plant, p2 in plant} := |
|||
if rail[p1,p2] > 0 then 3.5 + .03 * rail[p1,p2] else 0; |
|||
|
|||
param tran_raw {pl in plant} := |
|||
(if impd_barg[pl] > 0 then 1.0 + .0030 * impd_barg[pl] else 0) |
|||
+ (if impd_road[pl] > 0 then 0.5 + .0144 * impd_road[pl] else 0); |
|||
|
|||
# Transport cost (le per ton) for: |
|||
# final products, imported final products, |
|||
# interplant shipment, imported raw materials |
|||
|
|||
param io {commod,proc}; # Input-output coefficients |
|||
|
|||
param util {unit,proc} >= 0; |
|||
|
|||
# Capacity utilization coefficients |
|||
|
|||
param p_imp {commod} >= 0; # Import Price (cif US$ per ton 1975) |
|||
|
|||
param p_r {c_raw} >= 0; |
|||
param p_pr {plant,c_raw} >= 0; |
|||
|
|||
param p_dom {pl in plant, c in c_raw} := |
|||
if p_r[c] > 0 then p_r[c] else p_pr[pl,c]; |
|||
|
|||
# Domestic raw material prices |
|||
|
|||
param dcap {plant,unit} >= 0; |
|||
|
|||
# Design capacity of plants (t/day) |
|||
|
|||
param icap {u in unit, pl in plant} := 0.33 * dcap[pl,u]; |
|||
|
|||
# Initial capacity of plants (t/day) |
|||
|
|||
param exch := 0.4; # Exchange rate |
|||
|
|||
param util_pct := 0.85; # Utilization percent for initial capacity |
|||
|
|||
### DERIVED SETS OF "POSSIBILITIES" ### |
|||
|
|||
set m_pos {pl in plant} := {u in unit: icap[u,pl] > 0}; |
|||
|
|||
# At each plant, set of units for which there is |
|||
# initial capacity |
|||
|
|||
set p_cap {pl in plant} := |
|||
{pr in proc: forall {u in unit: util[u,pr] > 0} u in m_pos[pl] }; |
|||
|
|||
# At each plant, set of processes for which |
|||
# all necessary units have some initial capacity |
|||
|
|||
set p_except {plant} within proc; |
|||
|
|||
# At each plant, list of processes that are |
|||
# arbitrarily ruled out |
|||
|
|||
set p_pos {pl in plant} := p_cap[pl] diff p_except[pl]; |
|||
|
|||
# At each plant, set of possible processes |
|||
|
|||
set cp_pos {c in commod} := {pl in plant: sum {pr in p_pos[pl]} io[c,pr] > 0}; |
|||
|
|||
set cc_pos {c in commod} := {pl in plant: sum {pr in p_pos[pl]} io[c,pr] < 0}; |
|||
|
|||
set c_pos {c in commod} := cp_pos[c] union cc_pos[c]; |
|||
|
|||
# For each commodity, set of plants that can |
|||
# produce it (cp_pos) or consume it (cc_pos), |
|||
# and their union (c_pos) |
|||
|
|||
### VARIABLES ### |
|||
|
|||
var Z {pl in plant, p_pos[pl]} >= 0; |
|||
|
|||
# Z[pl,pr] is level of process pr at plant pl |
|||
|
|||
var Xf {c in c_final, cp_pos[c], region} >= 0; |
|||
|
|||
# Xf[c,pl,r] is amount of final product c |
|||
# shipped from plant pl to region r |
|||
|
|||
var Xi {c in c_ship, cp_pos[c], cc_pos[c]} >= 0; |
|||
|
|||
# Xi[c,p1,p2] is amount of intermediate c |
|||
# shipped from plant p1 to plant p2 |
|||
|
|||
var Vf {c_final,region,port} >= 0; |
|||
|
|||
# Vf[c,r,po] is amount of final product c |
|||
# imported by region r from port po |
|||
|
|||
var Vr {c in c_raw, cc_pos[c]} >= 0; |
|||
|
|||
# Vr[c,pl] is amount of raw material c |
|||
# imported for use at plant pl |
|||
|
|||
var U {c in c_raw, cc_pos[c]} >= 0; |
|||
|
|||
# U[c,pl] is amount of raw material c |
|||
# purchased domestically for use at plant pl |
|||
|
|||
var Psip; # Domestic recurrent cost |
|||
var Psil; # Transport cost |
|||
var Psii; # Import cost |
|||
|
|||
### OBJECTIVE ### |
|||
|
|||
minimize Psi: Psip + Psil + Psii; |
|||
|
|||
### CONSTRAINTS ### |
|||
|
|||
subject to mbd {n in nutr, r in region}: |
|||
|
|||
sum {c in c_final} fn[c,n] * |
|||
(sum {po in port} Vf[c,r,po] + |
|||
sum {pl in cp_pos[c]} Xf[c,pl,r]) >= cn75[r,n]; |
|||
|
|||
# Total nutrients supplied to a region by all |
|||
# final products (sum of imports plus internal |
|||
# shipments from plants) must meet requirements |
|||
|
|||
subject to mbdb {c in c_final, r in region: cf75[r,c] > 0}: |
|||
|
|||
sum {po in port} Vf[c,r,po] + |
|||
sum {pl in cp_pos[c]} Xf[c,pl,r] >= cf75[r,c]; |
|||
|
|||
# Total of each final product supplied to each |
|||
# region (as in previous constraint) must meet |
|||
# requirements |
|||
|
|||
subject to mb {c in commod, pl in plant}: |
|||
|
|||
sum {pr in p_pos[pl]} io[c,pr] * Z[pl,pr] |
|||
|
|||
+ ( if c in c_ship then |
|||
( if pl in cp_pos[c] then sum {p2 in cc_pos[c]} Xi[c,pl,p2] ) |
|||
- ( if pl in cc_pos[c] then sum {p2 in cp_pos[c]} Xi[c,p2,pl] )) |
|||
|
|||
+ ( if (c in c_raw and pl in cc_pos[c]) then |
|||
(( if p_imp[c] > 0 then Vr[c,pl] ) |
|||
+ ( if p_dom[pl,c] > 0 then U[c,pl] ))) |
|||
|
|||
>= if (c in c_final and pl in cp_pos[c]) then sum {r in region} Xf[c,pl,r]; |
|||
|
|||
# For each commodity at each plant: sum of |
|||
# (1) production or consumption at plant, |
|||
# (2) inter-plant shipments in or out, |
|||
# (3) import and domestic purchases (raw only) |
|||
# is >= 0 for raw materials and intermediates; |
|||
# is >= the total shipped for final products |
|||
|
|||
subject to cc {pl in plant, u in m_pos[pl]}: |
|||
|
|||
sum {pr in p_pos[pl]} util[u,pr] * Z[pl,pr] <= util_pct * icap[u,pl]; |
|||
|
|||
# For each productive unit at each plant, |
|||
# total utilization by all processes |
|||
# may not exceed the unit's capacity |
|||
|
|||
subject to ap: |
|||
|
|||
Psip = sum {c in c_raw, pl in cc_pos[c]} p_dom[pl,c] * U[c,pl]; |
|||
|
|||
# Psip is the cost of domestic raw materials, |
|||
# summed over all plants that consume them |
|||
|
|||
subject to al: |
|||
|
|||
Psil = sum {c in c_final} ( |
|||
|
|||
sum {pl in cp_pos[c], r in region} |
|||
tran_final[pl,r] * Xf[c,pl,r] |
|||
|
|||
+ sum {po in port, r in region} tran_import[r,po] * Vf[c,r,po] ) |
|||
|
|||
+ sum {c in c_ship, p1 in cp_pos[c], p2 in cc_pos[c]} |
|||
tran_inter[p1,p2] * Xi[c,p1,p2] |
|||
|
|||
+ sum {c in c_raw, pl in cc_pos[c]: p_imp[c] > 0} |
|||
tran_raw[pl] * Vr[c,pl]; |
|||
|
|||
# Total transport cost is sum of shipping costs for |
|||
# (1) all final products from all plants, |
|||
# (2) all imports of final products, |
|||
# (3) all intermediates shipped between plants, |
|||
# (4) all imports of raw materials |
|||
|
|||
subject to ai: |
|||
|
|||
Psii / exch = sum {c in c_final, r in region, po in port} |
|||
p_imp[c] * Vf[c,r,po] |
|||
|
|||
+ sum {c in c_raw, pl in cc_pos[c]} p_imp[c] * Vr[c,pl]; |
|||
|
|||
# Total import cost -- at exchange rate -- |
|||
# is sum of import costs for final products |
|||
# in each region and raw materials at each plant |
|||
|
|||
### DATA ### |
|||
|
|||
data; |
|||
|
|||
set center := ASWAN HELWAN ASSIOUT KAFR_EL_ZT ABU_ZAABAL ABU_KIR TALKHA SUEZ ; |
|||
|
|||
set port := ABU_KIR ; |
|||
|
|||
set plant := ASWAN HELWAN ASSIOUT KAFR_EL_ZT ABU_ZAABAL ; |
|||
|
|||
set region := ALEXANDRIA BEHERA GHARBIA KAFR_EL_SH DAKAHLIA DAMIETTA |
|||
SHARKIA ISMAILIA SUEZ MENOUFIA KALUBIA GIZA BENI_SUEF FAYOUM |
|||
MINIA ASSIOUT NEW_VALLEY SOHAG QUENA ASWAN ; |
|||
|
|||
set unit := SULF_A_S SULF_A_P NITR_ACID AMM_ELEC AMM_C_GAS C_AMM_NITR |
|||
AMM_SULF SSP ; |
|||
|
|||
set proc := SULF_A_S SULF_A_P NITR_ACID AMM_ELEC AMM_C_GAS CAN_310 CAN_335 |
|||
AMM_SULF SSP_155 ; |
|||
|
|||
set nutr := N P205 ; |
|||
|
|||
set c_final := UREA CAN_260 CAN_310 CAN_335 AMM_SULF DAP SSP_155 C_250_55 |
|||
C_300_100 ; |
|||
|
|||
set c_inter := AMMONIA NITR_ACID SULF_ACID ; |
|||
|
|||
set c_ship := AMMONIA SULF_ACID ; |
|||
|
|||
set c_raw := EL_ASWAN COKE_GAS PHOS_ROCK LIMESTONE EL_SULFUR PYRITES |
|||
ELECTRIC BF_GAS WATER STEAM BAGS ; |
|||
|
|||
set p_except[ASWAN] := CAN_335 ; |
|||
set p_except[HELWAN] := CAN_310 ; |
|||
set p_except[ASSIOUT] := ; |
|||
set p_except[KAFR_EL_ZT] := ; |
|||
set p_except[ABU_ZAABAL] := ; |
|||
|
|||
param cf75 default 0.0 : |
|||
|
|||
CAN_260 CAN_310 CAN_335 AMM_SULF UREA := |
|||
|
|||
ALEXANDRIA . . 5.0 3.0 1.0 |
|||
ASSIOUT 1.0 20.0 26.0 1.0 27.0 |
|||
ASWAN . 40.0 . . . |
|||
BEHERA 1.0 . 25.0 90.0 35.0 |
|||
BENI_SUEF 1.0 . 15.0 1.0 20.0 |
|||
DAKAHLIA 1.0 . 26.0 60.0 20.0 |
|||
DAMIETTA . . 2.0 15.0 8.0 |
|||
FAYOUM 1.0 . 20.0 6.0 20.0 |
|||
GHARBIA . . 17.0 60.0 28.0 |
|||
GIZA . . 40.0 6.0 2.0 |
|||
ISMAILIA . . 4.0 6.0 2.0 |
|||
KAFR_EL_SH 1.0 . 10.0 45.0 22.0 |
|||
KALUBIA . . 25.0 16.0 7.0 |
|||
MENOUFIA 1.0 . 24.0 21.0 30.0 |
|||
MINIA 2.0 15.0 35.0 1.0 41.0 |
|||
NEW_VALLEY . . . . 1.0 |
|||
QUENA . 95.0 2.0 . 3.0 |
|||
SHARKIA 1.0 . 31.0 50.0 28.0 |
|||
SOHAG . 65.0 3.0 . 7.0 |
|||
SUEZ . . 1.0 . . |
|||
|
|||
: SSP_155 C_250_55 C_300_100 DAP := |
|||
|
|||
ALEXANDRIA 8.0 . . . |
|||
ASSIOUT 35.0 5.0 .1 . |
|||
ASWAN 8.0 . . . |
|||
BEHERA 64.0 1.0 .1 .1 |
|||
BENI_SUEF 13.0 3.0 . . |
|||
DAKAHLIA 52.0 1.0 . . |
|||
DAMIETTA 5.0 . . . |
|||
FAYOUM 17.0 1.0 . . |
|||
GHARBIA 57.0 1.0 .2 .1 |
|||
GIZA 14.0 1.0 .1 . |
|||
ISMAILIA 4.0 . . . |
|||
KAFR_EL_SH 25.0 2.0 .1 . |
|||
KALUBIA 22.0 1.0 . .1 |
|||
MENOUFIA 33.0 2.0 .1 .1 |
|||
MINIA 50.0 3.0 .2 .1 |
|||
NEW_VALLEY 1.0 . . . |
|||
QUENA 8.0 . . . |
|||
SHARKIA 43.0 1.0 .1 . |
|||
SOHAG 20.0 1.0 . . |
|||
SUEZ 1.0 . . . ; |
|||
|
|||
param fn default 0.0 : N P205 := |
|||
|
|||
AMM_SULF .206 . |
|||
CAN_260 .26 . |
|||
CAN_310 .31 . |
|||
CAN_335 .335 . |
|||
C_250_55 .25 .055 |
|||
C_300_100 .30 .10 |
|||
DAP .18 .46 |
|||
SSP_155 . .15 |
|||
UREA .46 . ; |
|||
|
|||
param road default 0.0 : |
|||
|
|||
ABU_KIR ABU_ZAABAL ASSIOUT ASWAN HELWAN KAFR_EL_ZT SUEZ TALKHA := |
|||
|
|||
ALEXANDRIA 16 210 607 1135 244 119 362 187 |
|||
ASSIOUT 616 420 . 518 362 504 527 518 |
|||
ASWAN 1134 938 518 . 880 1022 1045 1036 |
|||
BEHERA 76 50 547 1065 184 42 288 120 |
|||
BENI_SUEF 359 163 257 775 105 248 270 261 |
|||
DAKAHLIA 208 138 515 1033 152 58 219 3 |
|||
DAMIETTA 267 216 596 1114 233 131 286 66 |
|||
FAYOUM 341 145 308 826 88 230 252 243 |
|||
GHARBIA 150 65 485 1003 122 20 226 55 |
|||
GIZA 287 48 372 890 .9 133 169 146 |
|||
ISMAILIA 365 142 536 1054 173 241 89 146 |
|||
KAFR_EL_SH 145 105 525 1043 162 20 266 35 |
|||
KALUBIA 190 97 439 957 76 66 180 81 |
|||
MENOUFIA 157 154 472 990 109 33 213 90 |
|||
MINIA 384 288 132 650 230 372 394 386 |
|||
NEW_VALLEY 815 619 199 519 561 703 726 717 |
|||
QUENA 858 662 242 276 604 746 769 760 |
|||
SHARKIA 240 60 473 991 110 78 214 58 |
|||
SOHAG 715 519 99 419 461 603 626 617 |
|||
SUEZ 370 224 541 1059 178 246 . 298 ; |
|||
|
|||
param rail_half default 0 : |
|||
|
|||
KAFR_EL_ZT ABU_ZAABAL HELWAN ASSIOUT := |
|||
|
|||
ABU_ZAABAL 85 . . . |
|||
HELWAN 142 57 . . |
|||
ASSIOUT 504 420 362 . |
|||
ASWAN 1022 938 880 518 ; |
|||
|
|||
param : impd_barg impd_road := |
|||
|
|||
ABU_ZAABAL 210 .1 |
|||
ASSIOUT 583 0 |
|||
ASWAN 1087 10 |
|||
HELWAN 183 0 |
|||
KAFR_EL_ZT 104 6 ; |
|||
|
|||
param io default 0.0 := |
|||
|
|||
[*,AMM_C_GAS] AMMONIA 1.0 |
|||
BF_GAS -609. |
|||
COKE_GAS -2.0 |
|||
ELECTRIC -1960. |
|||
STEAM -4. |
|||
WATER -700. |
|||
|
|||
[*,AMM_ELEC] AMMONIA 1.0 |
|||
EL_ASWAN -12.0 |
|||
|
|||
[*,AMM_SULF] AMMONIA -.26 |
|||
AMM_SULF 1.0 |
|||
BAGS -22. |
|||
ELECTRIC -19. |
|||
SULF_ACID -.76 |
|||
WATER -17. |
|||
|
|||
[*,CAN_310] AMMONIA -.20 |
|||
BAGS -23. |
|||
CAN_310 1.0 |
|||
LIMESTONE -.12 |
|||
NITR_ACID -.71 |
|||
STEAM -.4 |
|||
WATER -49. |
|||
|
|||
[*,CAN_335] AMMONIA -.21 |
|||
BAGS -23. |
|||
CAN_335 1.0 |
|||
LIMESTONE -.04 |
|||
NITR_ACID -.76 |
|||
STEAM -.4 |
|||
WATER -49. |
|||
|
|||
[*,NITR_ACID] AMMONIA -.292 |
|||
ELECTRIC -231. |
|||
NITR_ACID 1.0 |
|||
WATER -.6 |
|||
|
|||
[*,SSP_155] BAGS -22. |
|||
ELECTRIC -14. |
|||
PHOS_ROCK -.62 |
|||
SSP_155 1.0 |
|||
SULF_ACID -.41 |
|||
WATER -6. |
|||
|
|||
[*,SULF_A_P] ELECTRIC -75. |
|||
PYRITES -.826 |
|||
SULF_ACID 1.0 |
|||
WATER -60. |
|||
|
|||
[*,SULF_A_S] ELECTRIC -50. |
|||
EL_SULFUR -.334 |
|||
SULF_ACID 1.0 |
|||
WATER -20. ; |
|||
|
|||
param util default 0 := |
|||
|
|||
[*,*] SULF_A_S SULF_A_S 1 SULF_A_P SULF_A_P 1 |
|||
NITR_ACID NITR_ACID 1 AMM_ELEC AMM_ELEC 1 |
|||
AMM_C_GAS AMM_C_GAS 1 SSP SSP_155 1 |
|||
C_AMM_NITR CAN_310 1 C_AMM_NITR CAN_335 1 |
|||
AMM_SULF AMM_SULF 1 ; |
|||
|
|||
param p_imp default 0.0 := |
|||
|
|||
PYRITES 17.5 AMM_SULF 75. |
|||
EL_SULFUR 55. DAP 175. |
|||
UREA 150. SSP_155 80. |
|||
CAN_260 75. C_250_55 100. |
|||
CAN_310 90. C_300_100 130. |
|||
CAN_335 100. ; |
|||
|
|||
param p_r default 0.0 := |
|||
|
|||
ELECTRIC .007 |
|||
BF_GAS .007 |
|||
WATER .031 |
|||
STEAM 1.25 |
|||
BAGS .28 ; |
|||
|
|||
param p_pr default 0.0 := |
|||
|
|||
[HELWAN,COKE_GAS] 16.0 |
|||
[ASWAN,EL_ASWAN] 1.0 |
|||
|
|||
[*,LIMESTONE] ASWAN 1.2 |
|||
HELWAN 1.2 |
|||
|
|||
[*,PHOS_ROCK] ABU_ZAABAL 4.0 |
|||
ASSIOUT 3.5 |
|||
KAFR_EL_ZT 5.0 ; |
|||
|
|||
param dcap default 0.0 := |
|||
|
|||
[ABU_ZAABAL,*] SSP 600 |
|||
SULF_A_P 227 |
|||
SULF_A_S 242 |
|||
|
|||
[ASSIOUT,*] SSP 600 |
|||
SULF_A_S 250 |
|||
|
|||
[ASWAN,*] AMM_ELEC 450 |
|||
C_AMM_NITR 1100 |
|||
NITR_ACID 800 |
|||
|
|||
[HELWAN,*] AMM_C_GAS 172 |
|||
AMM_SULF 24 |
|||
C_AMM_NITR 364 |
|||
NITR_ACID 282 |
|||
|
|||
[KAFR_EL_ZT,*] SSP 600 |
|||
SULF_A_P 50 |
|||
SULF_A_S 200 ; |
|||
|
|||
end; |
@ -0,0 +1,93 @@ |
|||
/* FCTP, Fixed-Charge Transportation Problem */ |
|||
|
|||
/* Written in GNU MathProg by Andrew Makhorin <mao@gnu.org> */ |
|||
|
|||
/* The Fixed-Charge Transportation Problem (FCTP) is obtained from |
|||
classical transportation problem by imposing a fixed cost on each |
|||
transportation link if there is a positive flow on that link. */ |
|||
|
|||
param m, integer, > 0; |
|||
/* number of sources */ |
|||
|
|||
param n, integer, > 0; |
|||
/* number of customers */ |
|||
|
|||
set I := 1..m; |
|||
/* set of sources */ |
|||
|
|||
set J := 1..n; |
|||
/* set of customers */ |
|||
|
|||
param supply{i in I}, >= 0; |
|||
/* supply at source i */ |
|||
|
|||
param demand{j in J}, >= 0; |
|||
/* demand at customer j */ |
|||
|
|||
param varcost{i in I, j in J}, >= 0; |
|||
/* variable cost (a cost per one unit shipped from i to j) */ |
|||
|
|||
param fixcost{i in I, j in J}, >= 0; |
|||
/* fixed cost (a cost for shipping any amount from i to j) */ |
|||
|
|||
var x{i in I, j in J}, >= 0; |
|||
/* amount shipped from source i to customer j */ |
|||
|
|||
s.t. f{i in I}: sum{j in J} x[i,j] = supply[i]; |
|||
/* observe supply at source i */ |
|||
|
|||
s.t. g{j in J}: sum{i in I} x[i,j] = demand[j]; |
|||
/* satisfy demand at customer j */ |
|||
|
|||
var y{i in I, j in J}, binary; |
|||
/* y[i,j] = 1 means some amount is shipped from i to j */ |
|||
|
|||
s.t. h{i in I, j in J}: x[i,j] <= min(supply[i], demand[j]) * y[i,j]; |
|||
/* if y[i,j] is 0, force x[i,j] to be 0 (may note that supply[i] and |
|||
demand[j] are implicit upper bounds for x[i,j] as follows from the |
|||
constraints f[i] and g[j]) */ |
|||
|
|||
minimize cost: sum{i in I, j in J} varcost[i,j] * x[i,j] + |
|||
sum{i in I, j in J} fixcost[i,j] * y[i,j]; |
|||
/* total transportation costs */ |
|||
|
|||
data; |
|||
|
|||
/* These data correspond to the instance bal8x12 from [Balinski]. */ |
|||
|
|||
/* The optimal solution is 471.55 */ |
|||
|
|||
param m := 8; |
|||
|
|||
param n := 12; |
|||
|
|||
param supply := 1 15.00, 2 20.00, 3 45.00, 4 35.00, |
|||
5 25.00, 6 35.00, 7 10.00, 8 25.00; |
|||
|
|||
param demand := 1 20.00, 2 15.00, 3 20.00, 4 15.00, |
|||
5 5.00, 6 20.00, 7 30.00, 8 10.00, |
|||
9 35.00, 10 25.00, 11 10.00, 12 5.00; |
|||
|
|||
param varcost |
|||
: 1 2 3 4 5 6 7 8 9 10 11 12 := |
|||
1 0.69 0.64 0.71 0.79 1.70 2.83 2.02 5.64 5.94 5.94 5.94 7.68 |
|||
2 1.01 0.75 0.88 0.59 1.50 2.63 2.26 5.64 5.85 5.62 5.85 4.94 |
|||
3 1.05 1.06 1.08 0.64 1.22 2.37 1.66 5.64 5.91 5.62 5.91 4.94 |
|||
4 1.94 1.50 1.56 1.22 1.98 1.98 1.36 6.99 6.99 6.99 6.99 3.68 |
|||
5 1.61 1.40 1.61 1.33 1.68 2.83 1.54 4.26 4.26 4.26 4.26 2.99 |
|||
6 5.29 5.94 6.08 5.29 5.96 6.77 5.08 0.31 0.21 0.17 0.31 1.53 |
|||
7 5.29 5.94 6.08 5.29 5.96 6.77 5.08 0.55 0.35 0.40 0.19 1.53 |
|||
8 5.29 6.08 6.08 5.29 5.96 6.45 5.08 2.43 2.30 2.33 1.81 2.50 ; |
|||
|
|||
param fixcost |
|||
: 1 2 3 4 5 6 7 8 9 10 11 12 := |
|||
1 11.0 16.0 18.0 17.0 10.0 20.0 17.0 13.0 15.0 12.0 14.0 14.0 |
|||
2 14.0 17.0 17.0 13.0 15.0 13.0 16.0 11.0 20.0 11.0 15.0 10.0 |
|||
3 12.0 13.0 20.0 17.0 13.0 15.0 16.0 13.0 12.0 13.0 10.0 18.0 |
|||
4 16.0 19.0 16.0 11.0 15.0 12.0 18.0 12.0 18.0 13.0 13.0 14.0 |
|||
5 19.0 18.0 15.0 16.0 12.0 14.0 20.0 19.0 11.0 17.0 16.0 18.0 |
|||
6 13.0 20.0 20.0 17.0 15.0 12.0 14.0 11.0 12.0 19.0 15.0 16.0 |
|||
7 11.0 12.0 15.0 10.0 17.0 11.0 11.0 16.0 10.0 18.0 17.0 12.0 |
|||
8 17.0 10.0 20.0 12.0 17.0 20.0 16.0 15.0 10.0 12.0 16.0 18.0 ; |
|||
|
|||
end; |
@ -0,0 +1,127 @@ |
|||
/* Food Manufacture 1, section 12.1 in |
|||
* Williams, "Model Building in Mathematical Programming" |
|||
* |
|||
* Sebastian Nowozin <nowozin@gmail.com> |
|||
*/ |
|||
|
|||
set oils; |
|||
set month; |
|||
|
|||
/* Buying prices of the raw oils in the next six month. */ |
|||
param buyingprices{month,oils}; |
|||
|
|||
/* Actual amount bought in each month. */ |
|||
var buys{month,oils} >= 0; |
|||
|
|||
/* Stock for each oil. */ |
|||
var stock{month,oils} >= 0; |
|||
|
|||
/* Price of the produced product */ |
|||
param productprice >= 0; |
|||
param storagecost; |
|||
|
|||
param oilhardness{oils} >= 0; |
|||
|
|||
/* Actual amount of output oil produced in each month */ |
|||
var production{m in month} >= 0; |
|||
var useoil{m in month, o in oils} >= 0; |
|||
|
|||
maximize totalprofit: |
|||
sum{m in month} productprice*production[m] |
|||
- sum{m in month, o in oils} buyingprices[m,o]*buys[m,o] |
|||
- sum{m in month, o in oils} storagecost*stock[m,o]; |
|||
|
|||
/* Constraints */ |
|||
|
|||
/* 1. Starting stock */ |
|||
s.t. startstock{o in oils}: |
|||
stock[1,o] = 500; |
|||
s.t. endstock{o in oils}: |
|||
stock[6,o] + buys[6,o] - useoil[6,o] >= 500; |
|||
|
|||
/* 2. Stock constraints */ |
|||
s.t. stocklimit{m in month, o in oils}: |
|||
stock[m,o] <= 1000; |
|||
|
|||
s.t. production1{m in month, o in oils}: |
|||
useoil[m,o] <= stock[m,o] + buys[m,o]; |
|||
s.t. production2{m1 in month, m2 in month, o in oils : m2 = m1+1}: |
|||
stock[m2,o] = stock[m1,o] + buys[m1,o] - useoil[m1,o]; |
|||
|
|||
s.t. production3a{m in month}: |
|||
sum{o in oils} oilhardness[o]*useoil[m,o] >= 3*production[m]; |
|||
s.t. production3b{m in month}: |
|||
sum{o in oils} oilhardness[o]*useoil[m,o] <= 6*production[m]; |
|||
|
|||
s.t. production4{m in month}: |
|||
production[m] = sum{o in oils} useoil[m,o]; |
|||
|
|||
/* 3. Refining constraints */ |
|||
s.t. refine1{m in month}: |
|||
useoil[m,"VEG1"]+useoil[m,"VEG2"] <= 200; |
|||
s.t. refine2{m in month}: |
|||
useoil[m,"OIL1"]+useoil[m,"OIL2"]+useoil[m,"OIL3"] <= 250; |
|||
|
|||
solve; |
|||
|
|||
for {m in month} { |
|||
printf "Month %d\n", m; |
|||
printf "PRODUCE %4.2f tons, hardness %4.2f\n", production[m], |
|||
(sum{o in oils} oilhardness[o]*useoil[m,o]) / (sum{o in oils} useoil[m,o]); |
|||
|
|||
printf "\tVEG1\tVEG2\tOIL1\tOIL2\tOIL3\n"; |
|||
printf "STOCK"; |
|||
printf "%d", m; |
|||
for {o in oils} { |
|||
printf "\t%4.2f", stock[m,o]; |
|||
} |
|||
printf "\nBUY"; |
|||
for {o in oils} { |
|||
printf "\t%4.2f", buys[m,o]; |
|||
} |
|||
printf "\nUSE"; |
|||
printf "%d", m; |
|||
for {o in oils} { |
|||
printf "\t%4.2f", useoil[m,o]; |
|||
} |
|||
printf "\n"; |
|||
printf "\n"; |
|||
} |
|||
printf "Total profit: %4.2f\n", |
|||
(sum{m in month} productprice*production[m] |
|||
- sum{m in month, o in oils} buyingprices[m,o]*buys[m,o] |
|||
- sum{m in month, o in oils} storagecost*stock[m,o]); |
|||
printf " turnover: %4.2f\n", |
|||
sum{m in month} productprice*production[m]; |
|||
printf " buying costs: %4.2f\n", |
|||
sum{m in month, o in oils} buyingprices[m,o]*buys[m,o]; |
|||
printf " storage costs: %4.2f\n", |
|||
sum{m in month, o in oils} storagecost*stock[m,o]; |
|||
|
|||
|
|||
data; |
|||
|
|||
param : oils : oilhardness := |
|||
VEG1 8.8 |
|||
VEG2 6.1 |
|||
OIL1 2.0 |
|||
OIL2 4.2 |
|||
OIL3 5.0 ; |
|||
|
|||
set month := 1 2 3 4 5 6; |
|||
|
|||
param buyingprices |
|||
|
|||
: VEG1 VEG2 OIL1 OIL2 OIL3 := |
|||
|
|||
1 110 120 130 110 115 |
|||
2 130 130 110 90 115 |
|||
3 110 140 130 100 95 |
|||
4 120 110 120 120 125 |
|||
5 100 120 150 110 105 |
|||
6 90 100 140 80 135 ; |
|||
|
|||
param productprice := 150; |
|||
param storagecost := 5; |
|||
|
|||
end; |
@ -0,0 +1,150 @@ |
|||
/* Food Manufacture 2, section 12.2 in |
|||
* Williams, "Model Building in Mathematical Programming" |
|||
* |
|||
* Sebastian Nowozin <nowozin@gmail.com> |
|||
*/ |
|||
|
|||
set oils; |
|||
set month; |
|||
|
|||
/* Buying prices of the raw oils in the next six month. */ |
|||
param buyingprices{month,oils}; |
|||
|
|||
/* Actual amount bought in each month. */ |
|||
var buys{month,oils} >= 0; |
|||
|
|||
/* Stock for each oil. */ |
|||
var stock{month,oils} >= 0; |
|||
|
|||
/* Price of the produced product */ |
|||
param productprice >= 0; |
|||
param storagecost; |
|||
|
|||
param oilhardness{oils} >= 0; |
|||
param M >= 0; |
|||
|
|||
/* Actual amount of output oil produced in each month */ |
|||
var production{m in month} >= 0; |
|||
var useoil{m in month, o in oils} >= 0, <= M; |
|||
var useoilb{m in month, o in oils}, binary; |
|||
|
|||
maximize totalprofit: |
|||
sum{m in month} productprice*production[m] |
|||
- sum{m in month, o in oils} buyingprices[m,o]*buys[m,o] |
|||
- sum{m in month, o in oils} storagecost*stock[m,o]; |
|||
|
|||
/* Constraints */ |
|||
|
|||
/* 1. Starting stock */ |
|||
s.t. startstock{o in oils}: |
|||
stock[1,o] = 500; |
|||
s.t. endstock{o in oils}: |
|||
stock[6,o] + buys[6,o] - useoil[6,o] >= 500; |
|||
|
|||
/* 2. Stock constraints */ |
|||
s.t. stocklimit{m in month, o in oils}: |
|||
stock[m,o] <= 1000; |
|||
|
|||
s.t. production1{m in month, o in oils}: |
|||
useoil[m,o] <= stock[m,o] + buys[m,o]; |
|||
s.t. production2{m1 in month, m2 in month, o in oils : m2 = m1+1}: |
|||
stock[m2,o] = stock[m1,o] + buys[m1,o] - useoil[m1,o]; |
|||
|
|||
s.t. production3a{m in month}: |
|||
sum{o in oils} oilhardness[o]*useoil[m,o] >= 3*production[m]; |
|||
s.t. production3b{m in month}: |
|||
sum{o in oils} oilhardness[o]*useoil[m,o] <= 6*production[m]; |
|||
|
|||
s.t. production4{m in month}: |
|||
production[m] = sum{o in oils} useoil[m,o]; |
|||
|
|||
/* 3. Refining constraints */ |
|||
s.t. refine1{m in month}: |
|||
useoil[m,"VEG1"]+useoil[m,"VEG2"] <= 200; |
|||
s.t. refine2{m in month}: |
|||
useoil[m,"OIL1"]+useoil[m,"OIL2"]+useoil[m,"OIL3"] <= 250; |
|||
|
|||
/* 4. Additional conditions: |
|||
* i) The food may never be made up of more than three oils every month |
|||
*/ |
|||
s.t. useoilb_calc{m in month, o in oils}: |
|||
M*useoilb[m,o] >= useoil[m,o]; |
|||
s.t. useoilb_limit{m in month}: |
|||
sum{o in oils} useoilb[m,o] <= 3; |
|||
|
|||
/* ii) If an oil is used in a month, at least 20 tons must be used. |
|||
*/ |
|||
s.t. useminimum{m in month, o in oils}: |
|||
20*useoilb[m,o] <= useoil[m,o]; |
|||
|
|||
/* iii) If either of VEG1 or VEG2 is used in a month, OIL2 must also be used |
|||
*/ |
|||
s.t. use_oil2a{m in month}: |
|||
useoilb[m,"VEG1"] <= useoilb[m,"OIL3"]; |
|||
s.t. use_oil2b{m in month}: |
|||
useoilb[m,"VEG2"] <= useoilb[m,"OIL3"]; |
|||
|
|||
solve; |
|||
|
|||
for {m in month} { |
|||
printf "Month %d\n", m; |
|||
printf "PRODUCE %4.2f tons, hardness %4.2f\n", production[m], |
|||
(sum{o in oils} oilhardness[o]*useoil[m,o]) / (sum{o in oils} useoil[m,o]); |
|||
|
|||
printf "\tVEG1\tVEG2\tOIL1\tOIL2\tOIL3\n"; |
|||
printf "STOCK"; |
|||
printf "%d", m; |
|||
for {o in oils} { |
|||
printf "\t%4.2f", stock[m,o]; |
|||
} |
|||
printf "\nBUY"; |
|||
for {o in oils} { |
|||
printf "\t%4.2f", buys[m,o]; |
|||
} |
|||
printf "\nUSE"; |
|||
printf "%d", m; |
|||
for {o in oils} { |
|||
printf "\t%4.2f", useoil[m,o]; |
|||
} |
|||
printf "\n"; |
|||
printf "\n"; |
|||
} |
|||
printf "Total profit: %4.2f\n", |
|||
(sum{m in month} productprice*production[m] |
|||
- sum{m in month, o in oils} buyingprices[m,o]*buys[m,o] |
|||
- sum{m in month, o in oils} storagecost*stock[m,o]); |
|||
printf " turnover: %4.2f\n", |
|||
sum{m in month} productprice*production[m]; |
|||
printf " buying costs: %4.2f\n", |
|||
sum{m in month, o in oils} buyingprices[m,o]*buys[m,o]; |
|||
printf " storage costs: %4.2f\n", |
|||
sum{m in month, o in oils} storagecost*stock[m,o]; |
|||
|
|||
|
|||
data; |
|||
|
|||
param : oils : oilhardness := |
|||
VEG1 8.8 |
|||
VEG2 6.1 |
|||
OIL1 2.0 |
|||
OIL2 4.2 |
|||
OIL3 5.0 ; |
|||
|
|||
set month := 1 2 3 4 5 6; |
|||
|
|||
param buyingprices |
|||
|
|||
: VEG1 VEG2 OIL1 OIL2 OIL3 := |
|||
|
|||
1 110 120 130 110 115 |
|||
2 130 130 110 90 115 |
|||
3 110 140 130 100 95 |
|||
4 120 110 120 120 125 |
|||
5 100 120 150 110 105 |
|||
6 90 100 140 80 135 ; |
|||
|
|||
param productprice := 150; |
|||
param storagecost := 5; |
|||
param M := 1000; |
|||
|
|||
end; |
@ -0,0 +1,164 @@ |
|||
*NAME: FURNACE |
|||
*ROWS: 18 |
|||
*COLUMNS: 18 |
|||
*NONZERO: 90 |
|||
*OPT SOLN: 2141.923551 |
|||
*SOURCE: Linear Programming--Electric-Arc Furnace Steelmaking |
|||
* Data Processing Application. N.Y.: IBM Corp. |
|||
*APPLICATION: Electric-Arc Furnace Steelmaking |
|||
*COMMENTS: fixed MPS format |
|||
* encoded by Andrew Makhorin <mao@gnu.org> |
|||
* |
|||
NAME FURNACE |
|||
ROWS |
|||
N VALUE $ Price per pound (of initial charge materials) |
|||
E CR $ Chromium |
|||
E MN $ Manganese |
|||
E SI $ Silicon |
|||
E C $ Carbon |
|||
E FE $ Iron |
|||
E TOTCHG $ Total elements charged |
|||
E CRSLAG $ Chromium-oxidized-to-slag relationship |
|||
E TOTCRS $ Total modified chromium specification constraint |
|||
E MN/CR $ Total manganese specification constraint |
|||
E FESLAG $ Iron-oxidized-to-slag relationship |
|||
G ENDFE $ Total iron specification constraint |
|||
L CSPEC $ Total carbon specification constraint |
|||
E BASE $ Basicity relationship |
|||
L SISPEC $ Total silicon specification constraint |
|||
G TOTAL $ Total end metal |
|||
L TOTRS4 $ Inventory limitation on 430 grade scrap |
|||
L TOTRCF $ Inventory limitation on low-carbon ferrochrome |
|||
COLUMNS |
|||
* Steel scrap |
|||
STSCP VALUE .02 |
|||
CR 0 |
|||
MN .01 |
|||
SI .002 |
|||
C .006 |
|||
FE .982 |
|||
* 430 grade scrap |
|||
SP430 VALUE .075 |
|||
CR .16 |
|||
MN .01 |
|||
SI .0095 |
|||
C .0012 |
|||
FE .8143 |
|||
TOTRS4 1 |
|||
* High-carbon ferrochrome |
|||
HCFCR VALUE .27 |
|||
CR .556 |
|||
MN 0 |
|||
SI .02 |
|||
C .08 |
|||
FE .334 |
|||
* Low-carbon ferrochrome |
|||
LCFCR VALUE .40 |
|||
CR .65 |
|||
MN 0 |
|||
SI .01 |
|||
C .0009 |
|||
FE .3391 |
|||
TOTRCF 1 |
|||
* Chromium initially charged |
|||
CRIT VALUE 0 |
|||
CR -1 |
|||
TOTCHG 1 |
|||
CRSLAG 1 |
|||
* Manganese initially charged |
|||
MNIT VALUE 0 |
|||
MN -1 |
|||
TOTCHG 1 |
|||
CRSLAG 1 |
|||
MN/CR .98 |
|||
* Silicon initially charged |
|||
SIIT VALUE 0 |
|||
SI -1 |
|||
TOTCHG 1 |
|||
CSPEC -5 |
|||
BASE 2.14 |
|||
TOTAL -1 |
|||
* Carbon initially charged |
|||
CEIT VALUE 0 |
|||
C -1 |
|||
TOTCHG 1 |
|||
TOTAL -1 |
|||
* Iron initially charged |
|||
FEIT VALUE 0 |
|||
FE -1 |
|||
TOTCHG 1 |
|||
ENDFE 1 |
|||
* Total initial charge weight |
|||
TICW VALUE 0 |
|||
TOTCHG -1 |
|||
CRSLAG -.074 |
|||
TOTCRS .074 |
|||
FESLAG .075 |
|||
CSPEC 5 |
|||
TOTAL 1 |
|||
* Modified chromium in the slag |
|||
ISCR VALUE 0 |
|||
CRSLAG -1 |
|||
TOTCRS .95 |
|||
FESLAG -1 |
|||
CSPEC -.25 |
|||
SISPEC -.395 |
|||
TOTAL -.05 |
|||
* Chrome silicide additive at refining stage |
|||
CRSI VALUE .27 |
|||
TOTCRS .39 |
|||
ENDFE .18 |
|||
BASE 2.7606 |
|||
SISPEC .43 |
|||
TOTAL .57 |
|||
* 430 grade scrap at refining stage |
|||
RS430 VALUE .075 |
|||
TOTCRS .17 |
|||
MN/CR .01 |
|||
ENDFE .8143 |
|||
CSPEC 12 |
|||
SISPEC .0095 |
|||
TOTAL 1 |
|||
TOTRS4 1 |
|||
* Low-carbon ferrochrome at refining stage |
|||
RCFCR VALUE .40 |
|||
TOTCRS .65 |
|||
ENDFE .3391 |
|||
CSPEC 9 |
|||
SISPEC .01 |
|||
TOTAL 1 |
|||
TOTRCF 1 |
|||
* Iron in the slag |
|||
ISFE VALUE 0 |
|||
FESLAG -1 |
|||
ENDFE -.05 |
|||
CSPEC -.25 |
|||
SISPEC -.238 |
|||
TOTAL -.05 |
|||
* Lime at refining stage |
|||
LIME VALUE .01 |
|||
BASE -2 |
|||
* Low-carbon ferrochrome at finishing stage |
|||
FCFCR VALUE .40 |
|||
TOTCRS .65 |
|||
ENDFE .3391 |
|||
CSPEC 9 |
|||
SISPEC .01 |
|||
TOTAL 1 |
|||
TOTRCF 1 |
|||
* Slack in the chromium and manganese specifications |
|||
SIS VALUE 0 |
|||
TOTCRS 1 |
|||
MN/CR 1 |
|||
RHS |
|||
TOTCRS 3400 |
|||
MN/CR 200 |
|||
ENDFE 16200 |
|||
CSPEC 100000 |
|||
SISPEC 200 |
|||
TOTAL 20000 |
|||
TOTRS4 2000 |
|||
TOTRCF 2000 |
|||
BOUNDS |
|||
UP HCFCR 2000 |
|||
ENDATA |
@ -0,0 +1,79 @@ |
|||
/* GAP, Generalized Assignment Problem */ |
|||
|
|||
/* Written in GNU MathProg by Andrew Makhorin <mao@gnu.org> */ |
|||
|
|||
/* The Generalized Assignment Problem (GAP) is to assign a set of jobs |
|||
to a set of agents subject to the constraints that each job must be |
|||
assigned exactly to one agent and the total resources consumed by all |
|||
jobs assigned to an agent must not exceed the agent's capacity. */ |
|||
|
|||
param m, integer, > 0; |
|||
/* number of agents */ |
|||
|
|||
param n, integer, > 0; |
|||
/* number of jobs */ |
|||
|
|||
set I := 1..m; |
|||
/* set of agents */ |
|||
|
|||
set J := 1..n; |
|||
/* set of jobs */ |
|||
|
|||
param a{i in I, j in J}, >= 0; |
|||
/* resource consumed in allocating job j to agent i */ |
|||
|
|||
param b{i in I}, >= 0; |
|||
/* resource capacity of agent i */ |
|||
|
|||
param c{i in I, j in J}, >= 0; |
|||
/* cost of allocating job j to agent i */ |
|||
|
|||
var x{i in I, j in J}, binary; |
|||
/* x[i,j] = 1 means job j is assigned to agent i */ |
|||
|
|||
s.t. one{j in J}: sum{i in I} x[i,j] = 1; |
|||
/* job j must be assigned exactly to one agent */ |
|||
|
|||
s.t. lim{i in I}: sum{j in J} a[i,j] * x[i,j] <= b[i]; |
|||
/* total amount of resources consumed by all jobs assigned to agent i |
|||
must not exceed the agent's capacity */ |
|||
|
|||
minimize obj: sum{i in I, j in J} c[i,j] * x[i,j]; |
|||
/* the objective is to find cheapest assignment (note that gap can also |
|||
be formulated as maximization problem) */ |
|||
|
|||
data; |
|||
|
|||
/* These data correspond to the instance c515-1 (gap1) from: |
|||
|
|||
I.H. Osman, "Heuristics for the Generalised Assignment Problem: |
|||
Simulated Annealing and Tabu Search Approaches", OR Spektrum, Volume |
|||
17, 211-225, 1995 |
|||
|
|||
D. Cattrysse, M. Salomon and L.N. Van Wassenhove, "A set partitioning |
|||
heuristic for the generalized assignment problem", European Journal |
|||
of Operational Research, Volume 72, 167-174, 1994 */ |
|||
|
|||
/* The optimal solution is 261 (minimization) or 336 (maximization) */ |
|||
|
|||
param m := 5; |
|||
|
|||
param n := 15; |
|||
|
|||
param a : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 := |
|||
1 8 15 14 23 8 16 8 25 9 17 25 15 10 8 24 |
|||
2 15 7 23 22 11 11 12 10 17 16 7 16 10 18 22 |
|||
3 21 20 6 22 24 10 24 9 21 14 11 14 11 19 16 |
|||
4 20 11 8 14 9 5 6 19 19 7 6 6 13 9 18 |
|||
5 8 13 13 13 10 20 25 16 16 17 10 10 5 12 23 ; |
|||
|
|||
param b := 1 36, 2 34, 3 38, 4 27, 5 33; |
|||
|
|||
param c : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 := |
|||
1 17 21 22 18 24 15 20 18 19 18 16 22 24 24 16 |
|||
2 23 16 21 16 17 16 19 25 18 21 17 15 25 17 24 |
|||
3 16 20 16 25 24 16 17 19 19 18 20 16 17 21 24 |
|||
4 19 19 22 22 20 16 19 17 21 19 25 23 25 25 25 |
|||
5 18 19 15 15 21 25 16 16 23 15 22 17 19 22 24 ; |
|||
|
|||
end; |
@ -0,0 +1,10 @@ |
|||
/* glpsol.c */ |
|||
|
|||
#include <glpk.h> |
|||
|
|||
int main(int argc, const char *argv[]) |
|||
{ /* stand-alone LP/MIP solver */ |
|||
return glp_main(argc, argv); |
|||
} |
|||
|
|||
/* eof */ |
@ -0,0 +1,98 @@ |
|||
/* graph.mod - graph visualization */ |
|||
|
|||
/* Written in GNU MathProg by Andrew Makhorin <mao@gnu.org> */ |
|||
|
|||
/* This model creates a picture in EPS format to visualize a graph. */ |
|||
|
|||
param file, symbolic, default "graph.eps"; |
|||
/* output file to write the picture */ |
|||
|
|||
param R, default 2; |
|||
/* radius to draw vertices, in mm */ |
|||
|
|||
param n, integer, > 0; |
|||
/* number of vertices */ |
|||
|
|||
set V, default 1..n; |
|||
/* set of vertices */ |
|||
|
|||
set E, within V cross V; |
|||
/* set of edges */ |
|||
|
|||
param x{i in V}, default 50 * cos((i - 1) / card(V) * 8 * atan(1)); |
|||
param y{i in V}, default 50 * sin((i - 1) / card(V) * 8 * atan(1)); |
|||
/* x[i] and y[i] are coordinates of node i, in mm */ |
|||
|
|||
param x0 := (min{i in V} x[i]) - R - 3.0; |
|||
param y0 := (min{i in V} y[i]) - R - 3.0; |
|||
param x1 := (max{i in V} x[i]) + R + 3.0; |
|||
param y1 := (max{i in V} y[i]) + R + 3.0; |
|||
|
|||
printf "%%!PS-Adobe-3.0 EPSF-3.0\n" > file; |
|||
printf "%%%%BoundingBox: 0 0 %d %d\n", |
|||
(72 / 25.4) * (x1 - x0), (72 / 25.4) * (y1 - y0) >> file; |
|||
printf "/Helvetica findfont 6 scalefont setfont\n" >> file; |
|||
printf "/mm { 72 mul 25.4 div } def\n" >> file; |
|||
|
|||
for {(i,j) in E} |
|||
{ printf "newpath\n" >> file; |
|||
printf "%g mm %g mm moveto\n", x[i] - x0, y[i] - y0 >> file; |
|||
printf "%g mm %g mm lineto\n", x[j] - x0, y[j] - y0 >> file; |
|||
printf "closepath\n" >> file; |
|||
printf "stroke\n" >> file; |
|||
} |
|||
|
|||
for {i in V} |
|||
{ printf "newpath\n" >> file; |
|||
printf "%g mm %g mm %g mm 0 360 arc\n", |
|||
x[i] - x0, y[i] - y0, R >> file; |
|||
printf "closepath\n" >> file; |
|||
printf "gsave 1 1 1 setrgbcolor fill grestore\n" >> file; |
|||
printf "stroke\n" >> file; |
|||
printf "%g mm %g mm moveto\n", |
|||
x[i] - (if i <= 9 then 1.2 else 1.8) - x0, |
|||
y[i] - 0.8 - y0 >> file; |
|||
printf "( %d ) show\n", i >> file; |
|||
} |
|||
|
|||
printf "showpage\n" >> file; |
|||
printf "%%%%EOF\n" >> file; |
|||
|
|||
data; |
|||
|
|||
param |
|||
: V : x y := |
|||
1 0 40 |
|||
2 38 12 |
|||
3 24 -32 |
|||
4 -24 -32 |
|||
5 -38 12 |
|||
6 -19 26 |
|||
7 19 26 |
|||
8 31 -10 |
|||
9 0 -32 |
|||
10 -31 -10 |
|||
11 -9 12 |
|||
12 9 12 |
|||
13 14 -5 |
|||
14 0 -15 |
|||
15 -14 -5 |
|||
16 0 0 ; |
|||
|
|||
set E := |
|||
(1,*) 6 10 16 12 7 |
|||
(2,*) 7 6 16 13 8 |
|||
(3,*) 8 7 16 14 9 |
|||
(4,*) 9 8 16 15 10 |
|||
(5,*) 10 9 16 11 6 |
|||
(6,*) 14 |
|||
(7,*) 15 |
|||
(8,*) 11 |
|||
(9,*) 12 |
|||
(10,*) 13 |
|||
(11,*) 12 15 |
|||
(12,*) 13 |
|||
(13,*) 14 |
|||
(14,*) 15 ; |
|||
|
|||
end; |
@ -0,0 +1,168 @@ |
|||
/* A solver for the Japanese number-puzzle Hashiwokakero |
|||
* (http://en.wikipedia.org/wiki/Hashiwokakero) |
|||
* |
|||
* Sebastian Nowozin <nowozin@gmail.com>, 13th January 2009 |
|||
*/ |
|||
|
|||
param n := 25; |
|||
set rows := 1..n; |
|||
set cols := 1..n; |
|||
param givens{rows, cols}, integer, >= 0, <= 8, default 0; |
|||
|
|||
/* Set of vertices as (row,col) coordinates */ |
|||
set V := { (i,j) in { rows, cols }: givens[i,j] != 0 }; |
|||
|
|||
/* Set of feasible horizontal edges from (i,j) to (k,l) rightwards */ |
|||
set Eh := { (i,j,k,l) in { V, V }: |
|||
i = k and j < l and # Same row and left to right |
|||
card({ (s,t) in V: s = i and t > j and t < l }) = 0 # No vertex inbetween |
|||
}; |
|||
|
|||
/* Set of feasible vertical edges from (i,j) to (k,l) downwards */ |
|||
set Ev := { (i,j,k,l) in { V, V }: |
|||
j = l and i < k and # Same column and top to bottom |
|||
card({ (s,t) in V: t = j and s > i and s < k }) = 0 # No vertex inbetween |
|||
}; |
|||
|
|||
set E := Eh union Ev; |
|||
|
|||
/* Indicators: use edge once/twice */ |
|||
var xe1{E}, binary; |
|||
var xe2{E}, binary; |
|||
|
|||
/* Constraint: Do not use edge or do use once or do use twice */ |
|||
s.t. edge_sel{(i,j,k,l) in E}: |
|||
xe1[i,j,k,l] + xe2[i,j,k,l] <= 1; |
|||
|
|||
/* Constraint: There must be as many edges used as the node value */ |
|||
s.t. satisfy_vertex_demand{(s,t) in V}: |
|||
sum{(i,j,k,l) in E: (i = s and j = t) or (k = s and l = t)} |
|||
(xe1[i,j,k,l] + 2.0*xe2[i,j,k,l]) = givens[s,t]; |
|||
|
|||
/* Constraint: No crossings */ |
|||
s.t. no_crossing1{(i,j,k,l) in Eh, (s,t,u,v) in Ev: |
|||
s < i and u > i and j < t and l > t}: |
|||
xe1[i,j,k,l] + xe1[s,t,u,v] <= 1; |
|||
s.t. no_crossing2{(i,j,k,l) in Eh, (s,t,u,v) in Ev: |
|||
s < i and u > i and j < t and l > t}: |
|||
xe1[i,j,k,l] + xe2[s,t,u,v] <= 1; |
|||
s.t. no_crossing3{(i,j,k,l) in Eh, (s,t,u,v) in Ev: |
|||
s < i and u > i and j < t and l > t}: |
|||
xe2[i,j,k,l] + xe1[s,t,u,v] <= 1; |
|||
s.t. no_crossing4{(i,j,k,l) in Eh, (s,t,u,v) in Ev: |
|||
s < i and u > i and j < t and l > t}: |
|||
xe2[i,j,k,l] + xe2[s,t,u,v] <= 1; |
|||
|
|||
|
|||
/* Model connectivity by auxiliary network flow problem: |
|||
* One vertex becomes a target node and all other vertices send a unit flow |
|||
* to it. The edge selection variables xe1/xe2 are VUB constraints and |
|||
* therefore xe1/xe2 select the feasible graph for the max-flow problems. |
|||
*/ |
|||
set node_target := { (s,t) in V: |
|||
card({ (i,j) in V: i < s or (i = s and j < t) }) = 0}; |
|||
set node_sources := { (s,t) in V: (s,t) not in node_target }; |
|||
|
|||
var flow_forward{ E }, >= 0; |
|||
var flow_backward{ E }, >= 0; |
|||
s.t. flow_conservation{ (s,t) in node_target, (p,q) in V }: |
|||
/* All incoming flows */ |
|||
- sum{(i,j,k,l) in E: k = p and l = q} flow_forward[i,j,k,l] |
|||
- sum{(i,j,k,l) in E: i = p and j = q} flow_backward[i,j,k,l] |
|||
/* All outgoing flows */ |
|||
+ sum{(i,j,k,l) in E: k = p and l = q} flow_backward[i,j,k,l] |
|||
+ sum{(i,j,k,l) in E: i = p and j = q} flow_forward[i,j,k,l] |
|||
= 0 + (if (p = s and q = t) then card(node_sources) else -1); |
|||
|
|||
/* Variable-Upper-Bound (VUB) constraints: xe1/xe2 bound the flows. |
|||
*/ |
|||
s.t. connectivity_vub1{(i,j,k,l) in E}: |
|||
flow_forward[i,j,k,l] <= card(node_sources)*(xe1[i,j,k,l] + xe2[i,j,k,l]); |
|||
s.t. connectivity_vub2{(i,j,k,l) in E}: |
|||
flow_backward[i,j,k,l] <= card(node_sources)*(xe1[i,j,k,l] + xe2[i,j,k,l]); |
|||
|
|||
/* A feasible solution is enough |
|||
*/ |
|||
minimize cost: 0; |
|||
|
|||
solve; |
|||
|
|||
/* Output solution graphically */ |
|||
printf "\nSolution:\n"; |
|||
for { row in rows } { |
|||
for { col in cols } { |
|||
/* First print this cell information: givens or space */ |
|||
printf{0..0: givens[row,col] != 0} "%d", givens[row,col]; |
|||
printf{0..0: givens[row,col] = 0 and |
|||
card({(i,j,k,l) in Eh: i = row and col >= j and col < l and |
|||
xe1[i,j,k,l] = 1}) = 1} "-"; |
|||
printf{0..0: givens[row,col] = 0 and |
|||
card({(i,j,k,l) in Eh: i = row and col >= j and col < l and |
|||
xe2[i,j,k,l] = 1}) = 1} "="; |
|||
printf{0..0: givens[row,col] = 0 |
|||
and card({(i,j,k,l) in Ev: j = col and row >= i and row < k and |
|||
xe1[i,j,k,l] = 1}) = 1} "|"; |
|||
printf{0..0: givens[row,col] = 0 |
|||
and card({(i,j,k,l) in Ev: j = col and row >= i and row < k and |
|||
xe2[i,j,k,l] = 1}) = 1} '"'; |
|||
printf{0..0: givens[row,col] = 0 |
|||
and card({(i,j,k,l) in Eh: i = row and col >= j and col < l and |
|||
(xe1[i,j,k,l] = 1 or xe2[i,j,k,l] = 1)}) = 0 |
|||
and card({(i,j,k,l) in Ev: j = col and row >= i and row < k and |
|||
(xe1[i,j,k,l] = 1 or xe2[i,j,k,l] = 1)}) = 0} " "; |
|||
|
|||
/* Now print any edges */ |
|||
printf{(i,j,k,l) in Eh: i = row and col >= j and col < l and xe1[i,j,k,l] = 1} "-"; |
|||
printf{(i,j,k,l) in Eh: i = row and col >= j and col < l and xe2[i,j,k,l] = 1} "="; |
|||
|
|||
printf{(i,j,k,l) in Eh: i = row and col >= j and col < l and |
|||
xe1[i,j,k,l] = 0 and xe2[i,j,k,l] = 0} " "; |
|||
printf{0..0: card({(i,j,k,l) in Eh: i = row and col >= j and col < l}) = 0} " "; |
|||
} |
|||
printf "\n"; |
|||
for { col in cols } { |
|||
printf{(i,j,k,l) in Ev: j = col and row >= i and row < k and xe1[i,j,k,l] = 1} "|"; |
|||
printf{(i,j,k,l) in Ev: j = col and row >= i and row < k and xe2[i,j,k,l] = 1} '"'; |
|||
printf{(i,j,k,l) in Ev: j = col and row >= i and row < k and |
|||
xe1[i,j,k,l] = 0 and xe2[i,j,k,l] = 0} " "; |
|||
/* No vertical edges: skip also a field */ |
|||
printf{0..0: card({(i,j,k,l) in Ev: j = col and row >= i and row < k}) = 0} " "; |
|||
printf " "; |
|||
} |
|||
printf "\n"; |
|||
} |
|||
|
|||
data; |
|||
|
|||
/* This is a difficult 25x25 Hashiwokakero. |
|||
*/ |
|||
param givens : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
|||
25 := |
|||
1 2 . 2 . 2 . . 2 . 2 . . 2 . . . . 2 . 2 . 2 . 2 . |
|||
2 . 1 . . . . 2 . . . 4 . . 5 . 2 . . 1 . 2 . 2 . 1 |
|||
3 2 . . 5 . 4 . . 3 . . . . . 1 . . 4 . 5 . 1 . 1 . |
|||
4 . . . . . . . . . . . 1 . 3 . . 1 . . . . . . . . |
|||
5 2 . . 6 . 6 . . 8 . 5 . 2 . . 3 . 5 . 7 . . 2 . . |
|||
6 . 1 . . . . . . . . . 1 . . 2 . . . . . 1 . . . 3 |
|||
7 2 . . . . 5 . . 6 . 4 . . 2 . . . 2 . 5 . 4 . 2 . |
|||
8 . 2 . 2 . . . . . . . . . . . 3 . . 3 . . . 1 . 2 |
|||
9 . . . . . . . . . . 4 . 2 . 2 . . 1 . . . 3 . 1 . |
|||
10 2 . 3 . . 6 . . 2 . . . . . . . . . . 3 . . . . . |
|||
11 . . . . 1 . . 2 . . 5 . . 1 . 4 . 3 . . . . 2 . 4 |
|||
12 . . 2 . . 1 . . . . . . 5 . 4 . . . . 4 . 3 . . . |
|||
13 2 . . . 3 . 1 . . . . . . . . 3 . . 5 . 5 . . 2 . |
|||
14 . . . . . 2 . 5 . . 7 . 5 . 3 . 1 . . 1 . . 1 . 4 |
|||
15 2 . 5 . 3 . . . . 1 . 2 . 1 . . . . 2 . 4 . . 2 . |
|||
16 . . . . . 1 . . . . . . . . . . 2 . . 2 . 1 . . 3 |
|||
17 2 . 6 . 6 . . 2 . . 2 . 2 . 5 . . . . . 2 . . . . |
|||
18 . . . . . 1 . . . 3 . . . . . 1 . . 1 . . 4 . 3 . |
|||
19 . . 4 . 5 . . 2 . . . 2 . . 6 . 6 . . 3 . . . . 3 |
|||
20 2 . . . . . . . . . 2 . . 1 . . . . . . 1 . . 1 . |
|||
21 . . 3 . . 3 . 5 . 5 . . 4 . 6 . 7 . . 4 . 6 . . 4 |
|||
22 2 . . . 3 . 5 . 2 . 1 . . . . . . . . . . . . . . |
|||
23 . . . . . . . . . 1 . . . . . . 3 . 2 . . 5 . . 5 |
|||
24 2 . 3 . 3 . 5 . 4 . 3 . 3 . 4 . . 2 . 2 . . . 1 . |
|||
25 . 1 . 2 . 2 . . . 2 . 2 . . . 2 . . . . 2 . 2 . 2 |
|||
; |
|||
|
|||
end; |
@ -0,0 +1,25 @@ |
|||
/*Arithmetic Mean of a large number of Integers |
|||
- or - solve a very large constraint matrix |
|||
over 1 million rows and columns |
|||
Nigel_Galloway@operamail.com |
|||
March 18th., 2008. |
|||
*/ |
|||
|
|||
param e := 20; |
|||
/* set Sample := {-2**e..2**e-1}; */ |
|||
set Sample := {1..2**e-1}; |
|||
|
|||
var Mean; |
|||
var E{z in Sample}; |
|||
|
|||
/* sum of variances is zero */ |
|||
zumVariance: sum{z in Sample} E[z] = 0; |
|||
|
|||
/* Mean + variance[n] = Sample[n] */ |
|||
variances{z in Sample}: Mean + E[z] = z; |
|||
|
|||
solve; |
|||
|
|||
printf "The arithmetic mean of the integers from 1 to %d is %f\n", 2**e-1, Mean; |
|||
|
|||
end; |
@ -0,0 +1,345 @@ |
|||
*NAME: ICECREAM |
|||
*ROWS: 17 |
|||
*COLUMNS: 27 |
|||
*NONZERO: 264 |
|||
*OPT SOLN: 962.8214691 |
|||
*SOURCE: Linear Programming--Ice Cream Blending |
|||
* Data Processing Application. N.Y.: IBM Corp. |
|||
*APPLICATION: Ice Cream Blending |
|||
*COMMENTS: fixed MPS format |
|||
* encoded by Andrew Makhorin <mao@gnu.org> |
|||
* |
|||
NAME ICECREAM |
|||
ROWS |
|||
N COST $ Minimum cost $ |
|||
G MIN.BF $ Butterfat lbs |
|||
L MAX.BF |
|||
G MIN.MSNF $ Milk solids (nonfat) lbs |
|||
L MAX.MSNF |
|||
G MIN.TMS $ Total milk solids lbs |
|||
L MAX.TMS |
|||
G MIN.SUG $ Sweetness lbs |
|||
L MAX.SUG |
|||
L CSS $ Corn syrup solids lbs |
|||
G MIN.TS $ Total solids lbs |
|||
L MAX.TS |
|||
G MIN.H2O $ Water lbs |
|||
L MAX.H2O |
|||
E STAB $ Stabilizer lbs |
|||
E EMUL $ Emulsifier lbs |
|||
E YIELD $ Amount to be made lbs |
|||
COLUMNS |
|||
* Cream (40%) |
|||
I1 COST 27.9 |
|||
MIN.BF .40 |
|||
MAX.BF .40 |
|||
MIN.MSNF .054 |
|||
MAX.MSNF .054 |
|||
MIN.TMS .454 |
|||
MAX.TMS .454 |
|||
MIN.TS .454 |
|||
MAX.TS .454 |
|||
MIN.H2O .546 |
|||
MAX.H2O .546 |
|||
YIELD 1 |
|||
* Cream (38%) |
|||
I2 COST 26.3 |
|||
MIN.BF .38 |
|||
MAX.BF .38 |
|||
MIN.MSNF .056 |
|||
MAX.MSNF .056 |
|||
MIN.TMS .436 |
|||
MAX.TMS .436 |
|||
MIN.TS .436 |
|||
MAX.TS .436 |
|||
MIN.H2O .564 |
|||
MAX.H2O .564 |
|||
YIELD 1 |
|||
* Milk (3.2%) |
|||
I3 COST 3.2 |
|||
MIN.BF .032 |
|||
MAX.BF .032 |
|||
MIN.MSNF .087 |
|||
MAX.MSNF .087 |
|||
MIN.TMS .119 |
|||
MAX.TMS .119 |
|||
MIN.TS .119 |
|||
MAX.TS .119 |
|||
MIN.H2O .881 |
|||
MAX.H2O .881 |
|||
YIELD 1 |
|||
* Milk (3.4%) |
|||
I4 COST 3.2 |
|||
MIN.BF .034 |
|||
MAX.BF .034 |
|||
MIN.MSNF .087 |
|||
MAX.MSNF .087 |
|||
MIN.TMS .121 |
|||
MAX.TMS .121 |
|||
MIN.TS .121 |
|||
MAX.TS .121 |
|||
MIN.H2O .879 |
|||
MAX.H2O .879 |
|||
YIELD 1 |
|||
* Milk (3.5%) |
|||
I5 COST 3.3 |
|||
MIN.BF .035 |
|||
MAX.BF .035 |
|||
MIN.MSNF .087 |
|||
MAX.MSNF .087 |
|||
MIN.TMS .122 |
|||
MAX.TMS .122 |
|||
MIN.TS .122 |
|||
MAX.TS .122 |
|||
MIN.H2O .879 |
|||
MAX.H2O .879 |
|||
YIELD 1 |
|||
* Milk (3.6%) |
|||
I6 COST 3.3 |
|||
MIN.BF .036 |
|||
MAX.BF .036 |
|||
MIN.MSNF .087 |
|||
MAX.MSNF .087 |
|||
MIN.TMS .123 |
|||
MAX.TMS .123 |
|||
MIN.TS .123 |
|||
MAX.TS .123 |
|||
MIN.H2O .877 |
|||
MAX.H2O .877 |
|||
YIELD 1 |
|||
* Milk (3.7%) |
|||
I7 COST 3.4 |
|||
MIN.BF .037 |
|||
MAX.BF .037 |
|||
MIN.MSNF .087 |
|||
MAX.MSNF .087 |
|||
MIN.TMS .124 |
|||
MAX.TMS .124 |
|||
MIN.TS .124 |
|||
MAX.TS .124 |
|||
MIN.H2O .876 |
|||
MAX.H2O .876 |
|||
YIELD 1 |
|||
* Milk (3.8%) |
|||
I8 COST 3.5 |
|||
MIN.BF .038 |
|||
MAX.BF .038 |
|||
MIN.MSNF .087 |
|||
MAX.MSNF .087 |
|||
MIN.TMS .125 |
|||
MAX.TMS .125 |
|||
MIN.TS .125 |
|||
MAX.TS .125 |
|||
MIN.H2O .875 |
|||
MAX.H2O .875 |
|||
YIELD 1 |
|||
* Milk (3.9%) |
|||
I9 COST 3.5 |
|||
MIN.BF .039 |
|||
MAX.BF .039 |
|||
MIN.MSNF .086 |
|||
MAX.MSNF .086 |
|||
MIN.TMS .125 |
|||
MAX.TMS .125 |
|||
MIN.TS .125 |
|||
MAX.TS .125 |
|||
MIN.H2O .875 |
|||
MAX.H2O .875 |
|||
YIELD 1 |
|||
* Milk (4.0%) |
|||
I10 COST 3.6 |
|||
MIN.BF .040 |
|||
MAX.BF .040 |
|||
MIN.MSNF .086 |
|||
MAX.MSNF .086 |
|||
MIN.TMS .126 |
|||
MAX.TMS .126 |
|||
MIN.TS .126 |
|||
MAX.TS .126 |
|||
MIN.H2O .874 |
|||
MAX.H2O .874 |
|||
YIELD 1 |
|||
* Milk (4.2%) |
|||
I11 COST 3.7 |
|||
MIN.BF .042 |
|||
MAX.BF .042 |
|||
MIN.MSNF .086 |
|||
MAX.MSNF .086 |
|||
MIN.TMS .128 |
|||
MAX.TMS .128 |
|||
MIN.TS .128 |
|||
MAX.TS .128 |
|||
MIN.H2O .872 |
|||
MAX.H2O .872 |
|||
YIELD 1 |
|||
* Skim Milk |
|||
I12 COST 1.8 |
|||
MIN.MSNF .09 |
|||
MAX.MSNF .09 |
|||
MIN.TMS .09 |
|||
MAX.TMS .09 |
|||
MIN.TS .09 |
|||
MAX.TS .09 |
|||
MIN.H2O .91 |
|||
MAX.H2O .91 |
|||
YIELD 1 |
|||
* Condensed Whole Milk |
|||
I13 COST 7.6 |
|||
MIN.BF .08 |
|||
MAX.BF .08 |
|||
MIN.MSNF .2 |
|||
MAX.MSNF .2 |
|||
MIN.TMS .28 |
|||
MAX.TMS .28 |
|||
MIN.TS .28 |
|||
MAX.TS .28 |
|||
MIN.H2O .72 |
|||
MAX.H2O .72 |
|||
YIELD 1 |
|||
* Condensed Skim Milk (28%) |
|||
I14 COST 3.9 |
|||
MIN.MSNF .28 |
|||
MAX.MSNF .28 |
|||
MIN.TMS .28 |
|||
MAX.TMS .28 |
|||
MIN.TS .28 |
|||
MAX.TS .28 |
|||
MIN.H2O .72 |
|||
MAX.H2O .72 |
|||
YIELD 1 |
|||
* Condensed Skim Milk (30%) |
|||
I15 COST 4.9 |
|||
MIN.MSNF .3 |
|||
MAX.MSNF .3 |
|||
MIN.TMS .3 |
|||
MAX.TMS .3 |
|||
MIN.TS .3 |
|||
MAX.TS .3 |
|||
MIN.H2O .7 |
|||
MAX.H2O .7 |
|||
YIELD 1 |
|||
* Condensed Skim Milk (32%) |
|||
I16 COST 4.5 |
|||
MIN.MSNF .32 |
|||
MAX.MSNF .32 |
|||
MIN.TMS .32 |
|||
MAX.TMS .32 |
|||
MIN.TS .32 |
|||
MAX.TS .32 |
|||
MIN.H2O .68 |
|||
MAX.H2O .68 |
|||
YIELD 1 |
|||
* Dry Skim Milk |
|||
I17 COST 14.8 |
|||
MIN.BF .01 |
|||
MAX.BF .01 |
|||
MIN.MSNF .96 |
|||
MAX.MSNF .96 |
|||
MIN.TMS .97 |
|||
MAX.TMS .97 |
|||
MIN.TS .97 |
|||
MAX.TS .97 |
|||
MIN.H2O .03 |
|||
MAX.H2O .03 |
|||
YIELD 1 |
|||
* Dry Buttermilk |
|||
I18 COST 15.0 |
|||
MIN.BF .05 |
|||
MAX.BF .05 |
|||
MIN.MSNF .92 |
|||
MAX.MSNF .92 |
|||
MIN.TMS .97 |
|||
MAX.TMS .97 |
|||
MIN.TS .97 |
|||
MAX.TS .97 |
|||
MIN.H2O .03 |
|||
MAX.H2O .03 |
|||
YIELD 1 |
|||
* Dry Whey Solids |
|||
I19 COST 10.7 |
|||
MIN.MSNF .95 |
|||
MAX.MSNF .95 |
|||
MIN.TMS .95 |
|||
MAX.TMS .95 |
|||
MIN.TS .95 |
|||
MAX.TS .95 |
|||
MIN.H2O .05 |
|||
MAX.H2O .05 |
|||
YIELD 1 |
|||
* Dry Sucrose |
|||
I20 COST 10.2 |
|||
MIN.SUG 1.0 |
|||
MAX.SUG 1.0 |
|||
MIN.TS 1.0 |
|||
MAX.TS 1.0 |
|||
YIELD 1 |
|||
* Cane Syrup |
|||
I21 COST 9.9 |
|||
MIN.SUG .67 |
|||
MAX.SUG .67 |
|||
MIN.TS .67 |
|||
MAX.TS .67 |
|||
MIN.H2O .33 |
|||
MAX.H2O .33 |
|||
YIELD 1 |
|||
* Corn Sgr. Solids (50% Sweetness) |
|||
I22 COST 7.0 |
|||
MIN.SUG .5 |
|||
MAX.SUG .5 |
|||
CSS 1.0 |
|||
MIN.TS 1.0 |
|||
MAX.TS 1.0 |
|||
YIELD 1 |
|||
* Corn Sgr. Solids (45% Sweetness) |
|||
I23 COST 9.0 |
|||
MIN.SUG .45 |
|||
MAX.SUG .45 |
|||
CSS 1.0 |
|||
MIN.TS 1.0 |
|||
MAX.TS 1.0 |
|||
YIELD 1 |
|||
* Corn Syrup |
|||
I24 COST 6.6 |
|||
MIN.SUG .4 |
|||
MAX.SUG .4 |
|||
CSS .8 |
|||
MIN.TS .8 |
|||
MAX.TS .8 |
|||
MIN.H2O .2 |
|||
MAX.H2O .2 |
|||
YIELD 1 |
|||
* Stabilizer |
|||
I25 COST 55.0 |
|||
STAB 1.0 |
|||
YIELD 1 |
|||
* Emulsifier |
|||
I26 COST 78.0 |
|||
EMUL 1.0 |
|||
YIELD 1 |
|||
* Water |
|||
I27 COST 0 |
|||
MIN.H2O 1.0 |
|||
MAX.H2O 1.0 |
|||
YIELD 1 |
|||
RHS |
|||
MIN.BF 10 |
|||
MAX.BF 16 |
|||
MIN.MSNF 10.5 |
|||
MAX.MSNF 13 |
|||
MIN.TMS 20.5 |
|||
MAX.TMS 25 |
|||
MIN.SUG 11 |
|||
MAX.SUG 17 |
|||
CSS 6 |
|||
MIN.TS 37.5 |
|||
MAX.TS 41.5 |
|||
MIN.H2O 58.5 |
|||
MAX.H2O 62.5 |
|||
STAB .37 |
|||
EMUL .01 |
|||
YIELD 100 |
|||
BOUNDS |
|||
UP I1 10 |
|||
LO I6 40 |
|||
UP I19 4 |
|||
ENDATA |
@ -0,0 +1,17 @@ |
|||
/* iptsamp.c */ |
|||
|
|||
#include <stdio.h> |
|||
#include <stdlib.h> |
|||
#include <glpk.h> |
|||
|
|||
int main(void) |
|||
{ glp_prob *P; |
|||
P = glp_create_prob(); |
|||
glp_read_mps(P, GLP_MPS_DECK, NULL, "25fv47.mps"); |
|||
glp_interior(P, NULL); |
|||
glp_print_ipt(P, "25fv47.txt"); |
|||
glp_delete_prob(P); |
|||
return 0; |
|||
} |
|||
|
|||
/* eof */ |
@ -0,0 +1,114 @@ |
|||
/* JSSP, Job-Shop Scheduling Problem */ |
|||
|
|||
/* Written in GNU MathProg by Andrew Makhorin <mao@gnu.org> */ |
|||
|
|||
/* The Job-Shop Scheduling Problem (JSSP) is to schedule a set of jobs |
|||
on a set of machines, subject to the constraint that each machine can |
|||
handle at most one job at a time and the fact that each job has a |
|||
specified processing order through the machines. The objective is to |
|||
schedule the jobs so as to minimize the maximum of their completion |
|||
times. |
|||
|
|||
Reference: |
|||
D. Applegate and W. Cook, "A Computational Study of the Job-Shop |
|||
Scheduling Problem", ORSA J. On Comput., Vol. 3, No. 2, Spring 1991, |
|||
pp. 149-156. */ |
|||
|
|||
param n, integer, > 0; |
|||
/* number of jobs */ |
|||
|
|||
param m, integer, > 0; |
|||
/* number of machines */ |
|||
|
|||
set J := 1..n; |
|||
/* set of jobs */ |
|||
|
|||
set M := 1..m; |
|||
/* set of machines */ |
|||
|
|||
param sigma{j in J, t in 1..m}, in M; |
|||
/* permutation of the machines, which represents the processing order |
|||
of j through the machines: j must be processed first on sigma[j,1], |
|||
then on sigma[j,2], etc. */ |
|||
|
|||
check{j in J, t1 in 1..m, t2 in 1..m: t1 <> t2}: |
|||
sigma[j,t1] != sigma[j,t2]; |
|||
/* sigma must be permutation */ |
|||
|
|||
param p{j in J, a in M}, >= 0; |
|||
/* processing time of j on a */ |
|||
|
|||
var x{j in J, a in M}, >= 0; |
|||
/* starting time of j on a */ |
|||
|
|||
s.t. ord{j in J, t in 2..m}: |
|||
x[j, sigma[j,t]] >= x[j, sigma[j,t-1]] + p[j, sigma[j,t-1]]; |
|||
/* j can be processed on sigma[j,t] only after it has been completely |
|||
processed on sigma[j,t-1] */ |
|||
|
|||
/* The disjunctive condition that each machine can handle at most one |
|||
job at a time is the following: |
|||
|
|||
x[i,a] >= x[j,a] + p[j,a] or x[j,a] >= x[i,a] + p[i,a] |
|||
|
|||
for all i, j in J, a in M. This condition is modeled through binary |
|||
variables Y as shown below. */ |
|||
|
|||
var Y{i in J, j in J, a in M}, binary; |
|||
/* Y[i,j,a] is 1 if i scheduled before j on machine a, and 0 if j is |
|||
scheduled before i */ |
|||
|
|||
param K := sum{j in J, a in M} p[j,a]; |
|||
/* some large constant */ |
|||
|
|||
display K; |
|||
|
|||
s.t. phi{i in J, j in J, a in M: i <> j}: |
|||
x[i,a] >= x[j,a] + p[j,a] - K * Y[i,j,a]; |
|||
/* x[i,a] >= x[j,a] + p[j,a] iff Y[i,j,a] is 0 */ |
|||
|
|||
s.t. psi{i in J, j in J, a in M: i <> j}: |
|||
x[j,a] >= x[i,a] + p[i,a] - K * (1 - Y[i,j,a]); |
|||
/* x[j,a] >= x[i,a] + p[i,a] iff Y[i,j,a] is 1 */ |
|||
|
|||
var z; |
|||
/* so-called makespan */ |
|||
|
|||
s.t. fin{j in J}: z >= x[j, sigma[j,m]] + p[j, sigma[j,m]]; |
|||
/* which is the maximum of the completion times of all the jobs */ |
|||
|
|||
minimize obj: z; |
|||
/* the objective is to make z as small as possible */ |
|||
|
|||
data; |
|||
|
|||
/* These data correspond to the instance ft06 (mt06) from: |
|||
|
|||
H. Fisher, G.L. Thompson (1963), Probabilistic learning combinations |
|||
of local job-shop scheduling rules, J.F. Muth, G.L. Thompson (eds.), |
|||
Industrial Scheduling, Prentice Hall, Englewood Cliffs, New Jersey, |
|||
225-251 */ |
|||
|
|||
/* The optimal solution is 55 */ |
|||
|
|||
param n := 6; |
|||
|
|||
param m := 6; |
|||
|
|||
param sigma : 1 2 3 4 5 6 := |
|||
1 3 1 2 4 6 5 |
|||
2 2 3 5 6 1 4 |
|||
3 3 4 6 1 2 5 |
|||
4 2 1 3 4 5 6 |
|||
5 3 2 5 6 1 4 |
|||
6 2 4 6 1 5 3 ; |
|||
|
|||
param p : 1 2 3 4 5 6 := |
|||
1 3 6 1 7 6 3 |
|||
2 10 8 5 4 10 10 |
|||
3 9 1 5 4 7 8 |
|||
4 5 5 5 3 8 9 |
|||
5 3 3 9 1 5 4 |
|||
6 10 3 1 3 4 9 ; |
|||
|
|||
end; |
@ -0,0 +1,54 @@ |
|||
/* MAGIC, Magic Square */ |
|||
|
|||
/* Written in GNU MathProg by Andrew Makhorin <mao@gnu.org> */ |
|||
|
|||
/* In recreational mathematics, a magic square of order n is an |
|||
arrangement of n^2 numbers, usually distinct integers, in a square, |
|||
such that n numbers in all rows, all columns, and both diagonals sum |
|||
to the same constant. A normal magic square contains the integers |
|||
from 1 to n^2. |
|||
|
|||
(From Wikipedia, the free encyclopedia.) */ |
|||
|
|||
param n, integer, > 0, default 4; |
|||
/* square order */ |
|||
|
|||
set N := 1..n^2; |
|||
/* integers to be placed */ |
|||
|
|||
var x{i in 1..n, j in 1..n, k in N}, binary; |
|||
/* x[i,j,k] = 1 means that cell (i,j) contains integer k */ |
|||
|
|||
s.t. a{i in 1..n, j in 1..n}: sum{k in N} x[i,j,k] = 1; |
|||
/* each cell must be assigned exactly one integer */ |
|||
|
|||
s.t. b{k in N}: sum{i in 1..n, j in 1..n} x[i,j,k] = 1; |
|||
/* each integer must be assigned exactly to one cell */ |
|||
|
|||
var s; |
|||
/* the magic sum */ |
|||
|
|||
s.t. r{i in 1..n}: sum{j in 1..n, k in N} k * x[i,j,k] = s; |
|||
/* the sum in each row must be the magic sum */ |
|||
|
|||
s.t. c{j in 1..n}: sum{i in 1..n, k in N} k * x[i,j,k] = s; |
|||
/* the sum in each column must be the magic sum */ |
|||
|
|||
s.t. d: sum{i in 1..n, k in N} k * x[i,i,k] = s; |
|||
/* the sum in the diagonal must be the magic sum */ |
|||
|
|||
s.t. e: sum{i in 1..n, k in N} k * x[i,n-i+1,k] = s; |
|||
/* the sum in the co-diagonal must be the magic sum */ |
|||
|
|||
solve; |
|||
|
|||
printf "\n"; |
|||
printf "Magic sum is %d\n", s; |
|||
printf "\n"; |
|||
for{i in 1..n} |
|||
{ printf{j in 1..n} "%3d", sum{k in N} k * x[i,j,k]; |
|||
printf "\n"; |
|||
} |
|||
printf "\n"; |
|||
|
|||
end; |
@ -0,0 +1,85 @@ |
|||
/* MAXCUT, Maximum Cut Problem */ |
|||
|
|||
/* Written in GNU MathProg by Andrew Makhorin <mao@gnu.org> */ |
|||
|
|||
/* The Maximum Cut Problem in a network G = (V, E), where V is a set |
|||
of nodes, E is a set of edges, is to find the partition of V into |
|||
disjoint sets V1 and V2, which maximizes the sum of edge weights |
|||
w(e), where edge e has one endpoint in V1 and other endpoint in V2. |
|||
|
|||
Reference: |
|||
Garey, M.R., and Johnson, D.S. (1979), Computers and Intractability: |
|||
A guide to the theory of NP-completeness [Network design, Cuts and |
|||
Connectivity, Maximum Cut, ND16]. */ |
|||
|
|||
set E, dimen 2; |
|||
/* set of edges */ |
|||
|
|||
param w{(i,j) in E}, >= 0, default 1; |
|||
/* w[i,j] is weight of edge (i,j) */ |
|||
|
|||
set V := (setof{(i,j) in E} i) union (setof{(i,j) in E} j); |
|||
/* set of nodes */ |
|||
|
|||
var x{i in V}, binary; |
|||
/* x[i] = 0 means that node i is in set V1 |
|||
x[i] = 1 means that node i is in set V2 */ |
|||
|
|||
/* We need to include in the objective function only that edges (i,j) |
|||
from E, for which x[i] != x[j]. This can be modeled through binary |
|||
variables s[i,j] as follows: |
|||
|
|||
s[i,j] = x[i] xor x[j] = (x[i] + x[j]) mod 2, (1) |
|||
|
|||
where s[i,j] = 1 iff x[i] != x[j], that leads to the following |
|||
objective function: |
|||
|
|||
z = sum{(i,j) in E} w[i,j] * s[i,j]. (2) |
|||
|
|||
To describe "exclusive or" (1) we could think that s[i,j] is a minor |
|||
bit of the sum x[i] + x[j]. Then introducing binary variables t[i,j], |
|||
which represent a major bit of the sum x[i] + x[j], we can write: |
|||
|
|||
x[i] + x[j] = s[i,j] + 2 * t[i,j]. (3) |
|||
|
|||
An easy check shows that conditions (1) and (3) are equivalent. |
|||
|
|||
Note that condition (3) can be simplified by eliminating variables |
|||
s[i,j]. Indeed, from (3) it follows that: |
|||
|
|||
s[i,j] = x[i] + x[j] - 2 * t[i,j]. (4) |
|||
|
|||
Since the expression in the right-hand side of (4) is integral, this |
|||
condition can be rewritten in the equivalent form: |
|||
|
|||
0 <= x[i] + x[j] - 2 * t[i,j] <= 1. (5) |
|||
|
|||
(One might note that (5) means t[i,j] = x[i] and x[j].) |
|||
|
|||
Substituting s[i,j] from (4) to (2) leads to the following objective |
|||
function: |
|||
|
|||
z = sum{(i,j) in E} w[i,j] * (x[i] + x[j] - 2 * t[i,j]), (6) |
|||
|
|||
which does not include variables s[i,j]. */ |
|||
|
|||
var t{(i,j) in E}, binary; |
|||
/* t[i,j] = x[i] and x[j] = (x[i] + x[j]) div 2 */ |
|||
|
|||
s.t. xor{(i,j) in E}: 0 <= x[i] + x[j] - 2 * t[i,j] <= 1; |
|||
/* see (4) */ |
|||
|
|||
maximize z: sum{(i,j) in E} w[i,j] * (x[i] + x[j] - 2 * t[i,j]); |
|||
/* see (6) */ |
|||
|
|||
data; |
|||
|
|||
/* In this example the network has 15 nodes and 22 edges. */ |
|||
|
|||
/* Optimal solution is 20 */ |
|||
|
|||
set E := |
|||
1 2, 1 5, 2 3, 2 6, 3 4, 3 8, 4 9, 5 6, 5 7, 6 8, 7 8, 7 12, 8 9, |
|||
8 12, 9 10, 9 14, 10 11, 10 14, 11 15, 12 13, 13 14, 14 15; |
|||
|
|||
end; |
@ -0,0 +1,83 @@ |
|||
/* MAXFLOW, Maximum Flow Problem */ |
|||
|
|||
/* Written in GNU MathProg by Andrew Makhorin <mao@gnu.org> */ |
|||
|
|||
/* The Maximum Flow Problem in a network G = (V, E), where V is a set |
|||
of nodes, E within V x V is a set of arcs, is to maximize the flow |
|||
from one given node s (source) to another given node t (sink) subject |
|||
to conservation of flow constraints at each node and flow capacities |
|||
on each arc. */ |
|||
|
|||
param n, integer, >= 2; |
|||
/* number of nodes */ |
|||
|
|||
set V, default {1..n}; |
|||
/* set of nodes */ |
|||
|
|||
set E, within V cross V; |
|||
/* set of arcs */ |
|||
|
|||
param a{(i,j) in E}, > 0; |
|||
/* a[i,j] is capacity of arc (i,j) */ |
|||
|
|||
param s, symbolic, in V, default 1; |
|||
/* source node */ |
|||
|
|||
param t, symbolic, in V, != s, default n; |
|||
/* sink node */ |
|||
|
|||
var x{(i,j) in E}, >= 0, <= a[i,j]; |
|||
/* x[i,j] is elementary flow through arc (i,j) to be found */ |
|||
|
|||
var flow, >= 0; |
|||
/* total flow from s to t */ |
|||
|
|||
s.t. node{i in V}: |
|||
/* node[i] is conservation constraint for node i */ |
|||
|
|||
sum{(j,i) in E} x[j,i] + (if i = s then flow) |
|||
/* summary flow into node i through all ingoing arcs */ |
|||
|
|||
= /* must be equal to */ |
|||
|
|||
sum{(i,j) in E} x[i,j] + (if i = t then flow); |
|||
/* summary flow from node i through all outgoing arcs */ |
|||
|
|||
maximize obj: flow; |
|||
/* objective is to maximize the total flow through the network */ |
|||
|
|||
solve; |
|||
|
|||
printf{1..56} "="; printf "\n"; |
|||
printf "Maximum flow from node %s to node %s is %g\n\n", s, t, flow; |
|||
printf "Starting node Ending node Arc capacity Flow in arc\n"; |
|||
printf "------------- ----------- ------------ -----------\n"; |
|||
printf{(i,j) in E: x[i,j] != 0}: "%13s %11s %12g %11g\n", i, j, |
|||
a[i,j], x[i,j]; |
|||
printf{1..56} "="; printf "\n"; |
|||
|
|||
data; |
|||
|
|||
/* These data correspond to an example from [Christofides]. */ |
|||
|
|||
/* Optimal solution is 29 */ |
|||
|
|||
param n := 9; |
|||
|
|||
param : E : a := |
|||
1 2 14 |
|||
1 4 23 |
|||
2 3 10 |
|||
2 4 9 |
|||
3 5 12 |
|||
3 8 18 |
|||
4 5 26 |
|||
5 2 11 |
|||
5 6 25 |
|||
5 7 4 |
|||
6 7 7 |
|||
6 8 8 |
|||
7 9 15 |
|||
8 9 20; |
|||
|
|||
end; |
Some files were not shown because too many files changed in this diff
Reference in new issue
xxxxxxxxxx