Shlomi Fish avatar Shlomi Fish committed a23b756

Add the lp_solve files.

Comments (0)

Files changed (14)

+                       Version 2.1, February 1999
+ Copyright (C) 1991, 1999 Free Software Foundation, Inc.
+     59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+[This is the first released version of the Lesser GPL.  It also counts
+ as the successor of the GNU Library Public License, version 2, hence
+ the version number 2.1.]
+                            Preamble
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+Licenses are intended to guarantee your freedom to share and change
+free software--to make sure the software is free for all its users.
+  This license, the Lesser General Public License, applies to some
+specially designated software packages--typically libraries--of the
+Free Software Foundation and other authors who decide to use it.  You
+can use it too, but we suggest you first think carefully about whether
+this license or the ordinary General Public License is the better
+strategy to use in any particular case, based on the explanations
+  When we speak of free software, we are referring to freedom of use,
+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 this service if you wish); that you receive source code or can get
+it if you want it; that you can change the software and use pieces of
+it in new free programs; and that you are informed that you can do
+these things.
+  To protect your rights, we need to make restrictions that forbid
+distributors to deny you these rights or to ask you to surrender these
+rights.  These restrictions translate to certain responsibilities for
+you if you distribute copies of the library or if you modify it.
+  For example, if you distribute copies of the library, whether gratis
+or for a fee, you must give the recipients all the rights that we gave
+you.  You must make sure that they, too, receive or can get the source
+code.  If you link other code with the library, you must provide
+complete object files to the recipients, so that they can relink them
+with the library after making changes to the library and recompiling
+it.  And you must show them these terms so they know their rights.
+  We protect your rights with a two-step method: (1) we copyright the
+library, and (2) we offer you this license, which gives you legal
+permission to copy, distribute and/or modify the library.
+  To protect each distributor, we want to make it very clear that
+there is no warranty for the free library.  Also, if the library is
+modified by someone else and passed on, the recipients should know
+that what they have is not the original version, so that the original
+author's reputation will not be affected by problems that might be
+introduced by others.
+  Finally, software patents pose a constant threat to the existence of
+any free program.  We wish to make sure that a company cannot
+effectively restrict the users of a free program by obtaining a
+restrictive license from a patent holder.  Therefore, we insist that
+any patent license obtained for a version of the library must be
+consistent with the full freedom of use specified in this license.
+  Most GNU software, including some libraries, is covered by the
+ordinary GNU General Public License.  This license, the GNU Lesser
+General Public License, applies to certain designated libraries, and
+is quite different from the ordinary General Public License.  We use
+this license for certain libraries in order to permit linking those
+libraries into non-free programs.
+  When a program is linked with a library, whether statically or using
+a shared library, the combination of the two is legally speaking a
+combined work, a derivative of the original library.  The ordinary
+General Public License therefore permits such linking only if the
+entire combination fits its criteria of freedom.  The Lesser General
+Public License permits more lax criteria for linking other code with
+the library.
+  We call this license the "Lesser" General Public License because it
+does Less to protect the user's freedom than the ordinary General
+Public License.  It also provides other free software developers Less
+of an advantage over competing non-free programs.  These disadvantages
+are the reason we use the ordinary General Public License for many
+libraries.  However, the Lesser license provides advantages in certain
+special circumstances.
+  For example, on rare occasions, there may be a special need to
+encourage the widest possible use of a certain library, so that it
+a de-facto standard.  To achieve this, non-free programs must be
+allowed to use the library.  A more frequent case is that a free
+library does the same job as widely used non-free libraries.  In this
+case, there is little to gain by limiting the free library to free
+software only, so we use the Lesser General Public License.
+  In other cases, permission to use a particular library in non-free
+programs enables a greater number of people to use a large body of
+free software.  For example, permission to use the GNU C Library in
+non-free programs enables many more people to use the whole GNU
+operating system, as well as its variant, the GNU/Linux operating
+  Although the Lesser General Public License is Less protective of the
+users' freedom, it does ensure that the user of a program that is
+linked with the Library has the freedom and the wherewithal to run
+that program using a modified version of the Library.
+  The precise terms and conditions for copying, distribution and
+modification follow.  Pay close attention to the difference between a
+"work based on the library" and a "work that uses the library".  The
+former contains code derived from the library, whereas the latter must
+be combined with the library in order to run.
+  0. This License Agreement applies to any software library or other
+program which contains a notice placed by the copyright holder or
+other authorized party saying it may be distributed under the terms of
+this Lesser General Public License (also called "this License").
+Each licensee is addressed as "you".
+  A "library" means a collection of software functions and/or data
+prepared so as to be conveniently linked with application programs
+(which use some of those functions and data) to form executables.
+  The "Library", below, refers to any such software library or work
+which has been distributed under these terms.  A "work based on the
+Library" means either the Library or any derivative work under
+copyright law: that is to say, a work containing the Library or a
+portion of it, either verbatim or with modifications and/or translated
+straightforwardly into another language.  (Hereinafter, translation is
+included without limitation in the term "modification".)
+  "Source code" for a work means the preferred form of the work for
+making modifications to it.  For a library, complete source code means
+all the source code for all modules it contains, plus any associated
+interface definition files, plus the scripts used to control
+and installation of the library.
+  Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope.  The act of
+running a program using the Library is not restricted, and output from
+such a program is covered only if its contents constitute a work based
+on the Library (independent of the use of the Library in a tool for
+writing it).  Whether that is true depends on what the Library does
+and what the program that uses the Library does.
+  1. You may copy and distribute verbatim copies of the Library's
+complete source code as you receive it, in any medium, provided that
+you conspicuously and appropriately publish on each copy an
+appropriate copyright notice and disclaimer of warranty; keep intact
+all the notices that refer to this License and to the absence of any
+warranty; and distribute a copy of this License along with the
+  You may charge a fee for the physical act of transferring a copy,
+and you may at your option offer warranty protection in exchange for a
+  2. You may modify your copy or copies of the Library or any portion
+of it, thus forming a work based on the Library, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+    a) The modified work must itself be a software library.
+    b) You must cause the files modified to carry prominent notices
+    stating that you changed the files and the date of any change.
+    c) You must cause the whole of the work to be licensed at no
+    charge to all third parties under the terms of this License.
+    d) If a facility in the modified Library refers to a function or a
+    table of data to be supplied by an application program that uses
+    the facility, other than as an argument passed when the facility
+    is invoked, then you must make a good faith effort to ensure that,
+    in the event an application does not supply such function or
+    table, the facility still operates, and performs whatever part of
+    its purpose remains meaningful.
+    (For example, a function in a library to compute square roots has
+    a purpose that is entirely well-defined independent of the
+    application.  Therefore, Subsection 2d requires that any
+    application-supplied function or table used by this function must
+    be optional: if the application does not supply it, the square
+    root function must still compute square roots.)
+These requirements apply to the modified work as a whole.  If
+identifiable sections of that work are not derived from the Library,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works.  But when you
+distribute the same sections as part of a whole which is a work based
+on the Library, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Library.
+In addition, mere aggregation of another work not based on the Library
+with the Library (or with a work based on the Library) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+  3. You may opt to apply the terms of the ordinary GNU General Public
+License instead of this License to a given copy of the Library.  To do
+this, you must alter all the notices that refer to this License, so
+that they refer to the ordinary GNU General Public License, version 2,
+instead of to this License.  (If a newer version than version 2 of the
+ordinary GNU General Public License has appeared, then you can specify
+that version instead if you wish.)  Do not make any other change in
+these notices.
+  Once this change is made in a given copy, it is irreversible for
+that copy, so the ordinary GNU General Public License applies to all
+subsequent copies and derivative works made from that copy.
+  This option is useful when you wish to copy part of the code of
+the Library into a program that is not a library.
+  4. You may copy and distribute the Library (or a portion or
+derivative of it, under Section 2) in object code or executable form
+under the terms of Sections 1 and 2 above provided that you accompany
+it with the complete corresponding machine-readable source code, which
+must be distributed under the terms of Sections 1 and 2 above on a
+medium customarily used for software interchange.
+  If distribution of object code is made by offering access to copy
+from a designated place, then offering equivalent access to copy the
+source code from the same place satisfies the requirement to
+distribute the source code, even though third parties are not
+compelled to copy the source along with the object code.
+  5. A program that contains no derivative of any portion of the
+Library, but is designed to work with the Library by being compiled or
+linked with it, is called a "work that uses the Library".  Such a
+work, in isolation, is not a derivative work of the Library, and
+therefore falls outside the scope of this License.
+  However, linking a "work that uses the Library" with the Library
+creates an executable that is a derivative of the Library (because it
+contains portions of the Library), rather than a "work that uses the
+library".  The executable is therefore covered by this License.
+Section 6 states terms for distribution of such executables.
+  When a "work that uses the Library" uses material from a header file
+that is part of the Library, the object code for the work may be a
+derivative work of the Library even though the source code is not.
+Whether this is true is especially significant if the work can be
+linked without the Library, or if the work is itself a library.  The
+threshold for this to be true is not precisely defined by law.
+  If such an object file uses only numerical parameters, data
+structure layouts and accessors, and small macros and small inline
+functions (ten lines or less in length), then the use of the object
+file is unrestricted, regardless of whether it is legally a derivative
+work.  (Executables containing this object code plus portions of the
+Library will still fall under Section 6.)
+  Otherwise, if the work is a derivative of the Library, you may
+distribute the object code for the work under the terms of Section 6.
+Any executables containing that work also fall under Section 6,
+whether or not they are linked directly with the Library itself.
+  6. As an exception to the Sections above, you may also combine or
+link a "work that uses the Library" with the Library to produce a
+work containing portions of the Library, and distribute that work
+under terms of your choice, provided that the terms permit
+modification of the work for the customer's own use and reverse
+engineering for debugging such modifications.
+  You must give prominent notice with each copy of the work that the
+Library is used in it and that the Library and its use are covered by
+this License.  You must supply a copy of this License.  If the work
+during execution displays copyright notices, you must include the
+copyright notice for the Library among them, as well as a reference
+directing the user to the copy of this License.  Also, you must do one
+of these things:
+    a) Accompany the work with the complete corresponding
+    machine-readable source code for the Library including whatever
+    changes were used in the work (which must be distributed under
+    Sections 1 and 2 above); and, if the work is an executable linked
+    with the Library, with the complete machine-readable "work that
+    uses the Library", as object code and/or source code, so that the
+    user can modify the Library and then relink to produce a modified
+    executable containing the modified Library.  (It is understood
+    that the user who changes the contents of definitions files in the
+    Library will not necessarily be able to recompile the application
+    to use the modified definitions.)
+    b) Use a suitable shared library mechanism for linking with the
+    Library.  A suitable mechanism is one that (1) uses at run time a
+    copy of the library already present on the user's computer system,
+    rather than copying library functions into the executable, and (2)
+    will operate properly with a modified version of the library, if
+    the user installs one, as long as the modified version is
+    interface-compatible with the version that the work was made with.
+    c) Accompany the work with a written offer, valid for at
+    least three years, to give the same user the materials
+    specified in Subsection 6a, above, for a charge no more
+    than the cost of performing this distribution.
+    d) If distribution of the work is made by offering access to copy
+    from a designated place, offer equivalent access to copy the above
+    specified materials from the same place.
+    e) Verify that the user has already received a copy of these
+    materials or that you have already sent this user a copy.
+  For an executable, the required form of the "work that uses the
+Library" must include any data and utility programs needed for
+reproducing the executable from it.  However, as a special exception,
+the materials to be distributed need not include anything that is
+normally distributed (in either source or binary form) with the major
+components (compiler, kernel, and so on) of the operating system on
+which the executable runs, unless that component itself accompanies
+the executable.
+  It may happen that this requirement contradicts the license
+restrictions of other proprietary libraries that do not normally
+accompany the operating system.  Such a contradiction means you cannot
+use both them and the Library together in an executable that you
+  7. You may place library facilities that are a work based on the
+Library side-by-side in a single library together with other library
+facilities not covered by this License, and distribute such a combined
+library, provided that the separate distribution of the work based on
+the Library and of the other library facilities is otherwise
+permitted, and provided that you do these two things:
+    a) Accompany the combined library with a copy of the same work
+    based on the Library, uncombined with any other library
+    facilities.  This must be distributed under the terms of the
+    Sections above.
+    b) Give prominent notice with the combined library of the fact
+    that part of it is a work based on the Library, and explaining
+    where to find the accompanying uncombined form of the same work.
+  8. You may not copy, modify, sublicense, link with, or distribute
+the Library except as expressly provided under this License.  Any
+attempt otherwise to copy, modify, sublicense, link with, or
+distribute the Library is void, and will automatically terminate your
+rights under this License.  However, parties who have received copies,
+or rights, from you under this License will not have their licenses
+terminated so long as such parties remain in full compliance.
+  9. You are not required to accept this License, since you have not
+signed it.  However, nothing else grants you permission to modify or
+distribute the Library or its derivative works.  These actions are
+prohibited by law if you do not accept this License.  Therefore, by
+modifying or distributing the Library (or any work based on the
+Library), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Library or works based on it.
+  10. Each time you redistribute the Library (or any work based on the
+Library), the recipient automatically receives a license from the
+original licensor to copy, distribute, link with or modify the Library
+subject to these terms and conditions.  You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties with
+this License.
+  11. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+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
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Library at all.  For example, if a patent
+license would not permit royalty-free redistribution of the Library by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Library.
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply, and the section as a whole is intended to apply in other
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system which is
+implemented by public license practices.  Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+  12. If the distribution and/or use of the Library is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Library under this License
+may add an explicit geographical distribution limitation excluding those
+countries, so that distribution is permitted only in or among
+countries not thus excluded.  In such case, this License incorporates
+the limitation as if written in the body of this License.
+  13. The Free Software Foundation may publish revised and/or new
+versions of the Lesser 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 Library
+specifies a version number of this License which applies to it and
+"any later version", you have the option of following the terms and
+conditions either of that version or of any later version published by
+the Free Software Foundation.  If the Library does not specify a
+license version number, you may choose any version ever published by
+the Free Software Foundation.
+  14. If you wish to incorporate parts of the Library into other free
+programs whose distribution conditions are incompatible with these,
+write to the author to ask for permission.  For software which is
+copyrighted by the Free Software Foundation, write to the Free
+Software Foundation; we sometimes make exceptions for this.  Our
+decision will be guided by the two goals of preserving the free status
+of all derivatives of our free software and of promoting the sharing
+and reuse of software generally.
+                            NO WARRANTY
+                     END OF TERMS AND CONDITIONS
+           How to Apply These Terms to Your New Libraries
+  If you develop a new library, and you want it to be of the greatest
+possible use to the public, we recommend making it free software that
+everyone can redistribute and change.  You can do so by permitting
+redistribution under these terms (or, alternatively, under the terms
+of the ordinary General Public License).
+  To apply these terms, attach the following notices to the library.
+It is safest to attach them to the start of each source file to most
+effectively convey 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 library's name and a brief idea of what it
+    Copyright (C) <year>  <name of author>
+    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 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
+    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., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
+Also add information on how to contact you by electronic and paper
+You should also get your employer (if you work as a programmer) or
+school, if any, to sign a "copyright disclaimer" for the library, if
+necessary.  Here is a sample; alter the names:
+  Yoyodyne, Inc., hereby disclaims all copyright interest in the
+  library `Frob' (a library for tweaking knobs) written by James
+Random Hacker.
+  <signature of Ty Coon>, 1 April 1990
+  Ty Coon, President of Vice
+That's all there is to it!
+What is lp_solve and what is it not?
+The simple answer is, lp_solve is a Mixed Integer Linear Programming (MILP) solver.
+It is a free (see LGPL for the GNU lesser general public license) linear (integer) programming solver
+based on the revised simplex method and the Branch-and-bound method for the integers.
+It contains full source, examples and manuals.
+lp_solve solves pure linear, (mixed) integer/binary, semi-continuous and
+special ordered sets (SOS) models.
+See the reference guide for more information.
+lp_solve 5.5
+Why a jump from version numbers 5.1 to 5.5 ?
+This is done to indicate that this is more than just another update.
+The solver engine was revised and optimised in such a way that performance has improved considerably.
+Numerical stability is also better resulting in more models that can be solved.
+The LUSOL bfp is now also the default. In the past, the etaPFI bfp package was the default,
+but for larger models this leads faster to numerical instabilities and performance problems.
+Overall, the v5.5 code is faster and more robust than v5.1.
+This robustness is for example proven by the fact that many more models can now be solved even without scaling.
+The API hasn't changed very much.
+There are a couple of new routines and one routine has an extra argument.
+Some constants got new values.
+    * Fundamental internal change to the solver engine resulting in better performance and numerical stability.
+      Both the LP solver and the B&B solvers are enhanced.
+    * Optimised MILP branch truncation, with reduced cost fixing.
+    * LUSOL bfp is now the default.
+    * Presolve is improved in functionality and performance.
+    * Better handling of degeneracy, with more options.
+    * Store and read options from a file make it easier to set options.
+    * Partial pricing for the primal simplex now works.
+    * Full support for xli_ZIMPL v2.0.3.
+    * The objective function is no longer stored as part of the constraint matrix.
+    * Dual-long step code is in place, but not fully activated yet.
+    * General code cleanup.
+    * Added OBJSENSE and OBJNAME headers in the free MPS format (See MPS file format).
+    * The MathProg xli driver has now the ability to generate a model.
+    * New API routines
+Start by taking a look at 'Changes compared to version 4', 'Changes from version 5.1 to version 5.5'
+and 'lp_solve usage'
+This gives a good starting point.
+BFP stands for Basis Factorization Package, which is a unique lp_solve feature.  Considerable
+effort has been put in this new feature and we have big expectations for this. BFP is a generic
+interface model and users can develop their own implementations based on the provided templates.
+We are very interested in providing as many different BFPs as possible to the community.
+lp_solve 5.5 has the LUSOL BFP built in as default engine.  In addition two other
+BFPs are included for both Windows and Linux: bfp_etaPFI.dll, bfp_GLPK.dll for Windows and, for Linux.  The bfp_etaPFI includes
+advanced column ordering using the COLAMD library, as well as better pivot management for
+stability.  For complex models, however, the LU factorization approach is much better, and
+lp_solve now includes LUSOL as one of the most stable engines available anywhere.  LUSOL was
+originally developed by Prof. Saunders at Stanford, and it has now been ported to C
+and enhanced by Kjell.
+If you compile BFPs yourself, make sure that under Windows, you use __stdcall convention and
+use 8 byte alignments.  This is needed for the BFPs to work correctly with the general
+distribution of lp_solve and also to make sharing BFPs as uncomplicated as possible.
+See the reference guide for more information.
+XLI stands for eXternal Language Interface, also a unique lp_solve feature. XLI's are stand-alone
+libraries used as add-on to lp_solve to make it possible to read and write lp models in a format
+not natively supported by lp_solve. Examples are CPLEX lp format, LINDO lp format, MathProg format,
+XML format...
+See the reference guide for more information.
+lpsolve API
+Don't forget that the API has changed compared to previous versions of lpsolve and that you just
+can't use the version 5 lpsolve library with your version 4 or older code.  That is also the
+reason why the library is now called lpsolve55.dll/lpsolve55.a.  lpsolve55.dll or lpsolve55.a are
+only needed when you call the lpsolve library via the API interface from your program.
+The lp_solve program is still a stand-alone executable program.
+There are examples interfaces for different language like C, VB, C#, VB.NET, Java,
+Delphi, and there is now also even a COM object to access the lpsolve library.  This means that
+the door is wide-open for using lp_solve in many different situations.  Thus everything that is
+available in version 4 is now also available in version 5 and already much more!
+See the reference guide for more information.
+Conversion between lp modeling formats
+Note that lp2mps and mps2lp don't exist anymore. However this functionality is now implemented
+in lp_solve:
+lp2mps can be simulated as following:
+lp_solve -parse_only -lp infile -wmps outfile
+mps2lp can be simulated as following:
+lp_solve -parse_only -mps infile -wlp outfile
+via the -rxli option, a model can be read via an XLI library and via the -wxli option, a model
+can be written via an XLI library.
+How to build the executables yourself.
+At this time, there are no Makefiles yet. However for the time being, there are batch files/scripts
+to build. For the Microsoft compiler under Windows, use cvc6.bat, for the gnu compiler under Windows,
+use cgcc.bat and for Unix/Linux, use the ccc shell script (sh ccc).
+See the reference guide for more information.
+Under Windows, there is now also a very user friendly lpsolve IDE. Check out LPSolveIDE
+See the reference guide for more information.
+Documentation (reference guide)
+See lp_solve55.chm for a Windows HTML help documentation file.
+The html files are also in lp_solve_5.5_doc.tar.gz. Start with index.htm
+Also see for a on-line documentation
+Change history:
+17/05/05 version
+- Beta release of version 5.5
+??/??/05 version
+- ?
+26/06/05 version
+- ?
+29/06/05 version
+- ?
+16/08/05 version
+- There are no API changes
+- The LUSOL message routine could generate a crash under some cicumstances. Fixed
+- A crash could occur when building the model in add_row_mode. Fixed.
+- write_params didn't write the PRESOLVE and PRESOLVELOOPS correctly. Fixed.
+- write_params didn't write constants with value 0. Fixed.
+- The library did not compile under msdev 2002 (VC 7.0 _MSC_VER 1300). Fixed.
+- There were some problems with printing long long variables which could generate a crash. Fixed.
+- An overflow error could occur because memory was sometimes overwritten. Fixed.
+- Presolve routines are revised. They are again improved and made faster.
+  Also some problems with it are fixed (possible crashes).
+- Solver revised. Again made faster and more stable.
+- get_row/get_column returned FALSE if the row/column is empty. Fixed.
+- get_rowex/get_columnex now returns -1 if and error is detected. This instead of 0.
+  This to know the distinction between an empty row/column and an error.
+- set_bounds had a possible problem when min and max are equal. Fixed.
+- A crash/damage error could occur when rows/columns are added after a solve. Fixed.
+- The my_chsign macro in lp_types.h gave warnings with some compilers. Fixed.
+- The lp_solve program now returns 255 if an unexpected error occurs. Before this was 1
+  But this interferes with the lpsolve library return codes.
+- With the lp_solve program, debug and print modes were not written correctly in a
+  specified parameter file. Fixed.
+- With the lp_solve program, presolveloops was not set correctly. Fixed.
+17/09/05 version
+- In some cases, SOS restrictions were not optimized till optimality. Fixed.
+- Presolve sometimes generated 'Column -xxx out of range during presolve' with a possible crash.
+- Presolve sometimes removed integer and/or semi-cont variables that should not be deleted. Fixed.
+- B&B sometimes didn't find the most optimal solution. Fixed.
+- Internal constant COMP_EQUAL renamed to COMP_PREFERNONE because this could interfere with a define
+  in the standard header files.
+- The lp parser had problems with variables starting with INF and there is a + or - sign just before it.
+  Fixed.
+- Added options -presolvem, -presolvefd, -presolvebnd, -presolved, -presolveslk
+- Updated documentation. put_bb_branchfunc, put_bb_nodefunc, set_epslevel, dualize_lp, set_basisvar
+16/11/05 version
+- set_add_rowmode should not be called after a solve. There is now a test in this routine when this is
+  done and it then returns FALSE.
+- When an empty string ("") as filename is provided to set_outputfile, then output is completely
+  ignored.
+- In some cases, SOS models did not solve to their most optimal solution.
+- There was as problem with get_sensitivity_objex. Calling it (sometimes only after multiple times)
+  resulted in protection errors/core dumps.
+- When a model has no constraints, it did not solve most of the times.
+- column_in_lp didn't work anymore.
+- Large upper bounds could make the model unstable. A change was made to fix this.
+- set_improve could let crash the model.
+- lp_params.c used the non-ANSI function unlink(). Changed to ANSI function remove().
+- Presolve is again revised considerably.
+- SOS handling is improved when there are a lot of SOS constraints.
+- Limited constraint-to-SOS1 presolve to constraints with at least 4 variables.
+- Limited bound tightening presolve loops.
+12/02/06 version
+- When SOS restrictions are added after a previous solve, a crash could occur.
+- Optimized renaming a variable when the new name is equal to the old name.
+- A possible crash could occur when presolve was enabled
+- The constant ANTIDEGEN_DEFAULT is changed. ANTIDEGEN_INFEASIBLE is removed from it.
+  This constant should not be used unless you have some very tight and hard to solve
+  models where the optimal solution numerically straddles infeasibility.
+- There was a possible problem with set_row(ex). It sometimes wrongfully changed the row.
+- When integer variables were scaled, it could happen that because of rounding errors,
+  a loop was created.
+- Sometimes integer models kept on looping in the B&B algorithm.
+- A memory overrun could occur when an initial basis is set. This when variable names
+  are in Rnnn format and constraint names in Cnnn format.
+- Some fixes are made in presolve.
+- On 64-bit systems, compiler warnings were given and some code worked wrong resulting in
+  wrong results.
+- lp_solve.c didn't compile with some compilers because if a very deep nested if statement.
+- The distributed files now have the version number include in the filename.
+  For example
+  This for a possible move to SourceForge in the (near?) future.
+- When illegal bounds are specified in the MPS format (lower bound larger than upper bound)
+  then a warning was given but the illegal bound was just ignored and the model was solved.
+  This resulted in a solution that did not comply to the original model. Now the message is
+  seen as an error and solving is aborted.
+06/09/06 version
+- When presolve is active and columns are removed and there are SOS constraints, then presolve
+  had an error which could result in hanging while solve or maybe wrong solutions.
+- set_row(ex) set wrong values when used after a previous solve and scaling is active.
+- disabled PRESOLVE_REDUCEMIP since it is very rare that this is effective, and also that it adds
+  code complications and delayed presolve effects that are not captured properly.
+- made routine guess_basis available for all languages (now exported by the dll).
+  The routine is now also documented.
+- some bug corrections in guess_basis.
+- Corrected a problem with add_column(ex) when add_rowmode is enabled.
+- write_lp now wraps long lines over multiple lines to make it more readable.
+- A compilation warning/error sometimes occured on is_fixedvar in lp_lusol.c with some compilers.
+- Added options -wxlisol and -wxlisolopt to lp_solve program to write a solution file for those
+  XLIs that support it.
+- Updated CPLEX XLI to support constants in objective.
+- Added documentation on infeasible models, guess_basis, DIMACS models, CPLEX format, Zimpl, GNU Mathprog.
+  Corrected/updated documentation on get_col_name, get_row_name, get_nameindex, write_xli,
+  External Language Interfaces.
+- The mps reader was improved for the rarely cases where the same elements are provided multiple
+  times. These are now added.
+- Revised the java unittest example because it gave some errors that it shouldn't give.
+07/10/06 version
+- set_row(ex) could sometimes set wrong values in the model.
+- Sometimes models with semi-cont variables which are also integer and scaling is active, a solution
+  was returned that is not most optimal or it returns infeasible.
+- write_mps didn't write semi-cont variables with an infinite upper bound.
+- When presolve can solve the model on its own and objective direction is maximize then a wrong sign
+  was shown in the reported price on screen.
+- write_lp writes constraint and bounds in the same way if a constraint is not named. If a constraint
+  only has one variable then it looks like a bound. This can give problems because when a constraint
+  is interpreted as bound and it is negative then the problem definition changes.
+  Therefore a constraint which is not named and having only one variable in it is getting a name to
+  make sure it is interpreted as a constraint.
+- The lp_solve program didn't interprete the PRESOLVED solve return code very well. Fixed.
+- bfp_GLPK and xli_MathProg are now compiled against GLPK 4.11
+- When an integer model is aborted before the most optimal solution is found (timeout or
+  break at first, ...) solve returned OPTIMAL (0) instead of SUBOPTIMAL (1). This is now corrected.
+14/01/07 version
+- If a model has integer variables, but the model is already integer optimal in the simplex fase,
+  then it was reported as suboptimal feasible.
+- get_objective, get_variables, get_ptr_variables, get_constraints, get_ptr_constraints, get_primal_solution
+  reported 'not a valid basis' when presolve is active and the model is entirely solved by presolve.
+- presolve on a model with SOS variables sometimes went wrong.
+- presolve on a model with SOS variables where infeasibility is detected crashed.
+- read_bas could fail when not all constraints had names or had names like default variable names.
+- A crash could occur with set_row(ex) in rowmode.
+- The lp format has been extended with a free section to define free variables.
+- bfp_GLPK and xli_MathProg are now compiled against GLPK 4.13
+- fixed bug in the pseudocost logic that can blow up subsequent pseudocost values in that
+  branch and make them almost random.
+- In some rare cases a memory overrun could occur when constraints are added after a previous solve.
+- Made the copy_lp routine work. Note that information about the optimisation of the original model
+  is not copied (at this time). Only the model is.
+- Fixed a bug in the hashing routines that had only influence in some rare cases in the
+  MATLAB, O-Matrix, Scilab, Octave, Python drivers.
+- coldual sometimes worked on a uninitialised variable value with unpredictable results.
+27/12/07 version
+- Fixed a problem in presolve. Sometimes an array-index-out-of-bounds error occured.
+- Added a makefile for Linux.
+- When adding constraints, in some rare cases a memory overrun could occur resulting in a crash.
+- add_constraintex with count=0 and row=colno=NULL gave a protection error.
+  several XLIs didn't work anymore because of this.
+- set_constr_type sometimes set wrong signs for the coefficient matrix when add_rowmode is on.
+- presolve did an unnecessary extra loop. Also a test is added to stop presolve when very few
+  changes are done.
+- for very large models, a request of much more memory than is reasonable could occur. Fixed.
+- Modified LINDO XLI to read keywords also not at column 1 and to accept an empty objective function.
+  Previously this wat not possible.
+- In some rare cases, numbers very close to their integer values (for example 11276.999999999998)
+  were truncated to their ceiling value (for example 11276) instead of rounded
+  (for example 11277).
+- Solved a problem with presolve with an all-int constraint.
+- Solved a problem with presolve coldominate
+- Added stronger checking of the MPS format.
+  Fields that must be blank are now also tested accordingly so that if data is there that it is
+  not ignored as before.
+- FREE MPS format was not read ok if row/column name were all numbers
+  or a FR, MI, PL, BV bound was defined. Fixed.
+- The lp-format now also supports a bin(ary) section to define binary variables.
+- When an integer model is aborted before the most optimal solution is found
+  via break at first or break at value, solve returned OPTIMAL (0) instead of SUBOPTIMAL (1).
+  This is now corrected. Problem occured in version
+- Fixed a problem with del_constraint. Constraints names were not shifted and reported variable result was incorrect.
+- read_XLI failed with MathProg if datamodel was provided with "" when there is no datamodel.
+  NULL was expected in the past. "" is now also accepted.
+- Added an XLI to read Xpress lp files.
+- Added routines MPS_writefileex, write_lpex.
+- Added options -o0, -o1 to lp_solve command driven program to specify if objective is in basis or not.
+- Added new information in the reference guide:
+   - Linear programming basics
+   - Presolve
+   - Xpress lp files
+04/01/08 version
+- There was an error in the lp-parser resulting is misreading the model in many cases. This was fixed in the existing release and an update of following files is posted:
+    lp_solve_5.5.0.11_exe.tar.gz
+    lp_solve_5.5.0.11_dev.tar.gz
+    lp_solve_5.5.0.11_source.tar.gz
+13/03/08 version
+- When NODE_RCOSTFIXING (bound tightening during B&B) (enabled by default) was enabled some models were not solved
+  to optimality.
+- In following situation a (sub-optimal) solution was returned while no integer
+  solution isn't found yet at this time.
+   - The model contains integers
+   - A break at first is set
+   - A timeout is set
+   - The timeout occurs before a first integer solution is found
+   - When the timeout occurs, the simplex algorithm is in phase 2 and has a feasible (but non-integer) solution, but not optimal yet.
+- If an integer solution is found with the same objective value as the relaxed solution then
+  B&B is stopped. However this resulted in a report of a SUBOPTIMAL solution while this is not true.
+  The found solution is then optimal.
+- On 64-bit Linux systems crashes occured when information is printed via variable argument routines.
+- There was a warning about redefinition of MAXINT32, MAXUINT32, MAXINT64, MAXUINT64 when compiled
+  with MS Visual C 2008.
+- The reference guide now also contains the Java documentation.
+03/08/08 version
+- The code should now completely be reentrant and thread safe.
+  Especially the lp-parser, but also the solver code itself used static variables which made it
+  not reentrant.
+  The lp parser code has changed considerably for this. Also the lex and yacc code had to be made
+  reentrant. This is only tested with GNU flex and bison. Not with lex and yacc.
+  This should be no problem since the corresponding c files are included with the source so people
+  don't have to build these themselves.
+- commonlib.c/h were also under BFP/BFP_LUSOL/LUSOL while a more advanced version is also
+  under the shared directory. The one from LUSOL is removed.
+- If objective coefficients are all integer and the columns are integer or objective coefficients
+  are zero, then B&B can stop when the objective function equals ceil/floor(real objective)
+  which results in a faster solving process. This did not work anymore and is now fixed.
+- The lpsolve IDE is now also on sourceforge (previously it was a link to another site).
+  Also the sources are included.
+02/02/09 version
+- The lp format now allows spaces between the row label and the colon.
+- Added better error handling in the copy_lp API
+- Timeout in a MIP model sometimes resulted in an endless loop
+- Revised isnan call for gnu compilers
+- Removed some extra static variables for better reentrance support.
+- REPORT_Objective now reports large objective values (>1e-5) with better precision
+- On Windows the binaries are again compiled with compiler optimization /O2 for better performance.
+- Compiled and tested on Windows and Linux 64-bit. 64-bit binaries are now provided.
+  Changed project files and compile scripts for 64-bit compilation.
+  Binaries are now located in a subdirectory bin\platform
+- Added PHP driver so that lpsolve can be called from PHP
+- When an MPS file is created, upper bounds were written before lower bounds.
+  Now it is the other way around. First lower bounds and then upper bounds.
+- The MPS reader could not handle negative lower bounds where the lower bound was specified after the upper bound.
+- The MPS write now writes the implicit lower bound of zero if the variable has no lower bound and it is integer.
+  This to make sure that other solvers (like CPLEX) interprete the variable as integer and not binary.
+- The LINDO XLI parser interpreted negative lower and upper bounds as positive
+- Added the option -stat to the lp_solve driver program. It prints statistics of the model like number of
+  rows/columns used and smalled and largest value in objective, RHS and coefficient matrix.
+- Added the option -plp to the lp_solve driver program. It prints the model via the print_lp API function.
+09/09/09 version
+- Improved guess_basis
+- set_row(ex) corrections. Actually completely revised the routine.
+  Sometimes the matrix was corrupted after the call.
+- When in set_add_row mode, all API calls can now be used. For example printing or writing the model,
+  retrieving data from the model and so on are now all possible in that mode.
+  Will help greatly when debugging your models.
+- Sometimes an integer model is reported infeasible while it isn't because the integer solution
+  is much different from the relaxed (real) model. Then API call set_bb_depthlimit can be used
+  to increase the default B&B depth. However its new value was not used for the depth limit of an
+  individual variabled which could result in still infeasible results.
+- modified the demo program not to use the str_ versions of API calls, because they are not
+  performant and not intended to be used in real programs.
+- Added an lpsolve driver to Sysquake.
+- Added an lpsolve driver to FreeMat.
+- Added an lpsolve driver to Euler.
+- Added an Access example.
+- Added documentation to use lpsolve from Sage via the existing Python driver.
+- Changed the second parameter to read_mps, read_MPS, read_freemps and read_freeMPS from verbose to options.
+  These routines now supports via this options parameter the native IBM interpretation of
+  integer variables and allows to negate the objective constant.
+  This is also supported by the lp_solve command line program via the -mps_ibm and -mps_negobjconst options.
+  This is also supported by the IDE in the options tab.
+- Removed read_LPhandle and read_MPShandle from the lprec structure.
+  On their place there is now read_LP and read_MPS.
+  The handle functions are not usable anyway under windows as dll because the FILE structure
+  is searched in the dll space and therefore not working.
+  read_LP and read_MPS work on the file name and always work.
+  Since these handle routines were not documented anyway and the lp structure should not be
+  accessed by applications (except XLI and BFP drivers) this change should not give any (compatibility) problem at all.
+- write_lp/write_LP write just a + or - if the factor to a variable is +1 or -1
+  However when the number was not exactly one, for example 1.0000000000001, then the test
+  on equal to one gave false, but the writing was a 1 because only 12 significant digits are written.
+  The result was that the 1 was written in that case. Not an error, but when lp files are compared,
+  this is enoying. Now this is solved. When a +1 or -1 would be written then alyways only + and -
+  is written and +1 or -1 will never occur again.
+- When a message function is set via put_msgfunc,
+  in message MSG_LPOPTIMAL it was not possible to get the solution. Now it is.
+  Also when messages MSG_MILPFEASIBLE, MSG_MILPBETTER, MSG_MILPEQUAL were catched the
+  returned solution was the one from the previous MIP solution. This is now also fixed.
+  With this fix, the IDE now also shows the relaxed solution (column LP Optimal).
+- Extended the MATLAB, O-Matrix, Scilab, Octave, Python, PHP and of course the new
+  Sysquake, FreeMat and Euler drivers to support string constants. See the reference guide.
+- Compiled and tested lpsolve on MAC OSX 10.4.8 (Intel). Compilation scripts for this platform
+  were added and revised and binaries are provided to download.
+- Revised the c# and lpsolve code to pass arrays back and forth to the dll to make it also work on 64 bit systems.
+- IDE enhancements:
+      - Can talk to the lpsolve55.dll large address aware version so access to 3.4G 32 bit memory.
+      - Can write and read lp_solve parameter files ( type .lpi) via Options, Solver params, so
+        it is easy to save a readable file of parameters for a particular problem class when it is found.
+        The file can then be collected by the -rpar exe param or the read_params() API.
+      - Added Options, Reset to solver defaults to go back to all lp_solve defaults.
+      - Added in Help a link to the online help files.
+      - Resized the help, main and statistics windows for Vista.
+      - Added the Xpress XLI to the setup.
+      - Use the latest dlls, especially lpsolve55.dll, in the setup.
+      - Added the two new MPS options for IBM integer variables and negate objective constant.
+      - Added the option to ignore integer restrictions.
+17/09/09 version
+- objfrom values where not correct if scaling is active.
+  Routine to calculate these values and the objective from-till values is revised
+  and made a bit more performant.
+- write_lp did not write all column data. For objective function and constraints.
+28/10/09 version
+- In some cases with a model with integer variables lp_solve did not find the most optimal solution. Fixed.
+- The reported relative gap for the optimal solution was not always ok.
+- Sensitivity on a zero upper bounded variable was not calculated. Now it is.
+08/03/10 version
+- When there are integer variables in the model then sensitivity is not correct.
+12/08/10 version
+- add_SOS did a wrong test when SOS type is bigger than 2 if this SOS is allowed in lp_solve. Fixed
+- new and improved MIP_stepOF function to find integer solutions.
+- fixes in set_row.
+- replaces code
+   w *= 2*lp->is_lower[i] - 1;
+  by
+   w = my_chsign(!lp->is_lower[i], w);
+  because the old failed on AIX
+  Also changed the definition of my_chsign in lp_types.h in the same way.
+- Added the option -BR in the lp_solve driver program to select branch rule NODE_PSEUDORATIOSELECT
+- lpsolve.pas updated for Delphi 2009.
+- Python driver updated to allow also to provide numpy arrays to the lpsolve driver.
+- xli_MathProg is now compiled against glpk 4.44 meaning that it now supports the MathProg Tables feature
+  as described in
+  csv, ODBC and MySQL are supported on all platforms.
+- Added MSF support. MSF (Microsoft Solver Foundation) is a microsoft .NET library to access solvers via an OO way
+  MSF has a default lpsolve driver, but the one on the sourceforge site is enhanced in functionality and performance.
+  There is also documentation in the lpsolve reference guide.
+We are thrilled to hear from you and your experiences with this new version. The good and the bad.
+Also we would be pleased to hear about your experiences with the different BFPs on your models.
+Please send reactions to:
+Peter Notebaert:
+Kjell Eikland:


+@echo off
+REM This batch file compiles the lp_solve driver program with the Borland C++ 5.5 compiler for Windows
+set src=../shared/commonlib.c ../shared/mmio.c ../shared/myblas.c ../ini.c ../lp_rlp.c ../lp_crash.c ../bfp/bfp_LUSOL/lp_LUSOL.c ../bfp/bfp_LUSOL/LUSOL/lusol.c ../lp_Hash.c ../lp_lib.c ../lp_wlp.c ../lp_matrix.c ../lp_mipbb.c ../lp_MPS.c ../lp_params.c ../lp_presolve.c ../lp_price.c ../lp_pricePSE.c ../lp_report.c ../lp_scale.c ../lp_simplex.c lp_solve.c ../lp_SOS.c ../lp_utils.c ../yacc_read.c ../lp_MDO.c ../colamd/colamd.c
+set c=bcc32 -w-8004 -w-8057
+rem  -DLLONG=__int64
+set PLATFORM=win32
+if not exist bin\%PLATFORM%\*.* md bin\%PLATFORM%
+%c% -I.. -I../bfp -I../bfp/bfp_LUSOL -I../bfp/bfp_LUSOL/LUSOL -I../colamd -I../shared -a8 -DWIN32 -DYY_NEVER_INTERACTIVE=1 -DPARSER_LP -DINVERSE_ACTIVE=INVERSE_LUSOL -DRoleIsExternalInvEngine -ebin\%PLATFORM%\lp_solve.exe %src%
+if exist *.obj del *.obj
+src='../lp_MDO.c ../shared/commonlib.c ../colamd/colamd.c ../shared/mmio.c ../shared/myblas.c ../ini.c ../fortify.c ../lp_rlp.c ../lp_crash.c ../bfp/bfp_LUSOL/lp_LUSOL.c ../bfp/bfp_LUSOL/LUSOL/lusol.c ../lp_Hash.c ../lp_lib.c ../lp_wlp.c ../lp_matrix.c ../lp_mipbb.c ../lp_MPS.c ../lp_params.c ../lp_presolve.c ../lp_price.c ../lp_pricePSE.c ../lp_report.c ../lp_scale.c ../lp_simplex.c lp_solve.c ../lp_SOS.c ../lp_utils.c ../yacc_read.c'
+#determine platform (32/64 bit)
+echo '#include <stdlib.h>'>>/tmp/platform.c
+echo '#include <stdio.h>'>>/tmp/platform.c
+echo 'main(){printf("ux%d", (int) (sizeof(void *)*8));}'>>/tmp/platform.c
+$c /tmp/platform.c -o /tmp/platform
+rm /tmp/platform /tmp/platform.c >/dev/null 2>&1
+mkdir bin bin/$PLATFORM >/dev/null 2>&1
+#check if this system has the isnan function
+echo '#include <stdio.h>'>>/tmp/isnan.c
+echo '#include <stdlib.h>'>>/tmp/isnan.c
+echo '#include <math.h>'>>/tmp/isnan.c
+echo 'main(){isnan(0);}'>>/tmp/isnan.c
+$c /tmp/isnan.c -o /tmp/isnan $math >/dev/null 2>&1
+if [ $? = 0 ]
+then NOISNAN=
+rm /tmp/isnan.c /tmp/isnan >/dev/null 2>&1
+if [ "$PLATFORM" = "SCO_UNIX" ]
+then opts='-O0'
+     def='-dy -K PIC -DLLONG=long'
+     dl=-ldl
+else dl=-ldl
+$c -I.. -I../bfp -I../bfp/bfp_LUSOL -I../bfp/bfp_LUSOL/LUSOL -I../colamd -I../shared $opts $def $NOISNAN -DYY_NEVER_INTERACTIVE -DPARSER_LP -DINVERSE_ACTIVE=INVERSE_LUSOL -DRoleIsExternalInvEngine $src -o bin/$PLATFORM/lp_solve $math $dl
+src='../lp_MDO.c ../shared/commonlib.c ../colamd/colamd.c ../shared/mmio.c ../shared/myblas.c ../ini.c ../fortify.c ../lp_rlp.c ../lp_crash.c ../bfp/bfp_LUSOL/lp_LUSOL.c ../bfp/bfp_LUSOL/LUSOL/lusol.c ../lp_Hash.c ../lp_lib.c ../lp_wlp.c ../lp_matrix.c ../lp_mipbb.c ../lp_MPS.c ../lp_params.c ../lp_presolve.c ../lp_price.c ../lp_pricePSE.c ../lp_report.c ../lp_scale.c ../lp_simplex.c lp_solve.c ../lp_SOS.c ../lp_utils.c ../yacc_read.c'
+#determine platform (32/64 bit)
+echo '#include <stdlib.h>'>>/tmp/platform.c
+echo '#include <stdio.h>'>>/tmp/platform.c
+echo 'main(){printf("osx%d", (int) (sizeof(void *)*8));}'>>/tmp/platform.c
+$c /tmp/platform.c -o /tmp/platform
+rm /tmp/platform /tmp/platform.c >/dev/null 2>&1
+mkdir bin bin/$PLATFORM >/dev/null 2>&1
+#check if this system has the isnan function
+echo '#include <stdio.h>'>>/tmp/isnan.c
+echo '#include <stdlib.h>'>>/tmp/isnan.c
+echo '#include <math.h>'>>/tmp/isnan.c
+echo 'main(){isnan(0);}'>>/tmp/isnan.c
+$c /tmp/isnan.c -o /tmp/isnan $math >/dev/null 2>&1
+if [ $? = 0 ]
+then NOISNAN=
+rm /tmp/isnan.c /tmp/isnan >/dev/null 2>&1
+opts='-idirafter /usr/include/sys -O3 -DINTEGERTIME -Wno-long-double'
+$c -I.. -I../bfp -I../bfp/bfp_LUSOL -I../bfp/bfp_LUSOL/LUSOL -I../colamd -I../shared $opts $def $NOISNAN -DYY_NEVER_INTERACTIVE -DPARSER_LP -DINVERSE_ACTIVE=INVERSE_LUSOL -DRoleIsExternalInvEngine $src -o bin/$PLATFORM/lp_solve $math $dl


+@echo off
+REM This batch file compiles the lp_solve driver program with the GNU gcc compiler under Windows
+set c=gcc
+REM determine platform (win32/win64)
+echo main(){printf("SET PLATFORM=win%%d\n", (int) (sizeof(void *)*8));}>platform.c
+%c% platform.c -o platform.exe
+del platform.c
+platform.exe >platform.bat
+del platform.exe
+call platform.bat
+del platform.bat
+if not exist bin\%PLATFORM%\*.* md bin\%PLATFORM%
+set src=../lp_MDO.c ../shared/commonlib.c ../colamd/colamd.c ../shared/mmio.c ../shared/myblas.c ../lp_rlp.c ../lp_crash.c ../bfp/bfp_LUSOL/lp_LUSOL.c ../bfp/bfp_LUSOL/LUSOL/lusol.c ../lp_Hash.c ../lp_lib.c ../lp_wlp.c ../lp_matrix.c ../lp_mipbb.c ../lp_MPS.c ../lp_presolve.c ../lp_price.c ../lp_pricePSE.c ../lp_report.c ../lp_scale.c ../lp_simplex.c lp_solve.c ../lp_SOS.c ../lp_utils.c ../yacc_read.c ..\ini.c ..\lp_params.c
+%c% -DINLINE=static -Wall -I.. -I../bfp -I../bfp/bfp_LUSOL -I../bfp/bfp_LUSOL/LUSOL -I../colamd -I../shared -O3 -DBFP_CALLMODEL=__stdcall -DYY_NEVER_INTERACTIVE -DPARSER_LP -DINVERSE_ACTIVE=INVERSE_LUSOL -DRoleIsExternalInvEngine %src% -o bin\%PLATFORM%\lp_solve.exe


+@echo off
+REM This batch file compiles the lp_solve driver program with the Microsoft Visual C/C++ compiler under Windows
+set src=../shared/commonlib.c ../shared/mmio.c ../shared/myblas.c ../ini.c ../lp_rlp.c ../lp_crash.c ../bfp/bfp_LUSOL/lp_LUSOL.c ../bfp/bfp_LUSOL/LUSOL/lusol.c ../lp_Hash.c ../lp_lib.c ../lp_wlp.c ../lp_matrix.c ../lp_mipbb.c ../lp_MPS.c ../lp_params.c ../lp_presolve.c ../lp_price.c ../lp_pricePSE.c ../lp_report.c ../lp_scale.c ../lp_simplex.c lp_solve.c ../lp_SOS.c ../lp_utils.c ../yacc_read.c ../lp_MDO.c ../colamd/colamd.c %1
+set c=cl
+REM determine platform (win32/win64)
+echo main(){printf("SET PLATFORM=win%%d\n", (int) (sizeof(void *)*8));}>platform.c
+%c% /nologo platform.c /Feplatform.exe
+del platform.c
+platform.exe >platform.bat
+del platform.exe
+call platform.bat
+del platform.bat
+if "%PLATFORM%" == "win32" goto ok1
+echo This batch file is entended for 32 bit compilation with MS Visual C 6
+echo For newer versions use cvc8*.bat
+goto done
+if not exist bin\%PLATFORM%\*.* md bin\%PLATFORM%
+%c% -I.. -I../bfp -I../bfp/bfp_LUSOL -I../bfp/bfp_LUSOL/LUSOL -I../colamd -I../shared /O2 /Zp8 /Gd -D"LP_MAXLINELEN=0" -DNoParanoia -DWIN32 -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -DYY_NEVER_INTERACTIVE -DPARSER_LP -DINVERSE_ACTIVE=INVERSE_LUSOL -DRoleIsExternalInvEngine -Febin\%PLATFORM%\lp_solve.exe %src%
+if exist *.obj del *.obj


+call cvc6 -DParanoia %1


+@echo off
+REM This batch file compiles the lp_solve driver program with the Microsoft Visual C/C++ compiler under Windows
+set c=cl
+REM determine platform (win32/win64)
+echo main(){printf("SET PLATFORM=win%%d\n", (int) (sizeof(void *)*8));}>platform.c
+%c% /nologo platform.c /Feplatform.exe
+del platform.c
+platform.exe >platform.bat
+del platform.exe
+call platform.bat
+del platform.bat
+if not exist bin\%PLATFORM%\*.* md bin\%PLATFORM%
+set src=../shared/commonlib.c ../shared/mmio.c ../shared/myblas.c ../ini.c ../lp_rlp.c ../lp_crash.c ../bfp/bfp_LUSOL/lp_LUSOL.c ../bfp/bfp_LUSOL/LUSOL/lusol.c ../lp_Hash.c ../lp_lib.c ../lp_wlp.c ../lp_matrix.c ../lp_mipbb.c ../lp_MPS.c ../lp_params.c ../lp_presolve.c ../lp_price.c ../lp_pricePSE.c ../lp_report.c ../lp_scale.c ../lp_simplex.c lp_solve.c ../lp_SOS.c ../lp_utils.c ../yacc_read.c ../lp_MDO.c ../colamd/colamd.c %1
+%c% -I.. -I../bfp -I../bfp/bfp_LUSOL -I../bfp/bfp_LUSOL/LUSOL -I../colamd -I../shared /O1 /Zp8 /Gd -D"LP_MAXLINELEN=0" -DNoParanoia -DWIN32 -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -DYY_NEVER_INTERACTIVE -DPARSER_LP -DINVERSE_ACTIVE=INVERSE_LUSOL -DRoleIsExternalInvEngine -Febin\%PLATFORM%\lp_solve.exe %src%
+editbin /LARGEADDRESSAWARE bin\%PLATFORM%\lp_solve.exe
+if exist *.obj del *.obj


+#include <string.h>
+#include <time.h>
+#include <signal.h>
+#include <math.h>
+#include <ctype.h>
+#include "lp_lib.h"
+#ifdef FORTIFY
+# include "lp_fortify.h"
+#define filetypeLP      1
+#define filetypeMPS     2
+#define filetypeFREEMPS 3
+#define filetypeCPLEX   4
+#define filetypeXLI     5
+#define FORCED_EXIT 255
+int EndOfPgr(int i)
+#   if defined FORTIFY
+      Fortify_LeaveScope();
+#   endif
+    exit(i);
+    return(0);
+void SIGABRT_func(int sig)
+ {
+   EndOfPgr(FORCED_EXIT);
+ }
+void print_help(char *argv[])
+  printf("Usage of %s version %d.%d.%d.%d:\n", argv[0], MAJORVERSION, MINORVERSION, RELEASE, BUILD);
+  printf("%s [options] [[<]input_file]\n", argv[0]);
+  printf("List of options:\n");
+  printf("-h\t\tprints this message\n");
+#if defined PARSER_LP
+  printf("-lp\t\tread from LP file (default)\n");
+  printf("-mps\t\tread from MPS file, default in fixed format\n");
+  printf("-mps_free\t\tuse free format\n");
+  printf("-mps_ibm\t\tinterprete integers accoring to ibm format\n");
+  printf("-mps_negobjconst\tnegate objective constant\n");
+  printf("-fmps\t\tread from MPS file in free format\n");
+  printf("-rpar filename\tread parameters from filename.\n");
+  printf("-rparopt options\n\t\toptions for parameter file:\n");
+  printf("\t\t -H headername: header name for parameters. By default 'Default'\n");
+  printf("-rxli xliname filename\n\t\tread file with xli library\n");
+  printf("-rxlidata datafilename\n\t\tdata file name for xli library.\n");
+  printf("-rxliopt options\n\t\toptions for xli library.\n");
+  printf("-rbas filename\tread basis from filename.\n");
+  printf("-gbas filename\tguess basis with variables from filename.\n");
+  printf("-plp\t\tprint model.\n");
+  printf("-wlp filename\twrite to LP file\n");
+  printf("-wmps filename\twrite to MPS file in fixed format\n");
+  printf("-wfmps filename\twrite to MPS file in free format\n");
+  printf("-wxli xliname filename\n\t\twrite file with xli library\n");
+  printf("-wxliopt options\n\t\toptions for xli library.\n");
+  printf("-wxlisol xliname filename\n\t\twrite solution file with xli library\n");
+  printf("-wxlisolopt options\n\t\toptions for xli library.\n");
+  printf("-wbas filename\twrite basis to filename.\n");
+  printf("-wpar filename\twrite parameters to filename.\n");
+  printf("-wparopt options\n\t\toptions for parameter file:\n");
+  printf("\t\t -H headername: header name for parameters. By default 'Default'\n");
+  printf("-wafter\t\tWrite model after solve (useful if presolve used).\n");
+  printf("-parse_only\tparse input file but do not solve\n");
+  printf("-nonames\tIgnore variables and constraint names\n");
+  printf("-norownames\tIgnore constraint names\n");
+  printf("-nocolnames\tIgnore variable names\n");
+  printf("\n");
+  printf("-min\t\tMinimize the lp problem (overrules setting in file)\n");
+  printf("-max\t\tMaximize the lp problem (overrules setting in file)\n");
+  printf("-r <value>\tspecify max nbr of pivots between a re-inversion of the matrix\n");
+  printf("-piv <rule>\tspecify simplex pivot rule\n");
+  printf("\t -piv0: Select first\n");
+  printf("\t -piv1: Select according to Dantzig\n");
+  printf("\t -piv2: Select Devex pricing from Paula Harris (default)\n");
+  printf("\t -piv3: Select steepest edge\n");
+  printf("These pivot rules can be combined with any of the following:\n");
+  printf("-pivf\t\tIn case of Steepest Edge, fall back to DEVEX in primal.\n");
+  printf("-pivm\t\tMultiple pricing.\n");
+  printf("-piva\t\tTemporarily use First Index if cycling is detected.\n");
+  printf("-pivr\t\tAdds a small randomization effect to the selected pricer.\n");
+#if defined EnablePartialOptimization
+  printf("-pivp\t\tEnable partial pricing.\n");
+  printf("-pivpc\t\tEnable partial pricing on columns.\n");
+  printf("-pivpr\t\tEnable partial pricing on rows.\n");
+  printf("-pivll\t\tScan entering/leaving columns left rather than right.\n");
+  printf("-pivla\t\tScan entering/leaving columns alternatingly left/right.\n");
+  printf("-pivh\t\tUse Harris' primal pivot logic rather than the default.\n");
+  printf("-pivt\t\tUse true norms for Devex and Steepest Edge initializations.\n");
+  printf("-o0\t\tDon't put objective in basis%s.\n", DEF_OBJINBASIS ? "" : " (default)");
+  printf("-o1\t\tPut objective in basis%s.\n", DEF_OBJINBASIS ? " (default)" : "");
+  printf("-s <mode> <scaleloop>\tuse automatic problem scaling.\n");
+  printf("\t -s0: No scaling\n");
+  printf("\t -s1: Geometric scaling (default)\n");
+  printf("\t -s2: Curtis-reid scaling\n");
+  printf("\t -s3: Scale to convergence using largest absolute value\n");
+  printf("\t  -s:\n");
+  printf("\t -s4: Numerical range-based scaling\n");
+  printf("\t -s5: Scale to convergence using logarithmic mean of all values\n");
+  printf("\t -s6: Scale based on the simple numerical range\n");
+  printf("\t -s7: Scale quadratic\n");
+  printf("These scaling rules can be combined with any of the following:\n");
+  printf("-sp\t\talso do power scaling.\n");
+  printf("-si\t\talso do Integer scaling (default).\n");
+  printf("-se\t\talso do equilibration to scale to the -1..1 range (default).\n");
+  printf("-presolve\tpresolve problem before start optimizing (rows+columns)\n");
+  printf("-presolverow\tpresolve problem before start optimizing (rows only)\n");
+  printf("-presolvecol\tpresolve problem before start optimizing (columns only)\n");
+  printf("-presolvel\talso eliminate linearly dependent rows\n");
+  printf("-presolves\talso convert constraints to SOSes (only SOS1 handled)\n");
+  printf("-presolver\tIf the phase 1 solution process finds that a constraint is\n\t\tredundant then this constraint is deleted\n");
+  printf("-presolvek\tSimplification of knapsack-type constraints through\n\t\taddition of an extra variable, which also helps bound the OF\n");
+  printf("-presolveq\tDirect substitution of one variable in 2-element equality\n\t\tconstraints; this requires changes to the constraint matrix\n");
+  printf("-presolvem\tMerge rows\n");
+  printf("-presolvefd\tCOLFIXDUAL\n");
+  printf("-presolvebnd\tPresolve bounds\n");
+  printf("-presolved\tPresolve duals\n");
+  printf("-presolvef\tIdentify implied free variables (releasing their expl. bounds)\n");
+  printf("-presolveslk\tIMPLIEDSLK\n");
+  printf("-presolveg\tReduce (tighten) coef. in integer models based on GCD argument\n");
+  printf("-presolveb\tAttempt to fix binary variables at one of their bounds\n");
+  printf("-presolvec\tAttempt to reduce coefficients in binary models\n");
+  printf("-presolverowd\tIdenfify and delete qualifying constraints that\n\t\tare dominated by others, also fixes variables at a bound\n");
+  printf("-presolvecold\tDeletes variables (mainly binary), that are dominated\n\t\tby others (only one can be non-zero)\n");
+  printf("-C <mode>\tbasis crash mode\n");
+  printf("\t -C0: No crash basis\n");
+  printf("\t -C2: Most feasible basis\n");
+  printf("\t -C3: Least degenerate basis\n");
+  printf("-prim\t\tPrefer the primal simplex for both phases.\n");
+  printf("-dual\t\tPrefer the dual simplex for both phases.\n");
+  printf("-simplexpp\tSet Phase1 Primal, Phase2 Primal.\n");
+  printf("-simplexdp\tSet Phase1 Dual, Phase2 Primal.\n");
+  printf("-simplexpd\tSet Phase1 Primal, Phase2 Dual.\n");
+  printf("-simplexdd\tSet Phase1 Dual, Phase2 Dual.\n");
+  printf("-degen\t\tuse perturbations to reduce degeneracy,\n\t\tcan increase numerical instability\n");
+  printf("-degenc\t\tuse column check to reduce degeneracy\n");
+  printf("-degend\t\tdynamic check to reduce degeneracy\n");
+  printf("-degenf\t\tanti-degen fixedvars\n");
+  printf("-degens\t\tanti-degen stalling\n");
+  printf("-degenn\t\tanti-degen numfailure\n");
+  printf("-degenl\t\tanti-degen lostfeas\n");
+  printf("-degeni\t\tanti-degen infeasible\n");
+  printf("-degenb\t\tanti-degen B&B\n");
+  printf("-degenr\t\tanti-degen Perturbation of the working RHS at refactorization\n");
+  printf("-degenp\t\tanti-degen Limit bound flips\n");
+  printf("-trej <Trej>\tset minimum pivot value\n");
+  printf("-epsd <epsd>\tset minimum tolerance for reduced costs\n");
+  printf("-epsb <epsb>\tset minimum tolerance for the RHS\n");
+  printf("-epsel <epsel>\tset tolerance for rounding values to zero\n");
+  printf("-epsp <epsp>\tset the value that is used as perturbation scalar for\n\t\tdegenerative problems\n");
+  printf("-improve <level>\titerative improvement level\n");
+  printf("\t -improve0: none\n");
+  printf("\t -improve1: Running accuracy measurement of solved equations on Bx=r\n");
+  printf("\t -improve2: Improve initial dual feasibility by bound flips (default)\n");
+  printf("\t -improve4: Low-cost accuracy monitoring in the dual\n");
+  printf("\t -improve8: check for primal/dual feasibility at the node level\n");
+  printf("-timeout <sec>\tTimeout after sec seconds when not solution found.\n");
+  printf("-timeoutok\tIf timeout, take the best yet found solution.\n");
+  printf("-bfp <filename>\tSet basis factorization package.\n");
+  printf("\n");
+  printf("-noint\t\tIgnore integer restrictions\n");
+  printf("-e <number>\tspecifies the tolerance which is used to determine whether a\n\t\tfloating point number is in fact an integer.\n\t\tShould be < 0.5\n");
+  printf("-g <number>\n");
+  printf("-ga <number>\tspecifies the absolute MIP gap for branch-and-bound.\n\t\tThis specifies the absolute allowed tolerance\n\t\ton the object function. Can result in faster solving times.\n");
+  printf("-gr <number>\tspecifies the relative MIP gap for branch-and-bound.\n\t\tThis specifies the relative allowed tolerance\n\t\ton the object function. Can result in faster solving times.\n");
+  printf("-f\t\tspecifies that branch-and-bound algorithm stops at first found\n");
+  printf("\t\tsolution\n");
+  printf("-b <bound>\tspecify a lower bound for the objective function\n\t\tto the program. If close enough, may speed up the\n\t\tcalculations.\n");
+  printf("-o <value>\tspecifies that branch-and-bound algorithm stops when objective\n");
+  printf("\t\tvalue is better than value\n");
+  printf("-c\n");
+  printf("-cc\t\tduring branch-and-bound, take the ceiling branch first\n");
+  printf("-cf\t\tduring branch-and-bound, take the floor branch first\n");
+  printf("-ca\t\tduring branch-and-bound, the algorithm chooses branch\n");
+  printf("-depth <limit>\tset branch-and-bound depth limit\n");
+  printf("-n <solnr>\tspecify which solution number to return\n");
+  printf("-B <rule>\tspecify branch-and-bound rule\n");
+  printf("\t -B0: Select Lowest indexed non-integer column (default)\n");
+  printf("\t -B1: Selection based on distance from the current bounds\n");
+  printf("\t -B2: Selection based on the largest current bound\n");
+  printf("\t -B3: Selection based on largest fractional value\n");
+  printf("\t -B4: Simple, unweighted pseudo-cost of a variable\n");
+  printf("\t -B5: This is an extended pseudo-costing strategy based on minimizing\n\t      the number of integer infeasibilities\n");
+  printf("\t -B6: This is an extended pseudo-costing strategy based on maximizing\n\t      the normal pseudo-cost divided by the number of infeasibilities.\n\t      Similar to (the reciprocal of) a cost/benefit ratio\n");
+  printf("These branch-and-bound rules can be combined with any of the following:\n");
+  printf("-Bw\t\tWeightReverse branch-and-bound\n");
+  printf("-Bb\t\tBranchReverse branch-and-bound\n");
+  printf("-Bg\t\tGreedy branch-and-bound\n");
+  printf("-Bp\t\tPseudoCost branch-and-bound\n");
+  printf("-BR\t\tExtended PseudoCost branch-and-bound\n");
+  printf("-Bf\t\tDepthFirst branch-and-bound\n");
+  printf("-Br\t\tRandomize branch-and-bound\n");
+  printf("-BG\t\tGubMode branch-and-bound\n");
+  printf("-Bd\t\tDynamic branch-and-bound\n");
+  printf("-Bs\t\tRestartMode branch-and-bound\n");
+  printf("-BB\t\tBreadthFirst branch-and-bound\n");
+  printf("-Bo\t\tOrder variables to improve branch-and-bound performance\n");
+  printf("-Bc\t\tDo bound tightening during B&B based of reduced cost info\n");
+  printf("-Bi\t\tInitialize pseudo-costs by strong branching\n");
+  printf("\n");
+  printf("-time\t\tPrint CPU time to parse input and to calculate result.\n");
+  printf("-v <level>\tverbose mode, gives flow through the program.\n");
+  printf("\t\t if level not provided (-v) then -v4 (NORMAL) is taken.\n");
+  printf("\t -v0: NEUTRAL\n");
+  printf("\t -v1: CRITICAL\n");
+  printf("\t -v2: SEVERE\n");
+  printf("\t -v3: IMPORTANT (default)\n");
+  printf("\t -v4: NORMAL\n");
+  printf("\t -v5: DETAILED\n");
+  printf("\t -v6: FULL\n");
+  printf("-t\t\ttrace pivot selection\n");
+  printf("-d\t\tdebug mode, all intermediate results are printed,\n\t\tand the branch-and-bound decisions\n");
+  printf("-R\t\treport information while solving the model\n");
+  printf("-Db <filename>\tDo a generic readable data dump of key lp_solve model variables\n\t\tbefore solve.\n\t\tPrincipally for run difference and debugging purposes\n");
+  printf("-Da <filename>\tDo a generic readable data dump of key lp_solve model variables\n\t\tafter solve.\n\t\tPrincipally for run difference and debugging purposes\n");
+  printf("-i\t\tprint all intermediate valid solutions.\n\t\tCan give you useful solutions even if the total run time\n\t\tis too long\n");
+  printf("-ia\t\tprint all intermediate (only non-zero values) valid solutions.\n\t\tCan give you useful solutions even if the total run time\n\t\tis too long\n");
+  printf("-stat\t\tPrint model statistics\n");
+  printf("-S <detail>\tPrint solution. If detail omitted, then -S2 is used.\n");
+  printf("\t -S0: Print nothing\n");
+  printf("\t -S1: Only objective value\n");
+  printf("\t -S2: Obj value+variables (default)\n");
+  printf("\t -S3: Obj value+variables+constraints\n");
+  printf("\t -S4: Obj value+variables+constraints+duals\n");
+  printf("\t -S5: Obj value+variables+constraints+duals+lp model\n");
+  printf("\t -S6: Obj value+variables+constraints+duals+lp model+scales\n");
+  printf("\t -S7: Obj value+variables+constraints+duals+lp model+scales+lp tableau\n");
+void print_cpu_times(const char *info)
+  static clock_t last_time = 0;
+  clock_t new_time;
+  new_time = clock();
+  fprintf(stderr, "CPU Time for %s: %gs (%gs total since program start)\n",
+          info, (new_time - last_time) / (double) CLOCKS_PER_SEC,
+          new_time / (double) CLOCKS_PER_SEC);
+  last_time = new_time;
+#if 0
+int myabortfunc(lprec *lp, void *aborthandle)
+  /* printf("%f\n",lp->rhs[0]*(lp->maximise ? 1 : -1)); */
+  return(0);
+static MYBOOL isNum(char *val)
+  int ord;
+  char *pointer;
+  ord = strtol(val, &pointer, 10);
+  return(*pointer == 0);
+static void DoReport(lprec *lp, char *str)
+  fprintf(stderr, "%s %6.1fsec %8g\n", str, time_elapsed(lp), get_working_objective(lp));
+static void __WINAPI LPMessageCB(lprec *lp, void *USERHANDLE, int msg)
+  if(msg==MSG_LPFEASIBLE)
+    DoReport(lp, "Feasible solution ");
+  else if(msg==MSG_LPOPTIMAL)
+    DoReport(lp, "Real solution ");
+  else if(msg==MSG_MILPFEASIBLE)
+    DoReport(lp, "First MILP    ");
+  else if(msg==MSG_MILPBETTER)
+    DoReport(lp, "Improved MILP ");
+void write_model(lprec *lp, char plp, char *wlp, char *wmps, char *wfmps, char *wxli, char *wxlisol, char *wxliname, char *wxlioptions)
+  if(plp)
+    print_lp(lp);
+  if(wlp != NULL)
+    write_lp(lp, wlp);
+  if(wmps != NULL)
+    write_mps(lp, wmps);
+  if(wfmps != NULL)
+    write_freemps(lp, wfmps);
+  if((wxliname != NULL) && (wxli != NULL)) {
+    if(!set_XLI(lp, wxliname)) {
+      fprintf(stderr, "Unable to set XLI library (%s).\n", wxliname);
+      EndOfPgr(FORCED_EXIT);
+    }
+    write_XLI(lp, wxli, wxlioptions, FALSE);
+    set_XLI(lp, NULL);
+  }
+  if((wxliname != NULL) && (wxlisol != NULL)) {
+    if(!set_XLI(lp, wxliname)) {
+      fprintf(stderr, "Unable to set XLI library (%s).\n", wxliname);
+      EndOfPgr(FORCED_EXIT);
+    }
+    write_XLI(lp, wxlisol, wxlioptions, TRUE);
+    set_XLI(lp, NULL);
+  }
+static void or_value(int *value, int orvalue)
+  if(*value == -1)
+    *value = 0;
+  *value |= orvalue;
+static void set_value(int *value, int orvalue)
+  *value = orvalue;
+#define nstats 5
+static void minmax1(REAL value0, REAL factor, REAL *minmax, int *nminmax, int row, int *rowminmax, int col, int *colminmax)
+  int i, n;
+  REAL value;
+  if (value0 == 0)
+    return;
+  value = fabs(value0) * factor;
+  for (i = 0; (i < *nminmax) && (value <= fabs(minmax[i]) * factor); i++)
+    if (value == fabs(minmax[i]) * factor)
+      return;
+  if (i >= nstats)
+    return;
+  n = *nminmax;
+  if (n == nstats)
+    n--;
+  memmove(minmax + i + 1, minmax + i, (n - i) * sizeof(*minmax));
+  minmax[i] = value0;
+  if (rowminmax != NULL) {
+    memmove(rowminmax + i + 1, rowminmax + i, (n - i) * sizeof(*rowminmax));
+    rowminmax[i] = row;
+  }
+  if (colminmax != NULL) {
+    memmove(colminmax + i + 1, colminmax + i, (n - i) * sizeof(*colminmax));
+    colminmax[i] = col;
+  }
+  if (*nminmax < nstats)
+    (*nminmax)++;
+static void minmax(REAL value, REAL *minima, REAL *maxima, int *nminima, int *nmaxima, int row, int *rowmin, int *rowmax, int col, int *colmin, int *colmax)
+  minmax1(value, -1.0, minima, nminima, row, rowmin, col, colmin);
+  minmax1(value, +1.0, maxima, nmaxima, row, rowmax, col, colmax);
+static void printminmax1(lprec *lp, char *s, REAL *minmax, int nminmax, int *rowminmax, int *colminmax)
+  int i;
+  for (i = 0; i < nminmax; i++) {
+    printf(" %s(", s);
+    if (rowminmax != NULL)
+      printf("%s", get_row_name(lp, rowminmax[i]));
+    if ((rowminmax != NULL) && (colminmax != NULL))
+      printf(", ");
+    if (colminmax != NULL)
+      printf("%s", get_col_name(lp, colminmax[i]));
+    printf(") = %.8f\n", minmax[i]);
+  }
+static void printminmax(lprec *lp, char *s, REAL *minima, REAL *maxima, int nminima, int nmaxima, int *rowmin, int *rowmax, int *colmin, int *colmax)
+  printf("Minima:\n");
+  printminmax1(lp, s, minima, nminima, rowmin, colmin);
+  printf("Maxima:\n");
+  printminmax1(lp, s, maxima, nmaxima, rowmax, colmax);
+static void printminmax(lprec *lp, char *s, REAL *minima, REAL *maxima, int nminima, int nmaxima, int *rowmin, int *rowmax, int *colmin, int *colmax)
+  int i, nminmax, n;
+  nminmax = nminima;
+  if (nmaxima > nminmax)
+    nminmax = nmaxima;
+  for (i = 0; i < nminmax; i++) {
+    n = 0;
+    if (i < nminima) {
+      n += printf("%s(", s);
+      if (rowmin != NULL)
+        n+= printf("%s", get_row_name(lp, rowmin[i]));
+      if ((rowmin != NULL) && (colmin != NULL))
+        n += printf(", ");
+      if (colmin != NULL)
+        n += printf("%s", get_col_name(lp, colmin[i]));
+      n += printf(") = %.8f", minima[i]);
+    }
+    if (n < 40)
+      n = 40 - n;
+    else
+      n = 1;
+    printf("%*.*s", n, n, "");
+    if (i < nmaxima) {
+      n += printf("%s(", s);
+      if (rowmax != NULL)
+        n+= printf("%s", get_row_name(lp, rowmax[i]));
+      if ((rowmax != NULL) && (colmax != NULL))
+        n += printf(", ");
+      if (colmax != NULL)
+        n += printf("%s", get_col_name(lp, colmax[i]));
+      n += printf(") = %.8f", maxima[i]);
+    }
+    printf("\n");
+  }
+static void print_statistics(lprec *lp)
+  REAL *col, *RHSmin, *RHSmax, *OBJmin, *OBJmax, *MATmin, *MATmax;
+  int *nz, ret, m, n, i, j, k, l, nRHSmin = 0, nRHSmax = 0, nOBJmin = 0, nOBJmax = 0, nMATmin = 0, nMATmax = 0, *rowRHSmin, *rowRHSmax, *colOBJmin, *colOBJmax, *rowMATmin, *rowMATmax, *colMATmin, *colMATmax;
+  m = get_Nrows(lp);
+  n = get_Ncolumns(lp);
+  col = (REAL *) malloc((1 + m) * sizeof(*col));
+  nz = (int *) malloc((1 + m) * sizeof(*RHSmin));
+  RHSmin = (REAL *) malloc(nstats * sizeof(*RHSmin));
+  RHSmax = (REAL *) malloc(nstats * sizeof(*RHSmax));
+  rowRHSmin = (int *) malloc(nstats * sizeof(*RHSmin));
+  rowRHSmax = (int *) malloc(nstats * sizeof(*RHSmax));
+  OBJmin = (REAL *) malloc(nstats * sizeof(*OBJmin));
+  OBJmax = (REAL *) malloc(nstats * sizeof(*OBJmax));
+  colOBJmin = (int *) malloc(nstats * sizeof(*colOBJmin));
+  colOBJmax = (int *) malloc(nstats * sizeof(*colOBJmax));
+  MATmin = (REAL *) malloc(nstats * sizeof(*MATmin));
+  MATmax = (REAL *) malloc(nstats * sizeof(*MATmax));
+  rowMATmin = (int *) malloc(nstats * sizeof(*rowMATmin));
+  rowMATmax = (int *) malloc(nstats * sizeof(*rowMATmax));
+  colMATmin = (int *) malloc(nstats * sizeof(*colMATmin));
+  colMATmax = (int *) malloc(nstats * sizeof(*colMATmax));
+  minmax(2.0, MATmin, MATmax, &nMATmin, &nMATmax, 1, rowMATmin, rowMATmax, 8, colMATmin, colMATmax);
+  minmax(1.0, MATmin, MATmax, &nMATmin, &nMATmax, 2, rowMATmin, rowMATmax, 7, colMATmin, colMATmax);
+  minmax(1.5, MATmin, MATmax, &nMATmin, &nMATmax, 3, rowMATmin, rowMATmax, 6, colMATmin, colMATmax);
+  minmax(3.0, MATmin, MATmax, &nMATmin, &nMATmax, 4, rowMATmin, rowMATmax, 5, colMATmin, colMATmax);
+  minmax(4.0, MATmin, MATmax, &nMATmin, &nMATmax, 5, rowMATmin, rowMATmax, 4, colMATmin, colMATmax);
+  minmax(0.1, MATmin, MATmax, &nMATmin, &nMATmax, 6, rowMATmin, rowMATmax, 3, colMATmin, colMATmax);
+  minmax(5.0, MATmin, MATmax, &nMATmin, &nMATmax, 7, rowMATmin, rowMATmax, 2, colMATmin, colMATmax);
+  minmax(1.4, MATmin, MATmax, &nMATmin, &nMATmax, 8, rowMATmin, rowMATmax, 1, colMATmin, colMATmax);
+  printminmax(MATmin, MATmax, nMATmin, nMATmax, rowMATmin, rowMATmax, colMATmin, colMATmax);
+  for (i = 1; i <= m; i++)
+    minmax(get_rh(lp, i), RHSmin, RHSmax, &nRHSmin, &nRHSmax, i, rowRHSmin, rowRHSmax, 0, NULL, NULL);
+  for (j = 1; j <= n; j++) {
+    ret = get_columnex(lp, j, col, nz);
+    for (i = 0; i < ret; i++)
+      if (nz[i] == 0)
+        minmax(col[i], OBJmin, OBJmax, &nOBJmin, &nOBJmax, 0, NULL, NULL, j, colOBJmin, colOBJmax);
+      else
+        minmax(col[i], MATmin, MATmax, &nMATmin, &nMATmax, nz[i], rowMATmin, rowMATmax, j, colMATmin, colMATmax);
+  }
+  printf("Constraints: %d\n", get_Nrows(lp));
+  printf("Variables  : %d\n", get_Ncolumns(lp));
+  for (j = k = l = 0, i = n; i >= 1; i--) {
+    if (is_int(lp, i))
+      j++;
+    if (is_semicont(lp, i))
+      k++;
+    if (is_SOS_var(lp, i))
+      l++;
+  }
+  printf("Integers   : %d\n", j);
+  printf("Semi-cont  : %d\n", k);
+  printf("SOS        : %d\n", l);
+  k = get_nonzeros(lp);
+  printf("Non-zeros  : %d\tdensity=%f%%\n", k, ((double) k) / (((double) m) * ((double) n)) * 100.0);
+  printf("\nAbsolute Ranges:\n\n       Minima                                  Maxima\n");
+  printf("\nMatrix Coeficients:\n");
+  printminmax(lp, "A", MATmin, MATmax, nMATmin, nMATmax, rowMATmin, rowMATmax, colMATmin, colMATmax);
+  printf("\nObj. Vector:\n");
+  printminmax(lp, "c", OBJmin, OBJmax, nOBJmin, nOBJmax, NULL, NULL, colOBJmin, colOBJmax);
+  printf("\nRHS Vector:\n");
+  printminmax(lp, "b", RHSmin, RHSmax, nRHSmin, nRHSmax, rowRHSmin, rowRHSmax, NULL, NULL);
+  free(col);
+  free(nz);
+  free(RHSmin);
+  free(RHSmax);
+  free(rowRHSmin);
+  free(rowRHSmax);
+  free(OBJmin);
+  free(OBJmax);
+  free(colOBJmin);
+  free(colOBJmax);
+  free(MATmin);
+  free(MATmax);
+  free(rowMATmin);
+  free(rowMATmax);
+  free(colMATmin);
+  free(colMATmax);
+int main(int argc, char *argv[])
+  lprec *lp = NULL;
+  char *filen, *wlp = NULL, *wmps = NULL, *wfmps = NULL, plp = FALSE;
+  int i;
+  int verbose = IMPORTANT /* CRITICAL */;
+  int debug = -1;
+  MYBOOL report = FALSE;
+  MYBOOL nonames = FALSE, norownames = FALSE, nocolnames = FALSE;
+  MYBOOL write_model_after = FALSE;
+  MYBOOL noint = FALSE;
+  int print_sol = -1;
+  MYBOOL print_stats = FALSE;
+  int floor_first = -1;
+  MYBOOL do_set_bb_depthlimit = FALSE;
+  int bb_depthlimit = 0;
+  MYBOOL do_set_solutionlimit = FALSE;
+  int solutionlimit = 0;
+  MYBOOL break_at_first = FALSE;
+  int scaling = 0;
+  double scaleloop = 0;
+  MYBOOL tracing = FALSE;
+  short filetype = filetypeLP;
+  int anti_degen1 = -1;
+  int anti_degen2 = -1;
+  short print_timing = FALSE;
+  short parse_only = FALSE;
+  int do_presolve = -1;
+  short objective = 0;
+  short PRINT_SOLUTION = 2;
+  int improve = -1;
+  int pivoting1 = -1;
+  int pivoting2 = -1;
+  int bb_rule1 = -1;
+  int bb_rule2 = -1;
+  int max_num_inv = -1;
+  int scalemode1 = -1;
+  int scalemode2 = -1;
+  int crashmode = -1;
+  char *guessbasis = NULL;
+  /* short timeoutok = FALSE; */
+  long sectimeout = -1;
+  int result;
+  MYBOOL preferdual = AUTOMATIC;
+  int simplextype = -1;
+  MYBOOL do_set_obj_bound = FALSE;
+  REAL obj_bound = 0;
+  REAL mip_absgap = -1;
+  REAL mip_relgap = -1;
+  REAL epsperturb = -1;
+  REAL epsint = -1;
+  REAL epspivot = -1;
+  REAL epsd = -1;
+  REAL epsb = -1;
+  REAL epsel = -1;
+  MYBOOL do_set_break_at_value = FALSE;
+  REAL break_at_value = 0;
+  FILE *fpin = stdin;
+  char *bfp = NULL;
+  char *rxliname = NULL, *rxli = NULL, *rxlidata = NULL, *rxlioptions = NULL, *wxliname = NULL, *wxlisol = NULL, *wxli = NULL, *wxlioptions = NULL, *wxlisoloptions = NULL;
+  char *rbasname = NULL, *wbasname = NULL;
+  char *debugdump_before = NULL;
+  char *debugdump_after = NULL;
+  char *rparname = NULL;
+  char *rparoptions = NULL;
+  char *wparname = NULL;
+  char *wparoptions = NULL;
+  char obj_in_basis = -1;
+  char mps_ibm = FALSE;
+  char mps_negobjconst = FALSE;
+  char mps_free = FALSE;
+  MYBOOL ok;
+  /* read command line arguments */
+# if defined FORTIFY
+   Fortify_EnterScope();
+# endif
+  for(i = 1; i < argc; i++) {
+    ok = FALSE;
+    if(strncmp(argv[i], "-v", 2) == 0) {
+      if (argv[i][2])
+        verbose = atoi(argv[i] + 2);
+      else
+        verbose = NORMAL;
+    }
+    else if(strcmp(argv[i], "-d") == 0)
+      debug = TRUE;
+    else if(strcmp(argv[i], "-R") == 0)
+      report = TRUE;
+    else if(strcmp(argv[i], "-i") == 0)
+      print_sol = TRUE;
+    else if(strcmp(argv[i], "-ia") == 0)
+      print_sol = AUTOMATIC;
+    else if(strcmp(argv[i], "-stat") == 0)
+      print_stats = TRUE;
+    else if(strcmp(argv[i], "-nonames") == 0)
+      nonames = TRUE;
+    else if(strcmp(argv[i], "-norownames") == 0)
+      norownames = TRUE;
+    else if(strcmp(argv[i], "-nocolnames") == 0)
+      nocolnames = TRUE;
+    else if((strcmp(argv[i], "-c") == 0) || (strcmp(argv[i], "-cc") == 0))
+      floor_first = BRANCH_CEILING;
+    else if(strcmp(argv[i], "-cf") == 0)
+      floor_first = BRANCH_FLOOR;
+    else if(strcmp(argv[i], "-ca") == 0)
+      floor_first = BRANCH_AUTOMATIC;
+    else if((strcmp(argv[i], "-depth") == 0) && (i + 1 < argc)) {
+      do_set_bb_depthlimit = TRUE;
+      bb_depthlimit = atoi(argv[++i]);
+    }
+    else if(strcmp(argv[i], "-Bw") == 0)
+      or_value(&bb_rule2, NODE_WEIGHTREVERSEMODE);
+    else if(strcmp(argv[i], "-Bb") == 0)
+      or_value(&bb_rule2, NODE_BRANCHREVERSEMODE);
+    else if(strcmp(argv[i], "-Bg") == 0)
+      or_value(&bb_rule2, NODE_GREEDYMODE);
+    else if(strcmp(argv[i], "-Bp") == 0)
+      or_value(&bb_rule2, NODE_PSEUDOCOSTMODE);
+    else if(strcmp(argv[i], "-BR") == 0)
+      or_value(&bb_rule2, NODE_PSEUDORATIOSELECT);
+    else if(strcmp(argv[i], "-Bf") == 0)
+      or_value(&bb_rule2, NODE_DEPTHFIRSTMODE);
+    else if(strcmp(argv[i], "-Br") == 0)
+      or_value(&bb_rule2, NODE_RANDOMIZEMODE);
+    else if(strcmp(argv[i], "-BG") == 0)
+      or_value(&bb_rule2, 0 /* NODE_GUBMODE */); /* doesn't work yet */
+    else if(strcmp(argv[i], "-Bd") == 0)
+      or_value(&bb_rule2, NODE_DYNAMICMODE);
+    else if(strcmp(argv[i], "-Bs") == 0)
+      or_value(&bb_rule2, NODE_RESTARTMODE);
+    else if(strcmp(argv[i], "-BB") == 0)
+      or_value(&bb_rule2, NODE_BREADTHFIRSTMODE);
+    else if(strcmp(argv[i], "-Bo") == 0)
+      or_value(&bb_rule2, NODE_AUTOORDER);
+    else if(strcmp(argv[i], "-Bc") == 0)
+      or_value(&bb_rule2, NODE_RCOSTFIXING);
+    else if(strcmp(argv[i], "-Bi") == 0)
+      or_value(&bb_rule2, NODE_STRONGINIT);
+    else if(strncmp(argv[i], "-B", 2) == 0) {
+      if (argv[i][2])
+        set_value(&bb_rule1, atoi(argv[i] + 2));
+      else
+        set_value(&bb_rule1, NODE_FIRSTSELECT);
+    }
+    else if((strcmp(argv[i], "-n") == 0) && (i + 1 < argc)) {
+      do_set_solutionlimit = TRUE;
+      solutionlimit = atoi(argv[++i]);
+    }
+    else if((strcmp(argv[i], "-b") == 0) && (i + 1 < argc)) {
+      obj_bound = atof(argv[++i]);
+      do_set_obj_bound = TRUE;
+    }
+    else if(((strcmp(argv[i], "-g") == 0) || (strcmp(argv[i], "-ga") == 0)) && (i + 1 < argc))
+      mip_absgap = atof(argv[++i]);
+    else if((strcmp(argv[i], "-gr") == 0) && (i + 1 < argc))
+      mip_relgap = atof(argv[++i]);
+    else if((strcmp(argv[i], "-e") == 0) && (i + 1 < argc)) {
+      epsint = atof(argv[++i]);
+      if((epsint <= 0.0) || (epsint >= 0.5)) {
+        fprintf(stderr, "Invalid tolerance %g; 0 < epsilon < 0.5\n",
+                (double)epsint);
+        EndOfPgr(FORCED_EXIT);
+      }
+    }
+    else if((strcmp(argv[i], "-r") == 0) && (i + 1 < argc))
+      max_num_inv = atoi(argv[++i]);
+    else if((strcmp(argv[i], "-o") == 0) && (i + 1 < argc)) {
+      break_at_value = atof(argv[++i]);
+      do_set_break_at_value = TRUE;
+    }
+    else if(strcmp(argv[i], "-f") == 0)
+      break_at_first = TRUE;
+    else if(strcmp(argv[i], "-timeoutok") == 0)
+      /* timeoutok = TRUE */; /* option no longer needed, but still accepted */
+    else if(strcmp(argv[i], "-h") == 0) {
+      print_help(argv);
+      EndOfPgr(EXIT_SUCCESS);
+    }
+    else if(strcmp(argv[i], "-prim") == 0)
+      preferdual = FALSE;
+    else if(strcmp(argv[i], "-dual") == 0)
+      preferdual = TRUE;
+    else if(strcmp(argv[i], "-simplexpp") == 0)
+      simplextype = SIMPLEX_PRIMAL_PRIMAL;
+    else if(strcmp(argv[i], "-simplexdp") == 0)
+      simplextype = SIMPLEX_DUAL_PRIMAL;
+    else if(strcmp(argv[i], "-simplexpd") == 0)
+      simplextype = SIMPLEX_PRIMAL_DUAL;
+    else if(strcmp(argv[i], "-simplexdd") == 0)
+      simplextype = SIMPLEX_DUAL_DUAL;
+    else if(strcmp(argv[i], "-sp") == 0)
+      or_value(&scalemode2, SCALE_POWER2);
+    else if(strcmp(argv[i], "-si") == 0)
+      or_value(&scalemode2, SCALE_INTEGERS);
+    else if(strcmp(argv[i], "-se") == 0)
+      or_value(&scalemode2, SCALE_EQUILIBRATE);
+    else if(strncmp(argv[i], "-s", 2) == 0) {
+      set_value(&scalemode1, SCALE_NONE);
+      scaling = SCALE_MEAN;
+      if (argv[i][2]) {
+        switch (atoi(argv[i] + 2)) {
+        case 0:
+          scaling = SCALE_NONE;
+          break;
+        case 1:
+          set_value(&scalemode1, SCALE_GEOMETRIC);
+          break;
+        case 2:
+          set_value(&scalemode1, SCALE_CURTISREID);
+          break;
+        case 3:
+          set_value(&scalemode1, SCALE_EXTREME);
+          break;
+        case 4:
+          set_value(&scalemode1, SCALE_MEAN);
+          break;
+        case 5:
+          set_value(&scalemode1, SCALE_MEAN | SCALE_LOGARITHMIC);
+          break;
+        case 6:
+          set_value(&scalemode1, SCALE_RANGE);
+          break;
+        case 7:
+          set_value(&scalemode1, SCALE_MEAN | SCALE_QUADRATIC);
+          break;
+        }
+      }
+      else
+        set_value(&scalemode1, SCALE_MEAN);
+      if((i + 1 < argc) && (isNum(argv[i + 1])))
+        scaleloop = atoi(argv[++i]);
+    }
+    else if(strncmp(argv[i], "-C", 2) == 0)
+      crashmode = atoi(argv[i] + 2);
+    else if((strcmp(argv[i],"-gbas") == 0) && (i + 1 < argc))
+      guessbasis = argv[++i];
+    else if(strcmp(argv[i], "-t") == 0)
+      tracing = TRUE;
+    else if(strncmp(argv[i], "-S", 2) == 0) {
+      if (argv[i][2])
+        PRINT_SOLUTION = (short) atoi(argv[i] + 2);
+      else
+        PRINT_SOLUTION = 2;
+    }
+    else if(strncmp(argv[i], "-improve", 8) == 0) {
+      if (argv[i][8])
+        or_value(&improve, atoi(argv[i] + 8));
+    }
+    else if(strcmp(argv[i], "-pivll") == 0)
+      or_value(&pivoting2, PRICE_LOOPLEFT);
+    else if(strcmp(argv[i], "-pivla") == 0)
+      or_value(&pivoting2, PRICE_LOOPALTERNATE);
+#if defined EnablePartialOptimization
+    else if(strcmp(argv[i], "-pivpc") == 0)
+      or_value(&pivoting2, PRICE_AUTOPARTIALCOLS);
+    else if(strcmp(argv[i], "-pivpr") == 0)
+      or_value(&pivoting2, PRICE_AUTOPARTIALROWS);
+    else if(strcmp(argv[i], "-pivp") == 0)
+      or_value(&pivoting2, PRICE_AUTOPARTIAL);
+    else if(strcmp(argv[i], "-pivf") == 0)
+      or_value(&pivoting2, PRICE_PRIMALFALLBACK);
+    else if(strcmp(argv[i], "-pivm") == 0)
+      or_value(&pivoting2, PRICE_MULTIPLE);
+    else if(strcmp(argv[i], "-piva") == 0)
+      or_value(&pivoting2, PRICE_ADAPTIVE);
+    else if(strcmp(argv[i], "-pivr") == 0)
+      or_value(&pivoting2, PRICE_RANDOMIZE);
+    else if(strcmp(argv[i], "-pivh") == 0)
+      or_value(&pivoting2, PRICE_HARRISTWOPASS);
+    else if(strcmp(argv[i], "-pivt") == 0)
+      or_value(&pivoting2, PRICE_TRUENORMINIT);
+    else if(strncmp(argv[i], "-piv", 4) == 0) {
+      if (argv[i][4])
+        set_value(&pivoting1, atoi(argv[i] + 4));
+      else
+    set_value(&pivoting1, PRICER_DEVEX | PRICE_ADAPTIVE);
+    }
+#if defined PARSER_LP
+    else if(strcmp(argv[i],"-lp") == 0)
+      filetype = filetypeLP;
+    else if((strcmp(argv[i],"-wlp") == 0) && (i + 1 < argc))
+      wlp = argv[++i];
+    else if(strcmp(argv[i],"-plp") == 0)
+      plp = TRUE;
+    else if(strcmp(argv[i],"-mps") == 0)
+      filetype = filetypeMPS;
+    else if(strcmp(argv[i],"-mps_ibm") == 0)
+      mps_ibm = TRUE;
+    else if(strcmp(argv[i],"-mps_negobjconst") == 0)
+      mps_negobjconst = TRUE;
+    else if(strcmp(argv[i],"-mps_free") == 0)
+      mps_free = TRUE;
+    else if(strcmp(argv[i],"-fmps") == 0)
+      filetype = filetypeFREEMPS;
+    else if((strcmp(argv[i],"-wmps") == 0) && (i + 1 < argc))
+      wmps = argv[++i];
+    else if((strcmp(argv[i],"-wfmps") == 0) && (i + 1 < argc))
+      wfmps = argv[++i];
+    else if(strcmp(argv[i],"-wafter") == 0)
+      write_model_after = TRUE;
+    else if(strcmp(argv[i],"-degen") == 0)
+      set_value(&anti_degen1, ANTIDEGEN_DEFAULT);
+    else if(strcmp(argv[i],"-degenf") == 0)
+      or_value(&anti_degen2, ANTIDEGEN_FIXEDVARS);
+    else if(strcmp(argv[i],"-degenc") == 0)
+      or_value(&anti_degen2, ANTIDEGEN_COLUMNCHECK);
+    else if(strcmp(argv[i],"-degens") == 0)
+      or_value(&anti_degen2, ANTIDEGEN_STALLING);
+    else if(strcmp(argv[i],"-degenn") == 0)
+      or_value(&anti_degen2, ANTIDEGEN_NUMFAILURE);
+    else if(strcmp(argv[i],"-degenl") == 0)
+      or_value(&anti_degen2, ANTIDEGEN_LOSTFEAS);
+    else if(strcmp(argv[i],"-degeni") == 0)
+      or_value(&anti_degen2, ANTIDEGEN_INFEASIBLE);
+    else if(strcmp(argv[i],"-degend") == 0)
+      or_value(&anti_degen2, ANTIDEGEN_DYNAMIC);
+    else if(strcmp(argv[i],"-degenb") == 0)
+      or_value(&anti_degen2, ANTIDEGEN_DURINGBB);
+    else if(strcmp(argv[i],"-degenr") == 0)
+      or_value(&anti_degen2, ANTIDEGEN_RHSPERTURB);
+    else if(strcmp(argv[i],"-degenp") == 0)
+      or_value(&anti_degen2, ANTIDEGEN_BOUNDFLIP);
+    else if(strcmp(argv[i],"-time") == 0) {
+      if(clock() == -1)
+        fprintf(stderr, "CPU times not available on this machine\n");
+      else
+        print_timing = TRUE;
+    }
+    else if((strcmp(argv[i],"-bfp") == 0) && (i + 1 < argc))
+      bfp = argv[++i];
+    else if((strcmp(argv[i],"-rxli") == 0) && (i + 2 < argc)) {
+      rxliname = argv[++i];
+      rxli = argv[++i];
+      fpin = NULL;
+      filetype = filetypeXLI;
+    }
+    else if((strcmp(argv[i],"-rxlidata") == 0) && (i + 1 < argc))
+      rxlidata = argv[++i];
+    else if((strcmp(argv[i],"-rxliopt") == 0) && (i + 1 < argc))
+      rxlioptions = argv[++i];
+    else if((strcmp(argv[i],"-wxli") == 0) && (i + 2 < argc)) {
+      wxliname = argv[++i];
+      wxli = argv[++i];
+    }
+    else if((strcmp(argv[i],"-wxliopt") == 0) && (i + 1 < argc))
+      wxlioptions = argv[++i];
+    else if((strcmp(argv[i],"-wxlisol") == 0) && (i + 2 < argc)) {
+      wxliname = argv[++i];
+      wxlisol = argv[++i];
+    }
+    else if((strcmp(argv[i],"-wxlisolopt") == 0) && (i + 1 < argc))
+      wxlisoloptions = argv[++i];
+    else if((strcmp(argv[i],"-rbas") == 0) && (i + 1 < argc))
+      rbasname = argv[++i];
+    else if((strcmp(argv[i],"-wbas") == 0) && (i + 1 < argc))
+      wbasname = argv[++i];
+    else if((strcmp(argv[i],"-Db") == 0) && (i + 1 < argc))
+      debugdump_before = argv[++i];
+    else if((strcmp(argv[i],"-Da") == 0) && (i + 1 < argc))
+      debugdump_after = argv[++i];
+    else if((strcmp(argv[i],"-timeout") == 0) && (i + 1 < argc))
+      sectimeout = atol(argv[++i]);
+    else if((strcmp(argv[i],"-trej") == 0) && (i + 1 < argc))
+      epspivot = atof(argv[++i]);
+    else if((strcmp(argv[i],"-epsp") == 0) && (i + 1 < argc))
+      epsperturb = atof(argv[++i]);
+    else if((strcmp(argv[i],"-epsd") == 0) && (i + 1 < argc))
+      epsd = atof(argv[++i]);
+    else if((strcmp(argv[i],"-epsb") == 0) && (i + 1 < argc))
+      epsb = atof(argv[++i]);
+    else if((strcmp(argv[i],"-epsel") == 0) && (i + 1 < argc))
+      epsel = atof(argv[++i]);
+    else if(strcmp(argv[i],"-parse_only") == 0)
+      parse_only = TRUE;
+    else
+      ok = TRUE;
+    if(!ok)
+      ;
+    else if(strcmp(argv[i],"-presolverow") == 0)
+      or_value(&do_presolve, PRESOLVE_ROWS);
+    else if(strcmp(argv[i],"-presolvecol") == 0)
+      or_value(&do_presolve, PRESOLVE_COLS);
+    else if(strcmp(argv[i],"-presolve") == 0)
+      or_value(&do_presolve, PRESOLVE_ROWS | PRESOLVE_COLS);
+    else if(strcmp(argv[i],"-presolvel") == 0)
+      or_value(&do_presolve, PRESOLVE_LINDEP);
+    else if(strcmp(argv[i],"-presolves") == 0)
+      or_value(&do_presolve, PRESOLVE_SOS);
+    else if(strcmp(argv[i],"-presolver") == 0)
+      or_value(&do_presolve, PRESOLVE_REDUCEMIP);
+    else if(strcmp(argv[i],"-presolvek") == 0)
+      or_value(&do_presolve, PRESOLVE_KNAPSACK);
+    else if(strcmp(argv[i],"-presolveq") == 0)
+      or_value(&do_presolve, PRESOLVE_ELIMEQ2);
+    else if(strcmp(argv[i],"-presolvem") == 0)
+      or_value(&do_presolve, PRESOLVE_MERGEROWS);
+    else if(strcmp(argv[i],"-presolvefd") == 0)
+      or_value(&do_presolve, PRESOLVE_COLFIXDUAL);
+    else if(strcmp(argv[i],"-presolvebnd") == 0)
+      or_value(&do_presolve, PRESOLVE_BOUNDS);
+    else if(strcmp(argv[i],"-presolved") == 0)
+      or_value(&do_presolve, PRESOLVE_DUALS);
+    else if(strcmp(argv[i],"-presolvef") == 0)
+      or_value(&do_presolve, PRESOLVE_IMPLIEDFREE);
+    else if(strcmp(argv[i],"-presolveslk") == 0)
+      or_value(&do_presolve, PRESOLVE_IMPLIEDSLK);
+    else if(strcmp(argv[i],"-presolveg") == 0)
+      or_value(&do_presolve, PRESOLVE_REDUCEGCD);
+    else if(strcmp(argv[i],"-presolveb") == 0)
+      or_value(&do_presolve, PRESOLVE_PROBEFIX);
+    else if(strcmp(argv[i],"-presolvec") == 0)
+      or_value(&do_presolve, PRESOLVE_PROBEREDUCE);
+    else if(strcmp(argv[i],"-presolverowd") == 0)
+      or_value(&do_presolve, PRESOLVE_ROWDOMINATE);
+    else if(strcmp(argv[i],"-presolvecold") == 0)
+      or_value(&do_presolve, PRESOLVE_COLDOMINATE);
+    else if(strcmp(argv[i],"-min") == 0)
+      objective = -1;
+    else if(strcmp(argv[i],"-max") == 0)
+      objective =  1;
+    else if(strcmp(argv[i],"-noint") == 0)
+      noint =  TRUE;
+    else if((strcmp(argv[i],"-rpar") == 0) && (i + 1 < argc))
+      i++;
+    else if((strcmp(argv[i],"-rparopt") == 0) && (i + 1 < argc))
+      i++;
+    else if((strcmp(argv[i],"-wpar") == 0) && (i + 1 < argc))
+      i++;
+    else if((strcmp(argv[i],"-wparopt") == 0) && (i + 1 < argc))
+      i++;
+    else if(strcmp(argv[i],"-o0") == 0)
+      obj_in_basis = FALSE;
+    else if(strcmp(argv[i],"-o1") == 0)
+      obj_in_basis = TRUE;
+    else if(fpin == stdin) {
+      filen = argv[i];
+      if(*filen == '<')
+        filen++;
+      if((fpin = fopen(filen, "r")) == NULL) {
+        print_help(argv);
+        fprintf(stderr,"\nError, Unable to open input file '%s'\n",
+                argv[i]);
+        EndOfPgr(FORCED_EXIT);
+      }
+    }
+    else {
+      filen = argv[i];
+      if(*filen != '>') {
+        print_help(argv);
+        fprintf(stderr, "\nError, Unrecognized command line argument '%s'\n",
+                argv[i]);
+        EndOfPgr(FORCED_EXIT);
+      }
+    }
+  }