⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 glpapi.h

📁 著名的大规模线性规划求解器源码GLPK.C语言版本,可以修剪.内有详细帮助文档.
💻 H
📖 第 1 页 / 共 2 页
字号:
      double coef; /* non-scaled */      /* objective coefficient at the structural variable */      GLPAIJ *ptr; /* non-scaled */      /* pointer to doubly linked list of constraint coefficients which         are placed in this column */      double sjj;      /* diagonal element s[j,j] of scaling matrix S for this column;         if the scaling is not used, s[j,j] is 1 */      int stat;      /* status of the structural variable:         GLP_BS - basic variable         GLP_NL - non-basic variable on lower bound         GLP_NU - non-basic variable on upper bound         GLP_NF - non-basic free variable         GLP_NS - non-basic fixed variable */      int bind;      /* if the structural variable is basic, head[bind] refers to         this column; otherwise, bind is 0; this attribute is valid only         if the basis factorization is valid */      double prim; /* non-scaled */      /* primal value of the structural variable in basic solution */      double dual; /* non-scaled */      /* dual value of the structural variable in basic solution */      double pval; /* non-scaled */      /* primal value of the structural variable in interior solution */      double dval; /* non-scaled */      /* dual value of the structural variable in interior solution */      double mipx; /* non-scaled */      /* primal value of the structural variable in integer solution */};struct GLPAIJ{     /* constraint coefficient a[i,j] */      GLPROW *row;      /* pointer to row, where this coefficient is placed */      GLPCOL *col;      /* pointer to column, where this coefficient is placed */      double val;      /* numeric (non-zero) value of this coefficient */      GLPAIJ *r_prev;      /* pointer to previous coefficient in the same row */      GLPAIJ *r_next;      /* pointer to next coefficient in the same row */      GLPAIJ *c_prev;      /* pointer to previous coefficient in the same column */      GLPAIJ *c_next;      /* pointer to next coefficient in the same column */};#include "glpk.h"/**********************************************************************/struct LPXCPS{     /* control parameters and statistics */      int msg_lev;      /* level of messages output by the solver:         0 - no output         1 - error messages only         2 - normal output         3 - full output (includes informational messages) */      int scale;      /* scaling option:         0 - no scaling         1 - equilibration scaling         2 - geometric mean scaling         3 - geometric mean scaling, then equilibration scaling */      int dual;      /* dual simplex option:         0 - use primal simplex         1 - use dual simplex */      int price;      /* pricing option (for both primal and dual simplex):         0 - textbook pricing         1 - steepest edge pricing */      double relax;      /* relaxation parameter used in the ratio test; if it is zero,         the textbook ratio test is used; if it is non-zero (should be         positive), Harris' two-pass ratio test is used; in the latter         case on the first pass basic variables (in the case of primal         simplex) or reduced costs of non-basic variables (in the case         of dual simplex) are allowed to slightly violate their bounds,         but not more than (relax * tol_bnd) or (relax * tol_dj) (thus,         relax is a percentage of tol_bnd or tol_dj) */      double tol_bnd;      /* relative tolerance used to check if the current basic solution         is primal feasible */      double tol_dj;      /* absolute tolerance used to check if the current basic solution         is dual feasible */      double tol_piv;      /* relative tolerance used to choose eligible pivotal elements of         the simplex table in the ratio test */      int round;      /* solution rounding option:         0 - report all computed values and reduced costs "as is"         1 - if possible (allowed by the tolerances), replace computed             values and reduced costs which are close to zero by exact             zeros */      double obj_ll;      /* lower limit of the objective function; if on the phase II the         objective function reaches this limit and continues decreasing,         the solver stops the search */      double obj_ul;      /* upper limit of the objective function; if on the phase II the         objective function reaches this limit and continues increasing,         the solver stops the search */      int it_lim;      /* simplex iterations limit; if this value is positive, it is         decreased by one each time when one simplex iteration has been         performed, and reaching zero value signals the solver to stop         the search; negative value means no iterations limit */      double tm_lim;      /* searching time limit, in seconds; if this value is positive,         it is decreased each time when one simplex iteration has been         performed by the amount of time spent for the iteration, and         reaching zero value signals the solver to stop the search;         negative value means no time limit */      int out_frq;      /* output frequency, in iterations; this parameter specifies how         frequently the solver sends information about the solution to         the standard output */      double out_dly;      /* output delay, in seconds; this parameter specifies how long         the solver should delay sending information about the solution         to the standard output; zero value means no delay */      int branch; /* MIP */      /* branching heuristic:         0 - branch on first variable         1 - branch on last variable         2 - branch using heuristic by Driebeck and Tomlin         3 - branch on most fractional variable */      int btrack; /* MIP */      /* backtracking heuristic:         0 - select most recent node (depth first search)         1 - select earliest node (breadth first search)         2 - select node using the best projection heuristic         3 - select node with best local bound */      double tol_int; /* MIP */      /* absolute tolerance used to check if the current basic solution         is integer feasible */      double tol_obj; /* MIP */      /* relative tolerance used to check if the value of the objective         function is not better than in the best known integer feasible         solution */      int mps_info; /* lpx_write_mps */      /* if this flag is set, the routine lpx_write_mps outputs several         comment cards that contains some information about the problem;         otherwise the routine outputs no comment cards */      int mps_obj; /* lpx_write_mps */      /* this parameter tells the routine lpx_write_mps how to output         the objective function row:         0 - never output objective function row         1 - always output objective function row         2 - output objective function row if and only if the problem             has no free rows */      int mps_orig; /* lpx_write_mps */      /* if this flag is set, the routine lpx_write_mps uses original         row and column symbolic names; otherwise the routine generates         plain names using ordinal numbers of rows and columns */      int mps_wide; /* lpx_write_mps */      /* if this flag is set, the routine lpx_write_mps uses all data         fields; otherwise the routine keeps fields 5 and 6 empty */      int mps_free; /* lpx_write_mps */      /* if this flag is set, the routine lpx_write_mps omits column         and vector names everytime if possible (free style); otherwise         the routine never omits these names (pedantic style) */      int mps_skip; /* lpx_write_mps */      /* if this flag is set, the routine lpx_write_mps skips empty         columns (i.e. which has no constraint coefficients); otherwise         the routine outputs all columns */      int lpt_orig; /* lpx_write_lpt */      /* if this flag is set, the routine lpx_write_lpt uses original         row and column symbolic names; otherwise the routine generates         plain names using ordinal numbers of rows and columns */      int presol; /* lpx_simplex */      /* LP presolver option:         0 - do not use LP presolver         1 - use LP presolver */      int binarize; /* lpx_intopt */      /* if this flag is set, the routine lpx_intopt replaces integer         columns by binary ones */      int use_cuts; /* lpx_intopt */      /* if this flag is set, the routine lpx_intopt tries generating         cutting planes:         LPX_C_COVER  - mixed cover cuts         LPX_C_CLIQUE - clique cuts         LPX_C_GOMORY - Gomory's mixed integer cuts         LPX_C_ALL    - all cuts */      double mip_gap; /* MIP */      /* relative MIP gap tolerance */};#define lpx_order_matrix _glp_1px_order_matrixvoid lpx_order_matrix(LPX *lp);/* order rows and columns of the constraint matrix */#define lpx_put_solution _glp_1px_put_solutionvoid lpx_put_solution(glp_prob *lp, int inval, const int *p_stat,      const int *d_stat, const double *obj_val, const int r_stat[],      const double r_prim[], const double r_dual[], const int c_stat[],      const double c_prim[], const double c_dual[]);/* store basic solution components */#define lpx_put_ipt_soln _glp_1px_put_ipt_solnvoid lpx_put_ipt_soln(LPX *lp, int t_stat, double row_pval[],      double row_dval[], double col_pval[], double col_dval[]);/* store interior-point solution components */#define lpx_put_mip_soln _glp_1px_put_mip_solnvoid lpx_put_mip_soln(LPX *lp, int i_stat, double row_mipx[],      double col_mipx[]);/* store mixed integer solution components */#define lpx_eval_b_prim _glp_1px_eval_b_primvoid lpx_eval_b_prim(LPX *lp, double row_prim[], double col_prim[]);/* compute primal basic solution components */#define lpx_eval_b_dual _glp_1px_eval_b_dualvoid lpx_eval_b_dual(LPX *lp, double row_dual[], double col_dual[]);/* compute dual basic solution components */#endif/* eof */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -