1 #ifndef DOXYGEN_SHOULD_SKIP_THIS 4 #define TITLE "lrslib " 5 #define VERSION "v.6.2 2016.3.28" 6 #define AUTHOR "*Copyright (C) 1995,2016, David Avis avis@cs.mcgill.ca " 44 #define ARITH "lrslong.h" 47 #define ARITH "lrsgmp.h" 49 #define ARITH "lrsmp.h" 58 typedef __int64 int64_t;
59 typedef unsigned __int64 uint64_t;
67 #define errcheck(s, e) \ 68 if ((int64_t)(e) == -1L) { \ 74 #define CALLOC(n, s) xcalloc(n, s, __LINE__, __FILE__) 79 #define MAX_LRS_GLOBALS 10000L 118 typedef struct lrs_dic_struct
133 struct lrs_dic_struct *prev, *next;
136 typedef struct lrs_dat
157 int64_t *isave, *jsave;
167 int64_t startcount[5];
201 int64_t printcobasis;
215 int64_t saved_count[3];
224 lrs_dic *Qhead, *Qtail;
226 } lrs_dat, lrs_dat_p;
234 void post_output(
const char*,
const char*);
235 void plrs_read_dat(lrs_dat* Q, std::ifstream& ff);
236 void plrs_read_dic(lrs_dic* P, lrs_dat* Q, std::ifstream& ff);
237 void plrs_readfacets(lrs_dat* Q, int64_t facet[],
string facets);
238 void plrs_readlinearity(lrs_dat* Q,
string line);
245 extern FILE* lrs_cfp;
250 redund_main(
int argc,
253 lrs_alloc_dat(
const char* name);
254 lrs_dic* lrs_alloc_dic(lrs_dat* Q);
255 int64_t lrs_estimate(lrs_dic* P,
258 int64_t lrs_read_dat(lrs_dat* Q,
261 int64_t lrs_read_dic(lrs_dic* P,
263 int64_t lrs_checkbound(
266 int64_t lrs_getfirstbasis(
274 void lrs_getinput(lrs_dic* P,
280 int64_t lrs_getnextbasis(lrs_dic** dict_p,
285 int64_t lrs_getsolution(lrs_dic* P, lrs_dat* Q, lrs_mp_vector output, int64_t col);
287 lrs_dic* P, lrs_dat* Q, int64_t col, int64_t comment, lrs_mp_vector output);
288 int64_t lrs_getvertex(lrs_dic* P, lrs_dat* Q, lrs_mp_vector output);
289 void lrs_close(
char* name);
292 void lrs_lpoutput(lrs_dic* P,
294 lrs_mp_vector output);
295 void lrs_printcobasis(
299 void lrs_printoutput(lrs_dat* Q, lrs_mp_vector output);
300 void lrs_printrow(
char name[],
302 lrs_mp_vector output,
304 void lrs_printsol(lrs_dic* P,
310 void lrs_printtotals(lrs_dic* P, lrs_dat* Q);
311 int64_t lrs_set_digits(
314 lrs_solvelp(lrs_dic* P,
327 int64_t getabasis(lrs_dic* P,
330 void getnextoutput(lrs_dic* P,
335 int64_t ismin(lrs_dic* P,
339 int64_t lexmin(lrs_dic* P,
342 void pivot(lrs_dic* P,
346 int64_t primalfeasible(lrs_dic* P,
348 int64_t lrs_ratio(lrs_dic* P, lrs_dat* Q, int64_t col);
349 int64_t removecobasicindex(lrs_dic* P,
352 int64_t restartpivots(lrs_dic* P,
354 int64_t reverse(lrs_dic* P,
359 selectpivot(lrs_dic* P,
364 dan_selectpivot(lrs_dic* P,
368 void update(lrs_dic* P,
372 void updatevolume(lrs_dic* P,
380 lrs_degenerate(lrs_dic* P,
382 void print_basis(FILE* fp, lrs_dat* Q);
383 void printA(lrs_dic* P,
385 void pimat(lrs_dic* P,
390 int64_t readfacets(lrs_dat* Q, int64_t facet[]);
391 int64_t readlinearity(lrs_dat* Q);
392 void rescaledet(lrs_dic* P,
396 void rescalevolume(lrs_dic* P,
400 int64_t lrs_leaf(lrs_dic* P, lrs_dat* Q);
407 int64_t checkredund(lrs_dic* P, lrs_dat* Q);
410 int64_t checkcobasic(lrs_dic* P,
426 void lrs_free_dic(lrs_dic* P, lrs_dat* Q);
427 void lrs_free_dic2(lrs_dic* P, lrs_dat* Q);
428 void lrs_free_dat(lrs_dat* Q);
429 void copy_dict(lrs_dat* global, lrs_dic* dest, lrs_dic* src);
430 lrs_dic* alloc_memory(lrs_dat* Q);
431 lrs_dic* lrs_getdic(lrs_dat* Q);
432 lrs_dic* resize(lrs_dic* P, lrs_dat* Q);
437 void lprat(
const char* name,
441 lreadrat(int64_t* Num,
443 void reorder(int64_t a[],
446 void reorder1(int64_t a[],
456 int64_t lrs_solve_lp(lrs_dic* P,
472 void lrs_set_obj(lrs_dic* P,
485 #endif // DOXYGEN_SHOULD_SKIP_THIS