DyLP  1.10.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
dy_consys.h
Go to the documentation of this file.
1 /*
2  This file is a portion of the Dylp LP distribution.
3 
4  Copyright (C) 2005 -- 2007 Lou Hafer
5 
6  School of Computing Science
7  Simon Fraser University
8  Burnaby, B.C., V5A 1S6, Canada
9  lou@cs.sfu.ca
10 
11  This code is licensed under the terms of the Eclipse Public License (EPL).
12 */
13 
14 #ifndef _CONSYS_H
15 #define _CONSYS_H
16 
17 /*
18  @(#)dy_consys.h 4.4 11/11/04
19  svn/cvs: $Id: dy_consys.h 407 2010-12-31 20:48:48Z lou $
20 
21  This header file contains declarations for a constraint system data
22  structure, tailored for LP-based branch-and-cut MILP algorithms (more
23  generally, for any situation where dynamic change in the number of rows
24  and/or columns is expected). The constraint system allows for arbitrary
25  additions and deletions. Additional space is allocated as needed; there are
26  no a priori limits. Allocated space is never reduced, however, short of
27  destroying the constraint system.
28 
29  The coefficient matrix is implemented as a sparse structure, linked by row
30  and by column. Access to the rows and columns of the coefficient matrix is
31  via utility routines.
32 
33  To provide O(1) cost for row and column addition and deletion, while
34  maintaining a dense index set, the hole left by deleting a row or column
35  is filled by moving the last row or column to occupy the vacant index slot.
36 
37  The client can 'attach' row and column vectors to the constraint system;
38  more precisely, vectors and multiple pointers to those vectors. The
39  vectors will be dynamically resized and pointers updated whenever rows
40  or columns are added to the constraint system. Entries in attached vectors
41  are automatically reordered when a row or column is moved to fill the hole
42  left by a deletion.
43 
44  The user is expected to work directly with any attached vectors; there are
45  no special access routines.
46 
47  Because rows and columns can move, clients must be careful when they keep
48  records of row or column indices, and update these records as necessary.
49 
50  A special set of attached vectors are referred to as associated vectors.
51  These are distinguished only by having pointers allocated in the constraint
52  system header structure.
53 
54  NOTE: The package assumes that variables and constraints are indexed from
55  1; this makes error checking a lot more reliable, particularly for
56  errors of omission (whoops, forgot to set that index ... ). Vectors
57  intended for expanded rows or columns must be sized accordingly.
58  (I.e., if vector is to hold k values, the actual allocated space
59  is k+1 entries, with vector[0] unused.) consys will do this
60  automatically when asked to allocate space. Clients must remember
61  this when allocating space for vectors that they will attach to a
62  constraint system.
63 
64  NOTE: The constraint system is prepared to deal with both finite (most
65  often DBL_MAX) and infinite (IEEE) infinity in the upper and lower
66  bounds vectors for variables (vlb, vub). Explicit checks are
67  necessary to maintain the value of a finite infinity when scaling the
68  constraint system. The value of infinity must be supplied as a
69  parameter to create_consys(). It's not a good idea to have infinity
70  popping up elsewhere, but IEEE infinity should work (because no
71  explicit checks are required for mathematical correctness).
72 
73  NOTE: At the infinitesimal end, any coefficient with absolute value less
74  than 1.0e-20 will be dropped. Currently this is hardwired (see
75  consys_create). It may change if there's a need.
76 */
77 
78 #include "dy_vector.h"
79 
80 
81 
82 /*
83  Constraint coefficient matrix
84 
85  This is a sparse-matrix data structure, linked by row and column.
86 
87  Note that rows and columns are << not >> sorted in index order. Insertions
88  and deletions are done adjacent to the headers, for efficiency.
89 */
90 /*
91  Coefficients
92 
93  Field Description
94  ----- -----------
95  rowhdr The row header for this coefficient.
96  colhdr The column header for this coefficient.
97  val The value of this coefficient.
98  rownxt The next coefficient in this row.
99  colnxt The next coefficient in this column.
100 */
101 
102 typedef struct coeff_struct_tag
105  double val ;
108 
109 /*
110  Column headers
111 
112  Field Description
113  ----- -----------
114  ndx The index of this column.
115  len The number of coefficients in the column.
116  nme The name of the variable associated with the column.
117  coeffs The coefficients of the column.
118 */
119 
120 typedef struct colhdr_struct_tag
121 { int ndx ;
122  int len ;
123  const char *nme ;
125 
126 /*
127  Row headers
128 
129  Field Description
130  ----- -----------
131  ndx The index of this row.
132  len The number of coefficients in the row.
133  nme The name of the variable associated with the row.
134  coeffs The coefficients of the row.
135 */
136 
137 typedef struct rowhdr_struct_tag
138 { int ndx ;
139  int len ;
140  const char *nme ;
142 
143 /*
144  Coefficient matrix header
145 
146  Field Definition
147  ----- ---------
148  coeffcnt The number of coefficients in the matrix.
149  cols Array of pointers to column headers.
150  rows Array of pointers to row headers.
151 */
152 
153 typedef struct
154 { int coeffcnt ;
157 
158 
159 
160 /*
161  Attached Vectors:
162 
163  As mentioned at the top, attached vectors are automatically resized whenever
164  the constraint system is resized, and reorderd to track the movement of rows
165  and columns due to deletions.
166 
167  A particular subset of attached vectors are designated as associated
168  vectors; a system has at most one of each type of associated vector.
169  Their only distinguishing characteristic is that they occupy the dedicated
170  pointers in the constraint system header:
171  * objective function
172  * variable type <3>
173  * variable upper & lower bounds
174  * right-hand-side (a.k.a. rhs or b) and rhsl (a.k.a. rhslow or blow) <1>
175  * constraint type
176  * upper & lower bounds for constraint left-hand-sides <2>
177  * row and column scaling vectors (more accurately, the diagonal elements
178  of row and column scaling matrices)
179 
180  <1> rhsl is created when range constraints (blow <= ax <= b) are present
181  in the constraint system.
182  <2> These are calculated using the upper and lower bounds on the variables
183  in the constraint, and are used in arc consistency calculations. See
184  further explanation below.
185  <3> Arguably the variable type vector only needs to cover the architectural
186  variables, but it'd be a pain to distinguish a resize involving the
187  architectural columns from a resize involving the logical columns.
188  Easier to waste a little space.
189 
190  The flags given below are used in attached vector headers to indicate
191  how a vector should be handled, and in the consys_struct.parts field to
192  indicate which components of the constraint system are present. Their
193  most important function is to specify whether a vector is a row vector
194  or a column vector. Beyond that, they serve as weak consistency and type
195  checks.
196 
197  Notes:
198  * MTX, ROWHDR, and COLHDR cannot be allocated/deallocated, but having
199  codes for them makes the interface to some of the utility routines a
200  bit more uniform.
201  * COL and ROW should be used for generic column and row vectors,
202  respectively.
203  * VUB is initialised to +infinity.
204  * RSCALE and CSCALE are initialised to 1.0
205  * VTYP and CTYP are tied to the vartyp_enum and contyp_enum types.
206 */
207 
208 #define CONSYS_MTX ((flags) 1<<0)
209 #define CONSYS_ROW ((flags) 1<<1)
210 #define CONSYS_COL ((flags) 1<<2)
211 #define CONSYS_OBJ ((flags) 1<<3)
212 #define CONSYS_VUB ((flags) 1<<4)
213 #define CONSYS_VLB ((flags) 1<<5)
214 #define CONSYS_RHS ((flags) 1<<6)
215 #define CONSYS_CUB ((flags) 1<<7)
216 #define CONSYS_CLB ((flags) 1<<8)
217 #define CONSYS_RHSLOW ((flags) 1<<9)
218 #define CONSYS_VTYP ((flags) 1<<10)
219 #define CONSYS_CTYP ((flags) 1<<11)
220 #define CONSYS_COLHDR ((flags) 1<<12)
221 #define CONSYS_ROWHDR ((flags) 1<<13)
222 #define CONSYS_RSCALE ((flags) 1<<14)
223 #define CONSYS_CSCALE ((flags) 1<<15)
224 
225 /*
226  Macros to identify row and column vectors.
227 */
228 #define CONSYS_ROWVEC \
229  (CONSYS_OBJ|CONSYS_VUB|CONSYS_VLB|CONSYS_VTYP|CONSYS_CSCALE| \
230  CONSYS_COLHDR|CONSYS_ROW)
231 
232 #define CONSYS_COLVEC \
233  (CONSYS_RHS|CONSYS_RHSLOW|CONSYS_CUB|CONSYS_CLB|CONSYS_CTYP|CONSYS_RSCALE| \
234  CONSYS_ROWHDR|CONSYS_COL)
235 
236 /*
237  A macro to check for a valid vector type.
238 */
239 
240 #define VALID_ATTVTYPE(zz_vectype_zz) \
241  (zz_vectype_zz == CONSYS_OBJ || \
242  zz_vectype_zz == CONSYS_VUB || zz_vectype_zz == CONSYS_VLB || \
243  zz_vectype_zz == CONSYS_RHS || zz_vectype_zz == CONSYS_RHSLOW || \
244  zz_vectype_zz == CONSYS_CUB || zz_vectype_zz == CONSYS_CUB || \
245  zz_vectype_zz == CONSYS_VTYP || zz_vectype_zz == CONSYS_CTYP || \
246  zz_vectype_zz == CONSYS_RSCALE || zz_vectype_zz == CONSYS_CSCALE || \
247  zz_vectype_zz == CONSYS_ROW || zz_vectype_zz == CONSYS_COL)
248 
249 
250 /*
251  Attached vector header
252 
253  This structure is used in the list of attached vectors that should be
254  checked and resized with the constraint system.
255 
256  Field Definition
257  ----- ----------
258  nxt List link.
259  what The type of vector (coded with the flag values for
260  attached and associated vectors)
261  elsze The size of an element in the vector.
262  vec The address of the vector.
263  pveclst A list of addresses which hold pointers to vec. If vec is
264  moved as a result of a resize, these are rewritten.
265 */
266 
267 typedef struct attvhdr_struct_tag { struct attvhdr_struct_tag *nxt ;
269  int elsze ;
270  void *vec ;
272 
273 /*
274  Constraint bounds
275 
276  Constraint bounds are upper and lower bounds on the value of the
277  left-hand-side of a constraint, calculated using the upper and lower bounds
278  on variables. In the case where all variables have finite bounds, the
279  constraint bound will also be finite, and things are straightforward. But
280  there's a complication --- we'll want to be able to efficiently handle the
281  case where all variables have finite bounds except one, x<t>. In this case
282  we can calculate a finite bound for the free variable, using the bounds on
283  the other variables. Bottom line is we need a structure that keeps count of
284  the number of infinities, as well as the finite portion of the bound. See
285  consistency.c for more about the mechanics of particular cases.
286 
287  The interpretation of an entry is as follows:
288  -varcnt <= inf < 0 inf is the negative of the index of the single
289  remaining variable contributing an infinity; bnd is
290  the finite lhs bound calculated from the other
291  variables of the constraint
292  inf >= 0 inf is the number of variables contributing infinity
293  to the bound; bnd is the value of the finite portion
294  of the lhs bound. If inf == 0, the lhs bound is finite.
295 
296  inf < -varcnt and inf = 1 are invalid. A value which exceeds the number of
297  variables in the constraint is also bogus.
298 
299  This encoding means that it's impossible to distinguish +inf and -inf just
300  by looking at the bound. But, in the case of constraint bounds, this hasn't
301  been a problem in practice. Lower bounds go to -inf, and upper bounds go to
302  +inf, and context has been sufficient.
303 
304  The revs field is used to keep track of the number of times the bound has
305  been revised. See milp.h:mipopts_struct for the recalculation frequency.
306 */
307 
308 typedef struct { int revs ;
309  int inf ;
310  double bnd ; } conbnd_struct ;
311 
312 
313 
314 /*
315  Constraint type codes
316 
317  These codes have their origin in the MPS input standard.
318 
319  contypINV invalid
320  contypNB non-binding constraint <1>
321  contypGE >= inequality
322  contypEQ equality
323  contypLE <= inequality
324  contypRNG 'range' constraint, lb <= ax <= ub (a sort of shorthand for
325  a >= and a <= inequality)
326 
327  <1> Non-binding constraints are a bit odd. They are used in two ways.
328  The first non-binding constraint in the MPS file is, by convention,
329  the objective function. The other use for non-binding constraints is
330  in rows of type Dx (x one of N, E, G, or L), which specify linear
331  combinations of constraints.
332  <2> Following OSL (a good lead to follow when they're going where I want to
333  go :-), bonsai doesn't accept Dx rows, and throws away all but the
334  first non-binding constraint, which it keeps only if it needs it for
335  the objective function.
336 */
337 
338 typedef enum { contypINV = 0, contypNB,
340 
341 #define VALID_CONTYPE(zz_ctyp_zz) \
342  (zz_ctyp_zz == contypGE || zz_ctyp_zz == contypEQ || \
343  zz_ctyp_zz == contypLE || zz_ctyp_zz == contypRNG)
344 
345 /*
346  Variable type codes
347 
348  vartypINV invalid
349  vartypCON continuous variable
350  vartypINT general integer variable
351  vartypBIN binary variable
352 */
353 
354 typedef enum { vartypINV = 0, vartypCON,
356 
357 #define VALID_VARTYPE(zz_vtyp_zz) \
358  (zz_vtyp_zz == vartypCON || \
359  zz_vtyp_zz == vartypINT || \
360  zz_vtyp_zz == vartypBIN)
361 
362 #define INT_VARTYPE(zz_vtyp_zz) \
363  (zz_vtyp_zz == vartypINT || \
364  zz_vtyp_zz == vartypBIN)
365 
366 /*
367  Behavioural options
368 
369  These codes are used as flags in the opts field of the constraint system
370  header.
371 
372  CONSYS_LVARS Set to indicate that logical variables are present and should
373  be automatically maintained during constraint system
374  manipulations.
375  CONSYS_WRNZERO Set to indicate that a warning should be issued when the
376  constraint system utility routines encounter a zero-length
377  column or row. Also causes a warning during row/column
378  creation and basis initialisation if an explicit zero
379  coefficient is encountered.
380  CONSYS_WRNATT Set to indicate that a warning should be issued when a
381  duplicate attach request is encountered (i.e., both the
382  vector and the pointer to the vector are already on the
383  attvecs list).
384  CONSYS_FININF `Finite infinity' --- the client is indulging in the common
385  trick of using a large finite value (most often, DBL_MAX) as
386  infinity.
387  CONSYS_CORRUPT The constraint system is corrupt --- an error has occurred
388  during construction or modification that caused an operation
389  to abort. Currently set only for errors that occur outside of
390  debug and paranoia (you're supposed to look at the error
391  messages for paranoia and debug).
392 */
393 
394 #define CONSYS_LVARS ((flags) 1<<0)
395 #define CONSYS_WRNZERO ((flags) 1<<1)
396 #define CONSYS_WRNATT ((flags) 1<<2)
397 #define CONSYS_FININF ((flags) 1<<3)
398 #define CONSYS_CORRUPT ((flags) 1<<4)
399 
400 /*
401  Constraint system header
402 
403  The top-level 'handle' for the structure.
404 
405  Field Definition
406  ----- ---------
407  nme The name assigned to this constraint system.
408  parts Flags indicating which components of the constraint system are
409  supposed to be present.
410  opts Flags indicating various behavioural options.
411  inf The value of infinity.
412  tiny The value of the infinitesimal.
413  varcnt The total number of variables (and the column dimension).
414  archvcnt The number of architectural variables. The number of continuous
415  architectural variables is archvcnt-(intvcnt+binvcnt).
416  logvcnt The number of logical variables.
417  intvcnt The number of general integer variables.
418  binvcnt The number of binary variables.
419  maxcollen The number of coefficients in the largest column.
420  maxcolndx The index of the largest column.
421  concnt The total number of constraints (and the row dimension).
422  archccnt The number of architectural constraints.
423  cutccnt The number of cut constraints.
424  maxrowlen The number of coefficients in the largest row.
425  maxrowndx The index of the largest row.
426  colsze The allocated column capacity for the constraint system.
427  rowsze The allocated row capacity for the constraint system.
428  mtx The constraint matrix header.
429 
430  The vectors rowscale and colscale are valid only after execution of one
431  of the scaling routines consys_geomscale, consys_equiscale, or
432  consys_applyscale. The fields maxaij and minaij are valid only after
433  execution of consys_evalsys or any of the scaling routines.
434 
435  maxaij max{i,j} |a<ij>| (valid only after scaling)
436  minaij min{i,j, a<ij> != 0} |a<ij>| (valid only after scaling)
437  rowscale The row scaling vector.
438  colscale The column scaling vector.
439 
440  objnme The name of the objective function.
441  objndx Index of the objective function, if it's installed as a
442  constraint cx - x<z> = 0.
443  xzndx Index of the variable x<z>.
444  obj The objective function.
445  vtyp The type of variable.
446  vub The upper bounds for variables.
447  vlb The lower bounds for variables.
448  rhs The right-hand-side vector.
449  rhslow blow for range constraints of form blow <= ax <= b.
450  ctyp The type of constraint (contyp_enum).
451  cub The upper bounds for constraint left-hand-sides.
452  clb The lower bounds for constraint left-hand sides.
453  attvecs The list of attached vectors.
454 
455  NOTE the distinction between dimension and size -- the allocated capacity
456  of the constraint system is [rowsze x colsze], while the actual size
457  of the constraint system is [concnt x varcnt].
458 */
459 
460 typedef struct
461 { const char *nme ;
464  double inf ;
465  double tiny ;
466  int varcnt ;
467  int archvcnt ;
468  int logvcnt ;
469  int intvcnt ;
470  int binvcnt ;
471  int maxcollen ;
472  int maxcolndx ;
473  int concnt ;
474  int archccnt ;
475  int cutccnt ;
476  int maxrowlen ;
477  int maxrowndx ;
478  int colsze ;
479  int rowsze ;
481  double maxaij ;
482  double minaij ;
483  double *rowscale ;
484  double *colscale ;
485  const char *objnme ;
486  int objndx ;
487  int xzndx ;
488  double *obj ;
490  double *vub ;
491  double *vlb ;
492  double *rhs ;
493  double *rhslow ;
498 
499 
500 
501 /*
502  consys_utils.c
503 */
504 
505 extern consys_struct *consys_create(const char *nme, flags parts, flags opts,
506  int concnt, int varcnt, double infinity) ;
507 extern bool consys_dupsys(consys_struct *src, consys_struct **dst,
508  flags dstvecs) ;
509 extern void consys_free (consys_struct *consys) ;
510 extern bool consys_realloc(consys_struct *consys, char rowcol, int incr),
511  consys_attach(consys_struct *consys, flags what, int elsze,
512  void **pvec),
513  consys_update(consys_struct *consys, void *oldvec, void *newvec),
514  consys_detach(consys_struct *consys, void **pvec, bool all) ;
515 
516 extern bool consys_addcol_pk(consys_struct *consys,
517  vartyp_enum vartyp, pkvec_struct *pkcol,
518  double obj, double vlb, double vub),
520  const char **nme, double *excol,
521  double obj, double vlb, double vub),
522  consys_addrow_pk(consys_struct *consys, char rowclass,
523  contyp_enum contyp, pkvec_struct *pkrow,
524  double rhs, double rhslow,
525  conbnd_struct *cub, conbnd_struct *clb),
526  consys_getcol_pk(consys_struct *consys, int colndx,
527  pkvec_struct **pkvec),
528  consys_getcol_ex(consys_struct *consys, int colndx, double **vec),
529  consys_getrow_pk(consys_struct *consys, int rowndx,
530  pkvec_struct **pkvec),
531  consys_getrow_ex(consys_struct *consys, int rowndx, double **vec),
532  consys_delcol(consys_struct *consys, int colndx),
533  consys_delrow(consys_struct *consys, int rowndx),
534  consys_delrow_stable(consys_struct *consys, int rowndx) ;
535 
536 extern bool consys_setcoeff(consys_struct *consys,
537  int rowndx, int colndx, double val) ;
538 extern double consys_getcoeff(consys_struct *consys, int rowndx, int colndx) ;
539 
540 extern bool consys_logicals(consys_struct *consys) ;
541 
542 /*
543  consys_mathutils.c
544 */
545 
546 extern int consys_gcdrow(consys_struct *consys, int rowndx) ;
547 
548 extern double consys_dotcol(consys_struct *consys, int colndx, double *vec),
549  consys_dotrow(consys_struct *consys, int rowndx, double *vec) ;
550 extern double consys_1normrow(consys_struct *consys, int rowndx),
551  consys_ssqrow(consys_struct *consys, int rowndx),
552  consys_2normrow(consys_struct *consys, int rowndx),
553  consys_infnormrow(consys_struct *consys, int rowndx),
554  consys_1normcol(consys_struct *consys, int rowndx),
555  consys_ssqcol(consys_struct *consys, int rowndx),
556  consys_2normcol(consys_struct *consys, int rowndx),
557  consys_infnormcol(consys_struct *consys, int rowndx) ;
558 
559 extern bool consys_mulrow(consys_struct *consys, int rowndx, double scalar) ;
560 extern bool consys_divrow(consys_struct *consys, int rowndx, double scalar) ;
561 
562 extern bool consys_accumcol(consys_struct *consys, int colndx, double *vec) ;
563 extern bool consys_mulaccumcol(consys_struct *consys, int colndx,
564  double scalar, double *vec) ;
565 
566 /*
567  consys_scaling.c
568 */
569 
570 extern bool consys_evalsys(consys_struct *consys, double *scm, int *gecnt) ;
571 extern bool consys_geomscale(consys_struct *consys,
572  double **rowscale, double **colscale),
574  double **rowscale, double **colscale),
575  consys_applyscale(consys_struct *consys, bool convctyp,
576  double *rowscale, double *colscale) ;
577 
578 /*
579  consys_io.c
580 */
581 
582 extern const char *consys_prtvartyp(vartyp_enum vartyp),
583  *consys_prtcontyp(contyp_enum contyp) ;
584 extern char *consys_assocnme(consys_struct *consys, flags which),
585  *consys_conbndnme(char bndlett, int cndx, conbnd_struct *bnd),
587 
588 #ifndef DYLP_NDEBUG
589 
590 #include "dylib_io.h"
591 #include "dylib_std.h"
592 
593 extern void consys_prtcon(ioid chn, bool echo,
594  consys_struct *consys, int i, const char *pfx) ;
595 #endif
596 
597 /*
598  A routine to set (change, really) the name of an existing constraint or
599  variable.
600 */
601 
602 extern void consys_chgnme(consys_struct *consys, char cv,
603  int ndx, const char *newnme) ;
604 
605 /*
606  consys_nme returns a string containing the name of the specified constraint
607  or variable. If the client supplies a buffer, that buffer is used to return
608  the name. If a buffer isn't supplied, a little care is required.
609  * If consys_nme can find a pointer to the name stored in the constraint
610  matrix (i.e., in the row or column header) it will return the stored
611  pointer. Successive calls will not interfere with one another.
612  * If consys_nme has to build the name, it will use an internal buffer.
613  Successive calls will reuse this buffer as required (overwriting the
614  previous name).
615 
616  Names have to be built in two cases:
617  * A fully prefixed name is requested (a prefix of 'consys->nme.' is
618  added to the variable or constraint name).
619  * The name of a logical variable is requested and logicals aren't enabled
620  in the constraint system.
621 
622  A buffer of size CONSYS_MAXBUFLEN is guaranteed to be adequate.
623 */
624 
625 #define CONSYS_MAXBUFLEN 32
626 extern const char *consys_nme(consys_struct *consys,
627  char cv, int ndx, bool pfx, char *clientbuf) ;
628 
629 
630 #endif /* _CONSYS_H */
bool consys_getrow_ex(consys_struct *consys, int rowndx, double **vec)
double consys_getcoeff(consys_struct *consys, int rowndx, int colndx)
double consys_1normrow(consys_struct *consys, int rowndx)
char * consys_conbndnme(char bndlett, int cndx, conbnd_struct *bnd)
double * vub
Definition: dy_consys.h:490
unsigned int flags
Definition: dylib_std.h:95
const char * consys_prtvartyp(vartyp_enum vartyp)
bool consys_mulaccumcol(consys_struct *consys, int colndx, double scalar, double *vec)
bool consys_delcol(consys_struct *consys, int colndx)
double consys_infnormrow(consys_struct *consys, int rowndx)
double consys_infnormcol(consys_struct *consys, int rowndx)
bool consys_accumcol(consys_struct *consys, int colndx, double *vec)
double consys_ssqcol(consys_struct *consys, int rowndx)
double consys_2normcol(consys_struct *consys, int rowndx)
void consys_prtcon(ioid chn, bool echo, consys_struct *consys, int i, const char *pfx)
bool consys_getcol_pk(consys_struct *consys, int colndx, pkvec_struct **pkvec)
struct rowhdr_struct_tag * rowhdr
Definition: dy_consys.h:103
bool consys_getcol_ex(consys_struct *consys, int colndx, double **vec)
bool consys_realloc(consys_struct *consys, char rowcol, int incr)
coeff_struct * coeffs
Definition: dy_consys.h:141
struct attvhdr_struct_tag attvhdr_struct
bool consys_dupsys(consys_struct *src, consys_struct **dst, flags dstvecs)
double * obj
Definition: dy_consys.h:488
struct coeff_struct_tag coeff_struct
struct coeff_struct_tag * colnxt
Definition: dy_consys.h:107
coeff_struct * coeffs
Definition: dy_consys.h:124
struct colhdr_struct_tag * colhdr
Definition: dy_consys.h:104
bool consys_getrow_pk(consys_struct *consys, int rowndx, pkvec_struct **pkvec)
bool consys_attach(consys_struct *consys, flags what, int elsze, void **pvec)
conmtx_struct mtx
Definition: dy_consys.h:480
bool consys_geomscale(consys_struct *consys, double **rowscale, double **colscale)
bool consys_addrow_pk(consys_struct *consys, char rowclass, contyp_enum contyp, pkvec_struct *pkrow, double rhs, double rhslow, conbnd_struct *cub, conbnd_struct *clb)
bool consys_delrow(consys_struct *consys, int rowndx)
contyp_enum
Definition: dy_consys.h:338
struct rowhdr_struct_tag rowhdr_struct
bool consys_addcol_pk(consys_struct *consys, vartyp_enum vartyp, pkvec_struct *pkcol, double obj, double vlb, double vub)
void consys_chgnme(consys_struct *consys, char cv, int ndx, const char *newnme)
double * vlb
Definition: dy_consys.h:491
const char * nme
Definition: dy_consys.h:140
int ioid
Definition: dylib_io.h:39
conbnd_struct * cub
Definition: dy_consys.h:495
const char * consys_prtcontyp(contyp_enum contyp)
int consys_gcdrow(consys_struct *consys, int rowndx)
const char * objnme
Definition: dy_consys.h:485
double tiny
Definition: dy_consys.h:465
double minaij
Definition: dy_consys.h:482
bool consys_equiscale(consys_struct *consys, double **rowscale, double **colscale)
bool consys_addcol_ex(consys_struct *consys, vartyp_enum vartyp, const char **nme, double *excol, double obj, double vlb, double vub)
struct coeff_struct_tag * rownxt
Definition: dy_consys.h:106
double maxaij
Definition: dy_consys.h:481
double * rhslow
Definition: dy_consys.h:493
bool consys_detach(consys_struct *consys, void **pvec, bool all)
vartyp_enum * vtyp
Definition: dy_consys.h:489
contyp_enum * ctyp
Definition: dy_consys.h:494
bool consys_setcoeff(consys_struct *consys, int rowndx, int colndx, double val)
bool consys_update(consys_struct *consys, void *oldvec, void *newvec)
double consys_1normcol(consys_struct *consys, int rowndx)
struct colhdr_struct_tag colhdr_struct
bool consys_logicals(consys_struct *consys)
vartyp_enum
Definition: dy_consys.h:354
double consys_dotrow(consys_struct *consys, int rowndx, double *vec)
const char * consys_nme(consys_struct *consys, char cv, int ndx, bool pfx, char *clientbuf)
char * consys_conbndval(conbnd_struct *bnd)
const char * nme
Definition: dy_consys.h:123
consys_struct * consys_create(const char *nme, flags parts, flags opts, int concnt, int varcnt, double infinity)
attvhdr_struct * attvecs
Definition: dy_consys.h:497
double consys_2normrow(consys_struct *consys, int rowndx)
conbnd_struct * clb
Definition: dy_consys.h:496
double * rhs
Definition: dy_consys.h:492
struct attvhdr_struct_tag * nxt
Definition: dy_consys.h:267
rowhdr_struct ** rows
Definition: dy_consys.h:156
double bnd
Definition: dy_consys.h:310
double inf
Definition: dy_consys.h:464
void consys_free(consys_struct *consys)
double * colscale
Definition: dy_consys.h:484
lnk_struct * pveclst
Definition: dy_consys.h:271
double * rowscale
Definition: dy_consys.h:483
colhdr_struct ** cols
Definition: dy_consys.h:155
const char * nme
Definition: dy_consys.h:461
bool consys_divrow(consys_struct *consys, int rowndx, double scalar)
bool consys_applyscale(consys_struct *consys, bool convctyp, double *rowscale, double *colscale)
double consys_ssqrow(consys_struct *consys, int rowndx)
char * consys_assocnme(consys_struct *consys, flags which)
bool consys_delrow_stable(consys_struct *consys, int rowndx)
double consys_dotcol(consys_struct *consys, int colndx, double *vec)
bool consys_mulrow(consys_struct *consys, int rowndx, double scalar)
bool consys_evalsys(consys_struct *consys, double *scm, int *gecnt)