Skip to content

Expose Eigen's Direct and Iterative Sparse System Solvers #18

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 56 additions & 0 deletions bindings/ffi_eigen_bindings.ml
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,20 @@ module Bindings (F : Cstubs.FOREIGN) = struct

let ml_eigen_print = foreign "c_eigen_spmat_s_print" (ptr c_spmat_s @-> returning void)

let ml_eigen_sparse_LU = foreign "c_eigen_spmat_s_sparse_LU" (ptr c_spmat_s @-> ptr c_spmat_s @-> returning (ptr_opt c_spmat_s))

let ml_eigen_sparse_QR = foreign "c_eigen_spmat_s_sparse_QR" (ptr c_spmat_s @-> ptr c_spmat_s @-> returning (ptr_opt c_spmat_s))

let ml_eigen_simplicial_LLT = foreign "c_eigen_spmat_s_simplicial_LLT" (ptr c_spmat_s @-> ptr c_spmat_s @-> returning (ptr_opt c_spmat_s))

let ml_eigen_simplicial_LDLT = foreign "c_eigen_spmat_s_simplicial_LDLT" (ptr c_spmat_s @-> ptr c_spmat_s @-> returning (ptr_opt c_spmat_s))

let ml_eigen_conjugate_gradient = foreign "c_eigen_spmat_s_conjugate_gradient" (ptr c_spmat_s @-> ptr c_spmat_s @-> returning (ptr_opt c_spmat_s))

let ml_eigen_least_squares_conjugate_gradient = foreign "c_eigen_spmat_s_least_squares_conjugate_gradient" (ptr c_spmat_s @-> ptr c_spmat_s @-> returning (ptr_opt c_spmat_s))

let ml_eigen_BiCGSTAB = foreign "c_eigen_spmat_s_BiCGSTAB" (ptr c_spmat_s @-> ptr c_spmat_s @-> returning (ptr_opt c_spmat_s))

end


Expand Down Expand Up @@ -425,6 +439,20 @@ module Bindings (F : Cstubs.FOREIGN) = struct

let ml_eigen_print = foreign "c_eigen_spmat_d_print" (ptr c_spmat_d @-> returning void)

let ml_eigen_sparse_LU = foreign "c_eigen_spmat_d_sparse_LU" (ptr c_spmat_d @-> ptr c_spmat_d @-> returning (ptr_opt c_spmat_d))

let ml_eigen_sparse_QR = foreign "c_eigen_spmat_d_sparse_QR" (ptr c_spmat_d @-> ptr c_spmat_d @-> returning (ptr_opt c_spmat_d))

let ml_eigen_simplicial_LLT = foreign "c_eigen_spmat_d_simplicial_LLT" (ptr c_spmat_d @-> ptr c_spmat_d @-> returning (ptr_opt c_spmat_d))

let ml_eigen_simplicial_LDLT = foreign "c_eigen_spmat_d_simplicial_LDLT" (ptr c_spmat_d @-> ptr c_spmat_d @-> returning (ptr_opt c_spmat_d))

let ml_eigen_conjugate_gradient = foreign "c_eigen_spmat_d_conjugate_gradient" (ptr c_spmat_d @-> ptr c_spmat_d @-> returning (ptr_opt c_spmat_d))

let ml_eigen_least_squares_conjugate_gradient = foreign "c_eigen_spmat_d_least_squares_conjugate_gradient" (ptr c_spmat_d @-> ptr c_spmat_d @-> returning (ptr_opt c_spmat_d))

let ml_eigen_BiCGSTAB = foreign "c_eigen_spmat_d_BiCGSTAB" (ptr c_spmat_d @-> ptr c_spmat_d @-> returning (ptr_opt c_spmat_d))

end


Expand Down Expand Up @@ -532,6 +560,20 @@ module Bindings (F : Cstubs.FOREIGN) = struct

let ml_eigen_print = foreign "c_eigen_spmat_c_print" (ptr c_spmat_c @-> returning void)

let ml_eigen_sparse_LU = foreign "c_eigen_spmat_c_sparse_LU" (ptr c_spmat_c @-> ptr c_spmat_c @-> returning (ptr_opt c_spmat_c))

let ml_eigen_sparse_QR = foreign "c_eigen_spmat_c_sparse_QR" (ptr c_spmat_c @-> ptr c_spmat_c @-> returning (ptr_opt c_spmat_c))

let ml_eigen_simplicial_LLT = foreign "c_eigen_spmat_c_simplicial_LLT" (ptr c_spmat_c @-> ptr c_spmat_c @-> returning (ptr_opt c_spmat_c))

let ml_eigen_simplicial_LDLT = foreign "c_eigen_spmat_c_simplicial_LDLT" (ptr c_spmat_c @-> ptr c_spmat_c @-> returning (ptr_opt c_spmat_c))

let ml_eigen_conjugate_gradient = foreign "c_eigen_spmat_c_conjugate_gradient" (ptr c_spmat_c @-> ptr c_spmat_c @-> returning (ptr_opt c_spmat_c))

let ml_eigen_least_squares_conjugate_gradient = foreign "c_eigen_spmat_c_least_squares_conjugate_gradient" (ptr c_spmat_c @-> ptr c_spmat_c @-> returning (ptr_opt c_spmat_c))

let ml_eigen_BiCGSTAB = foreign "c_eigen_spmat_c_BiCGSTAB" (ptr c_spmat_c @-> ptr c_spmat_c @-> returning (ptr_opt c_spmat_c))

end


Expand Down Expand Up @@ -639,6 +681,20 @@ module Bindings (F : Cstubs.FOREIGN) = struct

let ml_eigen_print = foreign "c_eigen_spmat_z_print" (ptr c_spmat_z @-> returning void)

let ml_eigen_sparse_LU = foreign "c_eigen_spmat_z_sparse_LU" (ptr c_spmat_z @-> ptr c_spmat_z @-> returning (ptr_opt c_spmat_z))

let ml_eigen_sparse_QR = foreign "c_eigen_spmat_z_sparse_QR" (ptr c_spmat_z @-> ptr c_spmat_z @-> returning (ptr_opt c_spmat_z))

let ml_eigen_simplicial_LLT = foreign "c_eigen_spmat_z_simplicial_LLT" (ptr c_spmat_z @-> ptr c_spmat_z @-> returning (ptr_opt c_spmat_z))

let ml_eigen_simplicial_LDLT = foreign "c_eigen_spmat_z_simplicial_LDLT" (ptr c_spmat_z @-> ptr c_spmat_z @-> returning (ptr_opt c_spmat_z))

let ml_eigen_conjugate_gradient = foreign "c_eigen_spmat_z_conjugate_gradient" (ptr c_spmat_z @-> ptr c_spmat_z @-> returning (ptr_opt c_spmat_z))

let ml_eigen_least_squares_conjugate_gradient = foreign "c_eigen_spmat_z_least_squares_conjugate_gradient" (ptr c_spmat_z @-> ptr c_spmat_z @-> returning (ptr_opt c_spmat_z))

let ml_eigen_BiCGSTAB = foreign "c_eigen_spmat_z_BiCGSTAB" (ptr c_spmat_z @-> ptr c_spmat_z @-> returning (ptr_opt c_spmat_z))

end


Expand Down
14 changes: 14 additions & 0 deletions eigen/eigen_spmat_c.ml
Original file line number Diff line number Diff line change
Expand Up @@ -115,3 +115,17 @@ let neg x = ml_eigen_neg x
let sqrt x = ml_eigen_sqrt x

let print x = ml_eigen_print x

let sparse_LU a b = ml_eigen_sparse_LU a b

let sparse_QR a b = ml_eigen_sparse_QR a b

let simplicial_LLT a b = ml_eigen_simplicial_LLT a b

let simplicial_LDLT a b = ml_eigen_simplicial_LDLT a b

let conjugate_gradient a b = ml_eigen_conjugate_gradient a b

let least_squares_conjugate_gradient a b = ml_eigen_least_squares_conjugate_gradient a b

let biCGSTAB a b = ml_eigen_BiCGSTAB a b
14 changes: 14 additions & 0 deletions eigen/eigen_spmat_d.ml
Original file line number Diff line number Diff line change
Expand Up @@ -125,3 +125,17 @@ let neg x = ml_eigen_neg x
let sqrt x = ml_eigen_sqrt x

let print x = ml_eigen_print x

let sparse_LU a b = ml_eigen_sparse_LU a b

let sparse_QR a b = ml_eigen_sparse_QR a b

let simplicial_LLT a b = ml_eigen_simplicial_LLT a b

let simplicial_LDLT a b = ml_eigen_simplicial_LDLT a b

let conjugate_gradient a b = ml_eigen_conjugate_gradient a b

let least_squares_conjugate_gradient a b = ml_eigen_least_squares_conjugate_gradient a b

let biCGSTAB a b = ml_eigen_BiCGSTAB a b
14 changes: 14 additions & 0 deletions eigen/eigen_spmat_s.ml
Original file line number Diff line number Diff line change
Expand Up @@ -125,3 +125,17 @@ let neg x = ml_eigen_neg x
let sqrt x = ml_eigen_sqrt x

let print x = ml_eigen_print x

let sparse_LU a b = ml_eigen_sparse_LU a b

let sparse_QR a b = ml_eigen_sparse_QR a b

let simplicial_LLT a b = ml_eigen_simplicial_LLT a b

let simplicial_LDLT a b = ml_eigen_simplicial_LDLT a b

let conjugate_gradient a b = ml_eigen_conjugate_gradient a b

let least_squares_conjugate_gradient a b = ml_eigen_least_squares_conjugate_gradient a b

let biCGSTAB a b = ml_eigen_BiCGSTAB a b
14 changes: 14 additions & 0 deletions eigen/eigen_spmat_z.ml
Original file line number Diff line number Diff line change
Expand Up @@ -115,3 +115,17 @@ let neg x = ml_eigen_neg x
let sqrt x = ml_eigen_sqrt x

let print x = ml_eigen_print x

let sparse_LU a b = ml_eigen_sparse_LU a b

let sparse_QR a b = ml_eigen_sparse_QR a b

let simplicial_LLT a b = ml_eigen_simplicial_LLT a b

let simplicial_LDLT a b = ml_eigen_simplicial_LDLT a b

let conjugate_gradient a b = ml_eigen_conjugate_gradient a b

let least_squares_conjugate_gradient a b = ml_eigen_least_squares_conjugate_gradient a b

let biCGSTAB a b = ml_eigen_BiCGSTAB a b
56 changes: 56 additions & 0 deletions eigen/ffi_eigen_bindings.ml
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,20 @@ module Bindings (F : Ctypes.FOREIGN) = struct

let ml_eigen_print = foreign "c_eigen_spmat_s_print" (ptr c_spmat_s @-> returning void)

let ml_eigen_sparse_LU = foreign "c_eigen_spmat_s_sparse_LU" (ptr c_spmat_s @-> ptr c_spmat_s @-> returning (ptr_opt c_spmat_s))

let ml_eigen_sparse_QR = foreign "c_eigen_spmat_s_sparse_QR" (ptr c_spmat_s @-> ptr c_spmat_s @-> returning (ptr_opt c_spmat_s))

let ml_eigen_simplicial_LLT = foreign "c_eigen_spmat_s_simplicial_LLT" (ptr c_spmat_s @-> ptr c_spmat_s @-> returning (ptr_opt c_spmat_s))

let ml_eigen_simplicial_LDLT = foreign "c_eigen_spmat_s_simplicial_LDLT" (ptr c_spmat_s @-> ptr c_spmat_s @-> returning (ptr_opt c_spmat_s))

let ml_eigen_conjugate_gradient = foreign "c_eigen_spmat_s_conjugate_gradient" (ptr c_spmat_s @-> ptr c_spmat_s @-> returning (ptr_opt c_spmat_s))

let ml_eigen_least_squares_conjugate_gradient = foreign "c_eigen_spmat_s_least_squares_conjugate_gradient" (ptr c_spmat_s @-> ptr c_spmat_s @-> returning (ptr_opt c_spmat_s))

let ml_eigen_BiCGSTAB = foreign "c_eigen_spmat_s_BiCGSTAB" (ptr c_spmat_s @-> ptr c_spmat_s @-> returning (ptr_opt c_spmat_s))

end


Expand Down Expand Up @@ -425,6 +439,20 @@ module Bindings (F : Ctypes.FOREIGN) = struct

let ml_eigen_print = foreign "c_eigen_spmat_d_print" (ptr c_spmat_d @-> returning void)

let ml_eigen_sparse_LU = foreign "c_eigen_spmat_d_sparse_LU" (ptr c_spmat_d @-> ptr c_spmat_d @-> returning (ptr_opt c_spmat_d))

let ml_eigen_sparse_QR = foreign "c_eigen_spmat_d_sparse_QR" (ptr c_spmat_d @-> ptr c_spmat_d @-> returning (ptr_opt c_spmat_d))

let ml_eigen_simplicial_LLT = foreign "c_eigen_spmat_d_simplicial_LLT" (ptr c_spmat_d @-> ptr c_spmat_d @-> returning (ptr_opt c_spmat_d))

let ml_eigen_simplicial_LDLT = foreign "c_eigen_spmat_d_simplicial_LDLT" (ptr c_spmat_d @-> ptr c_spmat_d @-> returning (ptr_opt c_spmat_d))

let ml_eigen_conjugate_gradient = foreign "c_eigen_spmat_d_conjugate_gradient" (ptr c_spmat_d @-> ptr c_spmat_d @-> returning (ptr_opt c_spmat_d))

let ml_eigen_least_squares_conjugate_gradient = foreign "c_eigen_spmat_d_least_squares_conjugate_gradient" (ptr c_spmat_d @-> ptr c_spmat_d @-> returning (ptr_opt c_spmat_d))

let ml_eigen_BiCGSTAB = foreign "c_eigen_spmat_d_BiCGSTAB" (ptr c_spmat_d @-> ptr c_spmat_d @-> returning (ptr_opt c_spmat_d))

end


Expand Down Expand Up @@ -532,6 +560,20 @@ module Bindings (F : Ctypes.FOREIGN) = struct

let ml_eigen_print = foreign "c_eigen_spmat_c_print" (ptr c_spmat_c @-> returning void)

let ml_eigen_sparse_LU = foreign "c_eigen_spmat_c_sparse_LU" (ptr c_spmat_c @-> ptr c_spmat_c @-> returning (ptr_opt c_spmat_c))

let ml_eigen_sparse_QR = foreign "c_eigen_spmat_c_sparse_QR" (ptr c_spmat_c @-> ptr c_spmat_c @-> returning (ptr_opt c_spmat_c))

let ml_eigen_simplicial_LLT = foreign "c_eigen_spmat_c_simplicial_LLT" (ptr c_spmat_c @-> ptr c_spmat_c @-> returning (ptr_opt c_spmat_c))

let ml_eigen_simplicial_LDLT = foreign "c_eigen_spmat_c_simplicial_LDLT" (ptr c_spmat_c @-> ptr c_spmat_c @-> returning (ptr_opt c_spmat_c))

let ml_eigen_conjugate_gradient = foreign "c_eigen_spmat_c_conjugate_gradient" (ptr c_spmat_c @-> ptr c_spmat_c @-> returning (ptr_opt c_spmat_c))

let ml_eigen_least_squares_conjugate_gradient = foreign "c_eigen_spmat_c_least_squares_conjugate_gradient" (ptr c_spmat_c @-> ptr c_spmat_c @-> returning (ptr_opt c_spmat_c))

let ml_eigen_BiCGSTAB = foreign "c_eigen_spmat_c_BiCGSTAB" (ptr c_spmat_c @-> ptr c_spmat_c @-> returning (ptr_opt c_spmat_c))

end


Expand Down Expand Up @@ -639,6 +681,20 @@ module Bindings (F : Ctypes.FOREIGN) = struct

let ml_eigen_print = foreign "c_eigen_spmat_z_print" (ptr c_spmat_z @-> returning void)

let ml_eigen_sparse_LU = foreign "c_eigen_spmat_z_sparse_LU" (ptr c_spmat_z @-> ptr c_spmat_z @-> returning (ptr_opt c_spmat_z))

let ml_eigen_sparse_QR = foreign "c_eigen_spmat_z_sparse_QR" (ptr c_spmat_z @-> ptr c_spmat_z @-> returning (ptr_opt c_spmat_z))

let ml_eigen_simplicial_LLT = foreign "c_eigen_spmat_z_simplicial_LLT" (ptr c_spmat_z @-> ptr c_spmat_z @-> returning (ptr_opt c_spmat_z))

let ml_eigen_simplicial_LDLT = foreign "c_eigen_spmat_z_simplicial_LDLT" (ptr c_spmat_z @-> ptr c_spmat_z @-> returning (ptr_opt c_spmat_z))

let ml_eigen_conjugate_gradient = foreign "c_eigen_spmat_z_conjugate_gradient" (ptr c_spmat_z @-> ptr c_spmat_z @-> returning (ptr_opt c_spmat_z))

let ml_eigen_least_squares_conjugate_gradient = foreign "c_eigen_spmat_z_least_squares_conjugate_gradient" (ptr c_spmat_z @-> ptr c_spmat_z @-> returning (ptr_opt c_spmat_z))

let ml_eigen_BiCGSTAB = foreign "c_eigen_spmat_z_BiCGSTAB" (ptr c_spmat_z @-> ptr c_spmat_z @-> returning (ptr_opt c_spmat_z))

end


