22 std::vector<double> Ax;
24 sparse_matrix(
int ncols,
int nrows,
int maxnz);
27typedef struct sparse_matrix sp_mat;
29struct sparse_numerical {
32 std::unique_ptr<sp_mat> L;
33 std::unique_ptr<sp_mat> U;
36 std::vector<int> xi_data;
37 std::vector<int> topvec;
38 std::vector<int> pinv;
41 std::vector<int> wamd;
42 std::vector<double> w;
44 sparse_numerical(
int n);
47typedef struct sparse_numerical sp_num;
50int reachr(sp_mat* G, sp_mat* B,
int k,
int* xik,
int* pinv);
51void dfsr(
int j, sp_mat* G,
int* top,
int* xik,
int* pinv);
52void sp_splsolve(sp_mat* G, sp_mat* B,
int k,
int* xik,
int top,
double* x,
int* pinv);
53bool sp_ludcmp(sp_num* N, sp_mat* A,
double pivtol);
54void sp_lusolve(sp_num* N,
double* b,
double* x);
55void sp_refactor(sp_num* N, sp_mat* A);
56int column_grouping(sp_mat* G,
int* col_g,
int* col_wi);
57void sp_amd(
int* Cp,
int* Ci,
int n,
int cnzmax,
int* P,
int* W);
58int sp_wclear(
int mark,
int lemax,
int* w,
int n);
59int sp_tdfs(
int j,
int k,
int* head,
const int* next,
int* post,
int* stack);
61#define SPFLIP(i) (-(i) - 2)
62#define SPUNFLIP(i) (((i) < 0) ? SPFLIP(i) : (i))
63#define SPMARKED(w, j) (w[j] < 0)
66 w[j] = SPFLIP(w[j]); \