superlu_sys/
slu_util.rs

1use libc::{c_double, c_float, c_int, c_void};
2
3use superlu_enum_consts::*;
4use supermatrix::*;
5
6pub type flops_t = c_float;
7
8#[derive(Clone, Copy)]
9#[repr(C)]
10pub struct superlu_options_t {
11    pub Fact: fact_t,
12    pub Equil: yes_no_t,
13    pub ColPerm: colperm_t,
14    pub Trans: trans_t,
15    pub IterRefine: IterRefine_t,
16    pub DiagPivotThresh: c_double,
17    pub SymmetricMode: yes_no_t,
18    pub PivotGrowth: yes_no_t,
19    pub ConditionNumber: yes_no_t,
20    pub RowPerm: rowperm_t,
21    pub ILU_DropRule: c_int,
22    pub ILU_DropTol: c_double,
23    pub ILU_FillFactor: c_double,
24    pub ILU_Norm: norm_t,
25    pub ILU_FillTol: c_double,
26    pub ILU_MILU: milu_t,
27    pub ILU_MILU_Dim: c_double,
28    pub ParSymbFact: yes_no_t,
29    pub ReplaceTinyPivot: yes_no_t,
30    pub SolveInitialized: yes_no_t,
31    pub RefineInitialized: yes_no_t,
32    pub PrintStat: yes_no_t,
33    pub nnzL: c_int,
34    pub nnzU: c_int,
35    pub num_lookaheads: c_int,
36    pub lookahead_etree: yes_no_t,
37    pub SymPattern: yes_no_t,
38}
39
40#[derive(Clone, Copy)]
41#[repr(C)]
42pub struct SuperLUStat_t {
43    pub panel_histo: *mut c_int,
44    pub utime: *mut c_double,
45    pub ops: *mut flops_t,
46    pub TinyPivots: c_int,
47    pub RefineSteps: c_int,
48    pub expansions: c_int,
49}
50
51#[repr(C)]
52pub struct GlobalLU_t {
53    pub xsup: *mut c_int,
54    pub supno: *mut c_int,
55    pub lsub: *mut c_int,
56    pub xlsub: *mut c_int,
57    pub lusup: *mut c_double,
58    pub xlusup: *mut c_int,
59    pub ucol: *mut c_double,
60    pub usub: *mut c_int,
61    pub xusub: *mut c_int,
62    pub nzlmax: c_int,
63    pub nzumax: c_int,
64    pub nzlumax: c_int,
65    pub num_expansions: c_int,
66}
67
68extern "C" {
69    pub fn Destroy_SuperMatrix_Store(A: *mut SuperMatrix);
70    pub fn Destroy_CompCol_Matrix(A: *mut SuperMatrix);
71    pub fn Destroy_CompRow_Matrix(A: *mut SuperMatrix);
72    pub fn Destroy_SuperNode_Matrix(A: *mut SuperMatrix);
73    pub fn Destroy_CompCol_Permuted(A: *mut SuperMatrix);
74    pub fn Destroy_Dense_Matrix(A: *mut SuperMatrix);
75    pub fn set_default_options(options: *mut superlu_options_t);
76    pub fn intMalloc(n: c_int) -> *mut c_int;
77    pub fn superlu_free(addr: *mut c_void);
78    pub fn StatInit(stat: *mut SuperLUStat_t);
79    pub fn StatFree(stat: *mut SuperLUStat_t);
80    pub fn sp_ienv(ispec: c_int) -> c_int;
81}
82
83pub static SUPERLU_FREE: unsafe extern "C" fn(*mut c_void) = superlu_free;