📄 changelog
字号:
There is now a new routine print_file() to make the output go to a file. Default the output still goes to stderr. If the provided filename is NULL, then output is set (back) to stderr. The return value of this routine is TRUE or FALSE indicating if file could be created (TRUE) of not (FALSE). Some debugging routines were moved from lpkit.c to debug.c: print_lp() print_solution()- Routine print_solution() is split in several routines: print_objective() print_solution() print_constraints() print_duals() print_scales()- A new routine report is added in debug.c to report messages. These messages are mostly debugging and tracing messages shown in verbose mode. In fact this routine is a replacement for an already existing routine error() which always printed to stderr. Until version 3 these messages were always reported to stderr or stdout. Default this routine reports to stderr, but via a new member in the lprec structure (writelog), it is now possible to define an own reporting routine. How much the routine will report depends on the verbose level. Until version 3 there were only two possible values for the verbose member in the lprec structure: TRUE or FALSE: report or not. From version 4 there are seven possible verbose levels. They are defined via constants: #define CRITICALSTOP 0 #define CRITICAL 1 #define SEVERE 2 #define IMPORTANT 3 #define NORMAL 4 #define DETAILED 5 #define FULL 6 The bigger the number, the more reporting. 0 is as good as no reporting. This will only occur when a severe error occurs. It is the default verbose level. It is only generated by the lp parse routine and will raise a termination signal SIGABRT if it occurs. FULL is report everything. The lp_solve executable supports these different levels via an extra number to be added with the -v option. For example -v4 indicates verbose level 4. When only -v is specified, thus with a number, then verbose level NORMAL (4) is used.- Row and column names can be provided. This is indicated by the member names_used op the lprec structure. Until version 3 one had to check this value to know if lp->col_name and lp->row_name could be accessed to get this name and if now one was constructed either as Row[x] or r_x From version 4 it is better to use the new routines get_col_name() and get_row_name() to get a name. It may always be called, even if no names were provided. In that case a name r_x or v_x is generated. That way names are always consequent, which was not the case until version 3.- Reading and writing lp model. Now supports also ranges. This means that a minimum and maximum on a row can be one line. This was already supported by the MPS format, but not in the lp format. Not only this gives this the advantage that a row doesn't have to be repeated with the same coefficients and only a different restriction, but more important the algorithm will perform better when this is done. Less memory is needed and a solution will be found faster.- Added a routine read_LP to read an lp file. This is identical to read_lp_file, except that read_LP accepts a file name while read_lp_file needs a file pointer to an already opened file.- read_lp_file now uses a common routine to allocate the lp structures instead of building it by itself. This makes it easier to modify the lp structures.- Reading MPS files gave sometimes a parsing error when extra spaces were at the end of a line.- Added a routine read_MPS to read an MPS file. This is identical to read_mps, except that read_MPS accepts a file name while read_mps needs a file pointer to an already opened file.- Some memory leaks could occur in several surcomstances.- Added a new routine set_bounds() to specify lower and upper bound of a variable at once. Routines set_upbo() and set_lowbo() still exists.- Added semi-continious optimization. The MPS BOUNDS section now support types SC and SI and a new routine is added to specify a variable as semi-continious set_semicont(). Routine is_semicont() returns TRUE if column is set as semi-continious. SC stands for Semi Continious and SI for Semi-continius Integer. The lp-format doesn't know the SC and SI restrictions.- Added SOS optimization. A new routine is added to specify a variable as SOS: add_SOS(). Routine is_SOS_var() returns TRUE if column is set as SOS. In the MPS files SOS restrictions can be specified in the SOS section. The lp-format doesn't know the SOS restrictions. See SOSInterpolation.pdf for a description about SOS optimization.- Variables of type FR (free variables ie between minus infinity and plus infinity were split in two variables. This isn't the case anymore.- Added max_allowed_columns and set_magic(). Purpose ???- Added a new routine lp_solve_version() to get the version number of lp_solve The version number is still kept in patchlevel.h, however no longer as a string, but as 4 numbers: #define MAJORVERSION 4 #define MINORVERSION 0 #define RELEASE 0 #define BUILD 0 This new routine returns those 4 values.- Added new routine is_int which returns TRUE if column variable is integer.- Added a new routine make_lpext() which allows to create a new lprec structure like make_lp does, but with more parameters so that it can also be used by the lp parser. make_lp calles this routine also. By doing this all code to create the lprec structure is in only one routine. Is ment for internal use.- Scaling routine is improved considerably. Some bug were fixed. Also added scaling to lagrange variables. The new member scalemode in the lprec structure specifies what kind of scaling must be done. This can be: - MMSCALING: Do numerical range-based scaling (default, original) - GEOSCALING: Do geometric mean scaling - POWERSCALE: create a scalar of power 2, if specified; may improve compute - CURTISREIDSCALE: Do Curtis-Reid scaling. - LAGRANGESCALE: Also scale Lagrange columns. Default they are not scaled. - INTEGERSCALE: Also scale Integer columns. Default they are not scaled. Either MMSCALING or GEOSCALING or CURTISREIDSCALE may be chosen. MMSCALING and GEOSCALING can be combined with POWERSCALE by ORing this value These values may be ORed to combine several scaling methods The default is MMSCALING scaling. For Curtis-Reid scaling the routine scaleCR must be called instead of (auto_)scale.- Added two new routines for getting the unscaled lower and upper bounds on variables: get_upbo() get_lowbo()- Added routines set_uprange() and set_lowrange() to specify upper and lower ranges. Scaling is applied in the routines.- Added routine get_rh() to retrieve unscaled RHS value.- Added routine set_rh_range() to set a range on RHS value and get_rh_range() to retrieve the unscaled value.- Added routine get_constr_type() to get contraint type.- Added routine get_mat() as an alternative for mat_elm()- Bug corrections in routine get_reduced_costs(). Did not work correct if scaling was used. This routine also returns the same as lp->duals.- get_reduced_costs() and lp->duals now return also the reduced costs of the variables. It now returns an array of 1 + rows + columns elements.- get_reduced_costs() returned wrong values if integer variables were used.- Added routines calculate_sensitivity_duals, setpivrow, calculate_sensitivity_obj to calculated sensitivity analysis on reduced costs (lp->dualsfrom, lp->dualsto) and on objective function (lp->objfrom, lp->objto) This to provide post-optimal sensitivity analysis on the model.- Added members objfrom, objtill to lprec structure. These contain the from-till ranges of the object coefficients where the variables keep their values. This is part of post-optimal sensitivity analaysis.- Added new routine set_lp_name() to set the name of the lp problem. Should be used instead of manipulating lp->lp_name- Added a test to unscale_columns() if columns are already unscaled that nothing happens.- Added routine set_basis() to set an inititial base and get_basis() to get the base variables.- Added printing of ranges in write_LP()- Added routine write_lp(). This routines does the same as write_LP, but allows to specify the filename directly.- Corrected write_MPS() routine to make sure that column and row labels aren't printed outside of MPS field bounds (name max 8 characters). Longer names are truncated. This could result in duplicate names, so be careful if this happens.- Corrected write_MPS() routine to print only a BOUNDS section when at least one bound exists.- Added routine write_mps(). This routines does the same as write_MPS, but allows to specify the filename directly.- Added the new field sectimeout in lprec structure to specify a timeout. When solving takes longer than this timeout, the solver stops with a TIMEOUT return value.- Added the new field abort in lprec structure to specify an abort routine which is regularly called to check if the user didn't abort. This can be set via the new routine put_abortfunc()- Added the new field usermessage in lprec structure to specify a message routine which will be called by lp_solve so that the user can receive some messages from the algothm what it is doing. This can be set via the new put_msgfunc() routine. The following constants in lpkit.h can be used to specify what can be reported #define MSG_NONE 0 #define MSG_PRESOLVE 1 #define MSG_ITERATION 2 #define MSG_INVERT 4 #define MSG_LPFEASIBLE 8 #define MSG_LPEQUAL 16 #define MSG_LPBETTER 32 #define MSG_MILPFEASIBLE 64 #define MSG_MILPEQUAL 128 #define MSG_MILPBETTER 256 #define MSG_MILPSTRATEGY 512- Added some double precision calculations on critical points to improve numerical stability.- Improved branch-and-bound integer algorithm.- Improved lagrange solver.- Added several other improvements to the algorithm.- Extended check_solution routine to check if found solution is valid. This is only used for debugging purposes and only called when CHECK_SOLUTION is defined at compile time. Default it is not defined.- Extended floor_first member of lprec structure with a value AUTOMATIC (2) Used for integer optimization in branch-and-bound algorithm. - When set to FALSE (0), the algorithm will always choose the floor branch first. - When set to TRUE (1), the algorithm will always choose the ceiling branch first. - When set to AUTOMATIC (2), the algorithm will deside what branch to take first. This could lead to a faster solution time. The lp_solve executable supports this via the -c and -ca command line options.- Added a new member improve to the lprec structure. This is used internally by the algorithm for iterative improvement. The possible values can be: IMPROVE_NONE 0 IMPROVE_FTRAN 1 IMPROVE_BTRAN 2 IMPROVE_FULL (IMPROVE_FTRAN + IMPROVE_BTRAN); IMPROVE_NONE is the default.- Extended bb_rule in lprec structure.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -