piplib 1.0
[piplib.git] / example / example.c
blob632fd133a102f73e6c5e7468f69065c5ebf12f44
1 /* This is a very simple example of how to use the PipLib inside your programs.
2 * You should compile it by typing 'make' (after edition of the makefile), then
3 * test it for instance by typing 'more FILE.pol | ./example'. Finally you can
4 * compare results given by PIP by typing 'pip32 FILE.dat'
5 */
7 # include <stdio.h>
8 # include <piplib/piplib32.h>
10 int main()
11 { PipMatrix * domain, * context ;
12 PipQuast * solution ;
14 printf("Enter the Matrices :\n") ;
15 domain = pip_matrix_read(stdin) ;
16 pip_matrix_print(stdout,domain) ;
17 context = pip_matrix_read(stdin) ;
18 pip_matrix_print(stdout,context) ;
19 printf("\n") ;
21 solution = pip_solve(domain,context,-1,1,0,0,0) ;
23 pip_matrix_free(domain) ;
24 pip_matrix_free(context) ;
26 pip_quast_print(stdout,solution,0) ;
28 pip_quast_free(solution) ;
29 return 0 ;