68 X.set_size(B.n_rows, B.n_cols);
70 csr_form<double, LIS_INT> csr_mat(this->triplet_mat,
SparseBase::ZERO,
true);
72 const sp_i auto n = csr_mat.n_rows;
73 const sp_i auto nnz = csr_mat.n_elem;
78 lis_matrix_create(0, &
A);
79 lis_matrix_set_size(
A, n, 0);
80 lis_matrix_set_csr(nnz, csr_mat.row_mem(), csr_mat.col_mem(), csr_mat.val_mem(),
A);
81 lis_matrix_assemble(
A);
83 lis_vector_create(0, &b);
84 lis_vector_create(0, &x);
85 lis_vector_set_size(b, n, 0);
86 lis_vector_set_size(x, n, 0);
88 lis_solver_set_option(setting.lis_options.c_str(), solver);
90 for(uword I = 0; I < B.n_cols; ++I) {
92 lis_vector_set(b, (
double*)B.colptr(I));
93 lis_vector_set(x, (
double*)X.colptr(I));
96 lis_solve(
A, b, x, solver);
105 lis_matrix_destroy(
A);
106 lis_vector_destroy(b);
107 lis_vector_destroy(x);