/* * Reads a polyhedron file on stdin with rationals and outputs an equivalent * system with integer coefficents. * * David Bremner. bremner@unb.ca * */ #include #include #include "process_args.h" #include "ine_io.h" #ifndef LRSMP #error This file only compiles with LRSMP #endif #include "lrsmp.h" #include "rat2int.h" static int m,n,type; #define MP_DIGITS 1000L static void lcm3(lrs_mp a,lrs_mp b,lrs_mp c); static void mul_row(lrs_mp *N, lrs_mp *D, lrs_mp l, int offset); static void div_row(lrs_mp *N, lrs_mp *D, lrs_mp g, int offset); int main(int argc, char **argv) { int i,j; lrs_mp l,g,scratch; char *type; lrs_mp *D, *N; char *ok[]={ "integer", "rational"}; process_args(argc,argv,DOCSTRING); lrs_mp_init (MP_DIGITS,stdin,stdout); scan_for_begin(&m,&n,&type); check_type(type, ok , 2); printf("%d %d integer\n",m,n); D=calloc(n,sizeof(lrs_mp)); N=calloc(n,sizeof(lrs_mp)); for (i=0;i