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

📄 glpios.h

📁 著名的大规模线性规划求解器源码GLPK.C语言版本,可以修剪.内有详细帮助文档.
💻 H
📖 第 1 页 / 共 2 页
字号:
      /* the sum of integer infeasibilities */      void *data; /* char data[tree->cb_size]; */      /* pointer to the application-specific data */      IOSNPD *temp;      /* auxiliary pointer used by some routines */      IOSNPD *prev;      /* pointer to previous subproblem in the active list */      IOSNPD *next;      /* pointer to next subproblem in the active list */};struct IOSBND{     /* bounds change entry */      int k;      /* ordinal number of corresponding row (1 <= k <= m) or column         (m+1 <= k <= m+n), where m and n are the number of rows and         columns, resp., in the parent subproblem */      int type;      /* new type */      double lb;      /* new lower bound */      double ub;      /* new upper bound */      IOSBND *next;      /* pointer to next entry for the same subproblem */};struct IOSTAT{     /* status change entry */      int k;      /* ordinal number of corresponding row (1 <= k <= m) or column         (m+1 <= k <= m+n), where m and n are the number of rows and         columns, resp., in the parent subproblem */      int stat;      /* new status */      IOSTAT *next;      /* pointer to next entry for the same subproblem */};struct IOSROW{     /* row (cut) addition entry */      char *name;      /* row name or NULL */#if 1 /* 20/IX-2008 */      unsigned char origin;      unsigned char klass;#endif      int type;      /* row type */      double lb;      /* row lower bound */      double ub;      /* row upper bound */      IOSAIJ *ptr;      /* pointer to the coefficient list */      double rii;      /* row scale factor */      int stat;      /* row status */      IOSROW *next;      /* pointer to next entry for the same subproblem */};struct IOSAIJ{     /* constraint coefficient */      int j;      /* column number */      double val;      /* coefficient value */      IOSAIJ *next;      /* pointer to next coefficient for the same row */};struct IOSPOOL{     /* cut pool */      int size;      /* pool size = number of cuts in the pool */      IOSCUT *head;      /* pointer to the first cut row */      IOSCUT *tail;      /* pointer to the last cut row */      int ord;      /* ordinal number of the current cut row, 1 <= ord <= size */      IOSCUT *curr;      /* pointer to the current cut row */};struct IOSCUT{     /* cut row (cutting plane constraint) */#if 1 /* 20/IX-2008 */      char *name;      unsigned char klass;#endif      IOSAIJ *ptr;      /* pointer to the list of row coefficients */      int type;      /* row type:         GLP_LO: sum a[j] * x[j] >= b         GLP_UP: sum a[j] * x[j] <= b         GLP_FX: sum a[j] * x[j]  = b */      double rhs;      /* row right-hand side */      IOSCUT *prev;      /* pointer to the previous cut row */      IOSCUT *next;      /* pointer to the next cut row */};struct IOSRIB{     /* conflict edge addition entry */      int j1;      /* first variable number (j1 < 0 means complement) */      int j2;      /* second variable number (j2 < 0 means complement) */      SCGRIB *e;      /* pointer to the edge descriptor (NULL means the edge is missing         in the current graph) */      IOSRIB *next;      /* pointer to next entry for the same subproblem */};#define ios_create_tree _glp_ios_create_treeglp_tree *ios_create_tree(glp_prob *mip, const glp_iocp *parm);/* create branch-and-bound tree */#define ios_revive_node _glp_ios_revive_nodevoid ios_revive_node(glp_tree *tree, int p);/* revive specified subproblem */#define ios_freeze_node _glp_ios_freeze_nodevoid ios_freeze_node(glp_tree *tree);/* freeze current subproblem */#define ios_clone_node _glp_ios_clone_nodevoid ios_clone_node(glp_tree *tree, int p, int nnn, int ref[]);/* clone specified subproblem */#define ios_delete_node _glp_ios_delete_nodevoid ios_delete_node(glp_tree *tree, int p);/* delete specified subproblem */#define ios_delete_tree _glp_ios_delete_treevoid ios_delete_tree(glp_tree *tree);/* delete branch-and-bound tree */#define ios_eval_degrad _glp_ios_eval_degradvoid ios_eval_degrad(glp_tree *tree, int j, double *dn, double *up);/* estimate obj. degrad. for down- and up-branches */#define ios_round_bound _glp_ios_round_bounddouble ios_round_bound(glp_tree *tree, double bound);/* improve local bound by rounding */#define ios_is_hopeful _glp_ios_is_hopefulint ios_is_hopeful(glp_tree *tree, double bound);/* check if subproblem is hopeful */#define ios_best_node _glp_ios_best_nodeint ios_best_node(glp_tree *tree);/* find active node with best local bound */#define ios_relative_gap _glp_ios_relative_gapdouble ios_relative_gap(glp_tree *tree);/* compute relative mip gap */#define ios_solve_node _glp_ios_solve_nodeint ios_solve_node(glp_tree *tree);/* solve LP relaxation of current subproblem */#define ios_create_pool _glp_ios_create_poolIOSPOOL *ios_create_pool(glp_tree *tree);/* create cut pool */#define ios_add_row _glp_ios_add_rowint ios_add_row(glp_tree *tree, IOSPOOL *pool,      const char *name, int klass, int flags, int len, const int ind[],      const double val[], int type, double rhs);/* add row (constraint) to the cut pool */#define ios_find_row _glp_ios_find_rowIOSCUT *ios_find_row(IOSPOOL *pool, int i);/* find row (constraint) in the cut pool */#define ios_del_row _glp_ios_del_rowvoid ios_del_row(glp_tree *tree, IOSPOOL *pool, int i);/* remove row (constraint) from the cut pool */#define ios_clear_pool _glp_ios_clear_poolvoid ios_clear_pool(glp_tree *tree, IOSPOOL *pool);/* remove all rows (constraints) from the cut pool */#define ios_delete_pool _glp_ios_delete_poolvoid ios_delete_pool(glp_tree *tree, IOSPOOL *pool);/* delete cut pool */#define ios_add_edge _glp_ios_add_edgevoid ios_add_edge(glp_tree *tree, int j1, int j2);/* add new edge to the conflict graph */#define ios_preprocess_node _glp_ios_preprocess_nodeint ios_preprocess_node(glp_tree *tree, int max_pass);/* preprocess current subproblem */#define ios_driver _glp_ios_driverint ios_driver(glp_tree *tree);/* branch-and-bound driver *//**********************************************************************/typedef struct IOSVEC IOSVEC;struct IOSVEC{     /* sparse vector v = (v[j]) */      int n;      /* dimension, n >= 0 */      int nnz;      /* number of non-zero components, 0 <= nnz <= n */      int *pos; /* int pos[1+n]; */      /* pos[j] = k, 1 <= j <= n, is position of (non-zero) v[j] in the         arrays ind and val, where 1 <= k <= nnz; pos[j] = 0 means that         v[j] is structural zero */      int *ind; /* int ind[1+n]; */      /* ind[k] = j, 1 <= k <= nnz, is index of v[j] */      double *val; /* double val[1+n]; */      /* val[k], 1 <= k <= nnz, is a numeric value of v[j] */};#define ios_create_vec _glp_ios_create_vecIOSVEC *ios_create_vec(int n);/* create sparse vector */#define ios_check_vec _glp_ios_check_vecvoid ios_check_vec(IOSVEC *v);/* check that sparse vector has correct representation */#define ios_get_vj _glp_ios_get_vjdouble ios_get_vj(IOSVEC *v, int j);/* retrieve component of sparse vector */#define ios_set_vj _glp_ios_set_vjvoid ios_set_vj(IOSVEC *v, int j, double val);/* set/change component of sparse vector */#define ios_clear_vec _glp_ios_clear_vecvoid ios_clear_vec(IOSVEC *v);/* set all components of sparse vector to zero */#define ios_clean_vec _glp_ios_clean_vecvoid ios_clean_vec(IOSVEC *v, double eps);/* remove zero or small components from sparse vector */#define ios_copy_vec _glp_ios_copy_vecvoid ios_copy_vec(IOSVEC *x, IOSVEC *y);/* copy sparse vector (x := y) */#define ios_linear_comb _glp_ios_linear_combvoid ios_linear_comb(IOSVEC *x, double a, IOSVEC *y);/* compute linear combination (x := x + a * y) */#define ios_delete_vec _glp_ios_delete_vecvoid ios_delete_vec(IOSVEC *v);/* delete sparse vector *//**********************************************************************/#define ios_gmi_gen _glp_ios_gmi_genvoid ios_gmi_gen(glp_tree *tree);/* generate Gomory's mixed integer cuts */#define ios_mir_init _glp_ios_mir_initvoid *ios_mir_init(glp_tree *tree);/* initialize MIR cut generator */#define ios_mir_gen _glp_ios_mir_genvoid ios_mir_gen(glp_tree *tree, void *gen);/* generate MIR cuts */#define ios_mir_term _glp_ios_mir_termvoid ios_mir_term(void *gen);/* terminate MIR cut generator */#define ios_cov_gen _glp_ios_cov_genvoid ios_cov_gen(glp_tree *tree);/* generate mixed cover cuts */#define ios_clq_init _glp_ios_clq_initvoid *ios_clq_init(glp_tree *tree);/* initialize clique cut generator */#define ios_clq_gen _glp_ios_clq_genvoid ios_clq_gen(glp_tree *tree, void *gen);/* generate clique cuts */#define ios_clq_term _glp_ios_clq_termvoid ios_clq_term(void *gen);/* terminate clique cut generator */#define ios_pcost_branch _glp_ios_pcost_branchvoid ios_pcost_branch(glp_tree *tree);/* choose branching variable using hybrid pseudocost technique */#define ios_pcost_free _glp_ios_pcost_freevoid ios_pcost_free(glp_tree *tree);/* free working area used on pseudocost branching */#endif/* eof */

⌨️ 快捷键说明

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