Expand Down
28 changes: 28 additions & 0 deletions eigen_cpp/lib/eigen_spmat.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,13 @@ typedef int64_t INDEX;
struct c_spmat_s* c_eigen_spmat_s_neg(struct c_spmat_s *m);
struct c_spmat_s* c_eigen_spmat_s_sqrt(struct c_spmat_s *m);
void c_eigen_spmat_s_print(struct c_spmat_s *m);
struct c_spmat_s* c_eigen_spmat_s_sparse_LU(struct c_spmat_s *a, struct c_spmat_s *b);
struct c_spmat_s* c_eigen_spmat_s_sparse_QR(struct c_spmat_s *a, struct c_spmat_s *b);
struct c_spmat_s* c_eigen_spmat_s_simplicial_LLT(struct c_spmat_s *a, struct c_spmat_s *b);
struct c_spmat_s* c_eigen_spmat_s_simplicial_LDLT(struct c_spmat_s *a, struct c_spmat_s *b);
struct c_spmat_s* c_eigen_spmat_s_conjugate_gradient(struct c_spmat_s *a, struct c_spmat_s *b);
struct c_spmat_s* c_eigen_spmat_s_least_squares_conjugate_gradient(struct c_spmat_s *a, struct c_spmat_s *b);
struct c_spmat_s* c_eigen_spmat_s_BiCGSTAB(struct c_spmat_s *a, struct c_spmat_s *b);


/**************************** SparseMatrix_D ****************************/
Expand Down Expand Up @@ -147,6 +154,13 @@ typedef int64_t INDEX;
struct c_spmat_d* c_eigen_spmat_d_neg(struct c_spmat_d *m);
struct c_spmat_d* c_eigen_spmat_d_sqrt(struct c_spmat_d *m);
void c_eigen_spmat_d_print(struct c_spmat_d *m);
struct c_spmat_d* c_eigen_spmat_d_sparse_LU(struct c_spmat_d *a, struct c_spmat_d *b);
struct c_spmat_d* c_eigen_spmat_d_sparse_QR(struct c_spmat_d *a, struct c_spmat_d *b);
struct c_spmat_d* c_eigen_spmat_d_simplicial_LLT(struct c_spmat_d *a, struct c_spmat_d *b);
struct c_spmat_d* c_eigen_spmat_d_simplicial_LDLT(struct c_spmat_d *a, struct c_spmat_d *b);
struct c_spmat_d* c_eigen_spmat_d_conjugate_gradient(struct c_spmat_d *a, struct c_spmat_d *b);
struct c_spmat_d* c_eigen_spmat_d_least_squares_conjugate_gradient(struct c_spmat_d *a, struct c_spmat_d *b);
struct c_spmat_d* c_eigen_spmat_d_BiCGSTAB(struct c_spmat_d *a, struct c_spmat_d *b);


/**************************** SparseMatrix_C ****************************/
Expand Down Expand Up @@ -202,6 +216,13 @@ typedef int64_t INDEX;
struct c_spmat_c* c_eigen_spmat_c_neg(struct c_spmat_c *m);
struct c_spmat_c* c_eigen_spmat_c_sqrt(struct c_spmat_c *m);
void c_eigen_spmat_c_print(struct c_spmat_c *m);
struct c_spmat_c* c_eigen_spmat_c_sparse_LU(struct c_spmat_c *a, struct c_spmat_c *b);
struct c_spmat_c* c_eigen_spmat_c_sparse_QR(struct c_spmat_c *a, struct c_spmat_c *b);
struct c_spmat_c* c_eigen_spmat_c_simplicial_LLT(struct c_spmat_c *a, struct c_spmat_c *b);
struct c_spmat_c* c_eigen_spmat_c_simplicial_LDLT(struct c_spmat_c *a, struct c_spmat_c *b);
struct c_spmat_c* c_eigen_spmat_c_conjugate_gradient(struct c_spmat_c *a, struct c_spmat_c *b);
struct c_spmat_c* c_eigen_spmat_c_least_squares_conjugate_gradient(struct c_spmat_c *a, struct c_spmat_c *b);
struct c_spmat_c* c_eigen_spmat_c_BiCGSTAB(struct c_spmat_c *a, struct c_spmat_c *b);


/**************************** SparseMatrix_Z ****************************/
Expand Down Expand Up @@ -257,6 +278,13 @@ typedef int64_t INDEX;
struct c_spmat_z* c_eigen_spmat_z_neg(struct c_spmat_z *m);
struct c_spmat_z* c_eigen_spmat_z_sqrt(struct c_spmat_z *m);
void c_eigen_spmat_z_print(struct c_spmat_z *m);
struct c_spmat_z* c_eigen_spmat_z_sparse_LU(struct c_spmat_z *a, struct c_spmat_z *b);
struct c_spmat_z* c_eigen_spmat_z_sparse_QR(struct c_spmat_z *a, struct c_spmat_z *b);
struct c_spmat_z* c_eigen_spmat_z_simplicial_LLT(struct c_spmat_z *a, struct c_spmat_z *b);
struct c_spmat_z* c_eigen_spmat_z_simplicial_LDLT(struct c_spmat_z *a, struct c_spmat_z *b);
struct c_spmat_z* c_eigen_spmat_z_conjugate_gradient(struct c_spmat_z *a, struct c_spmat_z *b);
struct c_spmat_z* c_eigen_spmat_z_least_squares_conjugate_gradient(struct c_spmat_z *a, struct c_spmat_z *b);
struct c_spmat_z* c_eigen_spmat_z_BiCGSTAB(struct c_spmat_z *a, struct c_spmat_z *b);


#ifdef __cplusplus
Expand Down
72 changes: 72 additions & 0 deletions eigen_cpp/lib/eigen_spmat_c.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,13 @@
* Copyright (c) 2016-2017 Liang Wang <[email protected]>
*/

#include "sparse_solver.h"

/******************** pointer conversion ********************/

typedef SparseMatrix<spmat_c_elt, Eigen::RowMajor, INDEX> spmat_c;
typedef SparseMatrix<spmat_c_elt, Eigen::ColMajor, int> col_major_spmat_c;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason for not using INDEX?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, that was a weird one. Using INDEX broke compilation for me. Maybe it was some issue local to my environment? Can you try changing it to see if you can reproduce that issue?



inline spmat_c& c_to_eigen(c_spmat_c* ptr)
{
Expand Down Expand Up @@ -444,3 +448,71 @@ void c_eigen_spmat_c_print(c_spmat_c *m)
{
std::cout << c_to_eigen(m) << std::endl;
}

c_spmat_c* c_eigen_spmat_c_sparse_LU(c_spmat_c *c_coefficients, c_spmat_c *c_observations)
{
SparseSolver<SparseLU<col_major_spmat_c>,
spmat_c,
spmat_c_elt,
c_spmat_c> ss(c_coefficients, c_observations);
return ss.solve();
}

c_spmat_c* c_eigen_spmat_c_sparse_QR(c_spmat_c *c_coefficients, c_spmat_c *c_observations)
{
SparseSolver<SparseQR<col_major_spmat_c, COLAMDOrdering<int> >,
spmat_c,
spmat_c_elt,
c_spmat_c> ss(c_coefficients, c_observations);
return ss.solve();
}

c_spmat_c* c_eigen_spmat_c_simplicial_LLT(c_spmat_c *c_coefficients,
c_spmat_c *c_observations)
{
SparseSolver<SimplicialLLT<col_major_spmat_c>,
spmat_c,
spmat_c_elt,
c_spmat_c> ss(c_coefficients, c_observations);
return ss.solve();
}

c_spmat_c* c_eigen_spmat_c_simplicial_LDLT(c_spmat_c *c_coefficients,
c_spmat_c *c_observations)
{
SparseSolver<SimplicialLDLT<col_major_spmat_c>,
spmat_c,
spmat_c_elt,
c_spmat_c> ss(c_coefficients, c_observations);
return ss.solve();
}

c_spmat_c* c_eigen_spmat_c_conjugate_gradient(c_spmat_c *c_coefficients,
c_spmat_c *c_observations)
{
SparseSolver<ConjugateGradient<col_major_spmat_c>,
spmat_c,
spmat_c_elt,
c_spmat_c> ss(c_coefficients, c_observations);
return ss.solve();
}

c_spmat_c* c_eigen_spmat_c_least_squares_conjugate_gradient(c_spmat_c *c_coefficients,
c_spmat_c *c_observations)
{
SparseSolver<LeastSquaresConjugateGradient<col_major_spmat_c>,
spmat_c,
spmat_c_elt,
c_spmat_c> ss(c_coefficients, c_observations);
return ss.solve();
}

c_spmat_c* c_eigen_spmat_c_BiCGSTAB(c_spmat_c *c_coefficients,
c_spmat_c *c_observations)
{
SparseSolver<BiCGSTAB<col_major_spmat_c>,
spmat_c,
spmat_c_elt,
c_spmat_c> ss(c_coefficients, c_observations);
return ss.solve();
}
Loading