📄 changelog
字号:
The possible constants are now: FIRST_SELECT 0: Lowest indexed non-integer column RAND_SELECT 1: Random non-integer column WORST_SELECT 2: Largest deviation from an integer value BEST_SELECT 3: ??? MEDIAN_SELECT 4: Median value deviation from an integer value GREEDY_SELECT 5: ??? The constants FIRST_NI and RAND_NI are still defined for backward compatibility.- Extended solve exit codes: #define UNKNOWN -5 #define NOTRUN -4 #define USERABORT -3 #define TIMEOUT -2 #define IGNORED -1 #define OPTIMAL 0 #define MILP_FAIL 1 #define INFEASIBLE 2 #define UNBOUNDED 3 #define FAILURE 4 #define RUNNING 5 /* lag_solve extra status values */ #define FEAS_FOUND 6 #define NO_FEAS_FOUND 7 #define BREAK_BB 8- The lp_solve command line program is modified to handle the new functionality of version 4 and there are also some bug fixes. Following thing have changed: - If a file name was provided to the command line then it was ignored when data is read from an lp-file (-mps option not provied). Input was still read from stdin instead. This is now solved. - -min and -max options were accepted, but ignored. Corrected. - Option -v is extended with a number to specify a verbose level. See description above of verbose member in lprec structure for possible values. For example -v4 indicates verbose level 4. When only -v is specified, thus with a number, then verbose level NORMAL (4) is used. If the option is not provided, then SEVERE (2) is used. - A new option -lp is added to indicate that the input file is lp. This is the default if neither -lp or -mps is specified. - A new option -presolve is added to enable presolving. - A new option -S is added to specify how much of the solution must be outputed. This option has an optional number: -S0: Print nothing -S1: Only objective value -S2: Objective value + variables (default) -S3: Objective value + variables + constraints -S4: Objective value + variables + constraints + duals -S5: Objective value + variables + constraints + duals + lp model -S6: Objective value + variables + constraints + duals + lp model + lp scales If only -S is specified then -S2 is used. Until version 3 this was controled with the -v option. It was an al or nothing flag which also resulted in printing details of the algorithm. This new option allows to specify more detailed what is wanted. - Option -trej - option -improve to specify an iterative improvement level. - Option -ca: sets lp->floor_first to automatic - Option -s is extended with an optional mode -s0: Numerical range-based scaling (default) -s1: Geometric scaling -s2: Curtis-reid scaling - New option -sp This option only makes sense if -s option was used. It specifies that scales must be power of two. Can improve numerical stability. - New option -sl enables Lagragrange scaling. - New option -si enables Integer scaling.- Following is a list of new functions which can be called: void lp_solve_version(int *majorversion, int *minorversion, int *release, int *build); void set_magic(int code, int param); lprec *read_LP(char *input, short verbose, char *lp_name); void set_uprange(lprec *lp, int row, REAL value); void set_lowrange(lprec *lp, int row, REAL value); short is_int(lprec *lp, int column); void set_semicont(lprec *lp, int column, short must_be_sc); short is_semicont(lprec *lp, int column); int add_SOS(lprec *lp, char *name, short sostype, int priority, int count, int *sosvars, REAL *weights); short is_SOS_var(lprec *lp, int column); int set_lp_name(lprec *lp, char *name); REAL get_rh(lprec *lp, int row); void set_rh_range(lprec *lp, int row, REAL deltavalue); REAL get_rh_range(lprec *lp, int row); short get_constr_type(lprec *lp, int row); char *get_row_name(lprec *lp, int row); char *get_col_name(lprec *lp, int column); REAL scale(lprec *lp, REAL *myrowscale, REAL *mycolscale); int scaleCR(lprec *lp); void set_basis(lprec *lp, int *bascolumn); void get_basis(lprec *lp, int *bascolumn); lprec *read_MPS(char *input, short verbose); int write_mps(lprec *lp, char *output); int write_lp(lprec *lp, char *output); void print_objective(lprec *lp); void print_constraints(lprec *lp); int print_file(char *filename);- Following functions now return a status if they succeeded or not. The returnvalue should always be checked. TRUE is ok, FALSE is not ok int set_mat(lprec *lp, int row, int column, REAL value); int set_obj_fn(lprec *lp, REAL *row); int str_set_obj_fn(lprec *lp, char *row); int add_constraint(lprec *lp, REAL *row, short constr_type, REAL rh); int str_add_constraint(lprec *lp, char *row_string ,short constr_type, REAL rh); int add_lag_con(lprec *lp, REAL *row, short con_type, REAL rhs); int str_add_lag_con(lprec *lp, char *row, short con_type, REAL rhs); int add_column(lprec *lp, REAL *column); int str_add_column(lprec *lp, char *col_string); int str_set_rh_vec(lprec *lp, char *rh_string); int set_col_name(lprec *lp, int column, char *new_name); int write_MPS(lprec *lp, FILE *output); int write_LP(lprec *lp, FILE *output);- write_MPS, write_mps is enhanced. The COLUMNS, RHS, RANGES sections now also use columns 40-47 and 50-61 to write the data. This results in smaller MPS files. The routines also write SOS and SC data.Changes for 4.0.1.0- Added in each header file (*.h) a condition so that each file is parsed only once. Some compilers give errors otherwise.- Renamed structure hashtable to hashstruct. This because some compilers give errors because this name is already used in one of its header files.- lookup of matrix elements is now considerably faster thanks to a binary search algorithm. This affects set_matrix(), get_mat_raw(), get_mat() Especially for larger problems the effect should be considerable.- Following routines now return an integer value instead of void to indicate if they succeeded or not. return value FALSE is failure and TRUE is success: del_constraint(), del_column(), set_upbo(), set_lowbo(), set_bounds(), set_uprange(), set_lowrange(), set_int(), set_semicont(), set_rh(), set_rh_range(), set_constr_type(), get_row(), get_column(), mult_column(), get_reduced_costs()- Following new routines are added to allow to access data without having to access the lprec structure. This makes it less release dependent and sertainly less language dependent. It is advised to use these routine as much as possible and only to read/write in the lprec structure when nothing else is possible: set_verbose(), get_verbose(), set_timeout(), put_abortfunc(), put_logfunc(), put_msgfunc(), set_print_duals, is_print_duals(), set_print_sol(), is_print_sol(), set_debug(), is_debug(), set_print_at_invert(), is_print_at_invert(), set_trace(), is_trace(), set_anti_degen(), is_anti_degen(), set_do_presolve(), is_do_presolve(), set_max_num_inv(), get_max_num_inv(), set_bb_rule(), get_bb_rule(), set_obj_bound(), get_obj_bound(), set_floor_first(), get_floor_first(), set_infinite(), get_infinite(), set_epsilon(), get_epsilon(), set_epsb(), get_epsb(), set_epsd(), get_epsd(), set_epsel(), get_epsel(), set_scalemode(), get_scalemode(), set_improve(), is_improve(), set_lag_trace(), is_lag_trace(), set_piv_rule(), get_piv_rule(), set_break_at_first(), is_break_at_first(), set_bb_floorfirst(), is_bb_floorfirst(), set_break_at_value(), get_break_at_value(), set_negrange(), get_negrange(), set_epsperturb(), get_epsperturb(), set_epspivot(), get_epspivot(), get_max_level(), get_total_nodes(), get_total_iter(), get_objective(), get_Nrows(), get_Ncolumns(), get_variables(), get_ptr_variables(), get_constraints(), get_ptr_constraints(), get_sensitivity_rhs(), get_ptr_sensitivity_rhs(), get_sensitivity_obj(), get_ptr_sensitivity_obj() Note that routines get_variables(), get_constraints(), get_sensitivity_rhs(), get_sensitivity_obj() return with a copy of the values and that the provided variable arrays must already be allocated. These routines are especially ment to be called from other languages via a dll. When the library is called from C, then the get_ptr_ routines will be preferred by most users since they don't need extra memory. They just return a pointer.- With the routines set_timeout(), get_timeout() it is possible to set a timeout in seconds. This makes it possible to interrupt a calculation after a specific time.- With the routine put_abortfunc it is possible to set a abort routine. This routine will be called frequently. The user can add any logic he wants in this routine and its returnvalue determines if the process should be aborted or not. The normal returnvalue of this routine must be 0 and to abort <> 0.- set_upbo(), set_lowbo(), set_bounds(), set_uprange(), set_lowrange() no longer complain about setting bounds smaller than the lower bound or larger than the upper bound. The values are just accepted. However when the model is optimized, the isvalid() routine is called and there the bounds are checked. If there is a lower bound larger than its upper bound then this is reported there and the model is not optimized. Another change is that the routines also accept and apply bounds which are less restrictive then previous set bounds. Previously these new bounds were ignored. Ifthe old behaviour is still needed then the caller must check this. This change allows to temporary set incorrect bounds.- lp_solve.1 is updated.- Changed demo.c and lp_solve.c to use new routines on places where lpstruct structure was accessed. This makes them less release dependent.- When compiled as a windows DLL, following routines are now also available: set_verbose(), get_verbose(), set_timeout(), get_timeout(), set_print_duals(), is_print_duals(), set_print_sol(), is_print_sol(), set_debug(), is_debug(), set_print_at_invert(), is_print_at_invert(), set_trace(), is_trace(), set_anti_degen(), is_anti_degen(), set_do_presolve(), is_do_presolve(), set_bb_rule(), get_bb_rule(), set_obj_bound(), get_obj_bound(), set_floor_first(), get_floor_first(), set_infinite(), get_infinite(), set_epsilon(), get_epsilon(), set_epsb(), get_epsb(), set_epsd(), get_epsd(), set_epsel(), get_epsel(), set_scalemode(), get_scalemode(), set_improve(), is_improve(), set_lag_trace(), is_lag_trace(), set_piv_rule(), get_piv_rule(), set_break_at_first(), is_break_at_first(), set_bb_floorfirst(), is_bb_floorfirst(), set_break_at_value(), get_break_at_value(), set_negrange(), get_negrange(), set_epsperturb(), get_epsperturb(), set_epspivot(), get_epspivot(), get_max_level(), get_total_nodes(), get_total_iter(), get_objective(), get_variables(), get_constraints(), get_Nrows(), get_Ncolumns(), put_abortfunc(), put_logfunc(), put_msgfunc()
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -