NESSi  v1.0.2
The NonEquilibrium Systems Simulation Library

◆ cplx_sq_solve()

void linalg::cplx_sq_solve ( void *  a,
void *  b,
void *  x,
int  dim 
)

Solve a linear equation ax=b.

Purpose

Solve a linear equation ax=b for a given complex square matrix \(a\) and a complex vector \(b\).

Parameters
a

A complex square matrix given as a pointer

b

A complex vector given as a pointer

x

A complex vector into which the solution is set.

dim

Size of the matrix and the vector

Definition at line 80 of file linalg_eigen.cpp.

References get_cdvector(), set_cdmatrix(), and set_cdvector().

81 {
82  cdmatrix A_eigen;
83  cdvector b_eigen,X_eigen;
84  set_cdmatrix(n,a,A_eigen);
85  set_cdvector(n,b,b_eigen);
86  Eigen::FullPivLU<cdmatrix> lu(A_eigen);
87  X_eigen=lu.solve(b_eigen);
88  get_cdvector(n,x,X_eigen);
89 }
void set_cdmatrix(int n, void *a, cdmatrix &A)
void set_cdvector(int n, void *a, cdvector &A)
void get_cdvector(int n, void *a, cdvector &A)
+ Here is the call graph for this function: