1 //------------------------------------------------------------------------------
2 // SLIP_LU/Demo/demos.h: #include file the demo programs
3 //------------------------------------------------------------------------------
4 
5 // SLIP_LU: (c) 2019-2020, Chris Lourenco, Jinhao Chen, Erick Moreno-Centeno,
6 // Timothy A. Davis, Texas A&M University.  All Rights Reserved.  See
7 // SLIP_LU/License for the license.
8 
9 //------------------------------------------------------------------------------
10 
11 #include "SLIP_LU.h"
12 #include <time.h>
13 #include <stdint.h>
14 #include <inttypes.h>
15 
16 #define OK(method)                      \
17 {                                       \
18     ok = method ;                       \
19     if (ok != SLIP_OK)                  \
20     {                                   \
21         printf ("Error: %d line %d file %s\n", ok, __LINE__, __FILE__) ; \
22         FREE_WORKSPACE ;                \
23         return 0 ;                      \
24     }                                   \
25 }
26 
27 #define SLIP_MIN(a,b) (((a) < (b)) ? (a) : (b))
28 
29 /* Purpose: This processes the command line for user specified options */
30 SLIP_info SLIP_process_command_line //processes the command line
31 (
32     int argc,               // number of command line arguments
33     char* argv[],           // set of command line arguments
34     SLIP_options* option,   // struct containing the command options
35     char** mat_name,        // Name of the matrix to be read in
36     char** rhs_name,        // Name of the RHS vector to be read in
37     SLIP_type *rat,         // data type of output solution:
38                             // 1:SLIP_MPZ (default), 2:SLIP_FP64, 3:SLIP_MPFR
39     bool *help
40 );
41 
42 /* Purpose: This function prints out the user specified/default options*/
43 void SLIP_print_options     // display specified/default options to user
44 (
45     SLIP_options* option // struct containing all of the options
46 );
47 
48 /* Purpose: This function shows the usage of the code.*/
49 void SLIP_show_usage(void);
50 
51 /* Purpose: This function reads in a matrix stored in a triplet format.
52  * This format used can be seen in any of the example mat files.
53  */
54 SLIP_info SLIP_tripread
55 (
56     SLIP_matrix **A_handle,     // Matrix to be constructed
57     FILE* file,                 // file to read from (must already be open)
58     SLIP_options* option
59 ) ;
60 
61 /* Purpose: This function reads in a double matrix stored in a triplet format.
62  * This format used can be seen in any of the example mat files.
63  */
64 SLIP_info SLIP_tripread_double
65 (
66     SLIP_matrix **A_handle,     // Matrix to be constructed
67     FILE* file,                 // file to read from (must already be open)
68     SLIP_options* option
69 ) ;
70 
71 /* Purpose: SLIP_read_dense: read a dense matrix. */
72 SLIP_info SLIP_read_dense
73 (
74     SLIP_matrix **b_handle,      // Matrix to be constructed
75     FILE* file,                  // file to read from (must already be open)
76     SLIP_options* option
77 ) ;
78