NESSi  v1.0.2
The NonEquilibrium Systems Simulation Library

◆ cplx_sq_solve_many()

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

Solve a linear equation \( {\rm Diag}[a,a,a,.,a] x=b \).

Purpose

Solve a linear equation \( {\rm Diag}[a,a,a,.,a] x=b \) for a given complex square matrix \(a\) and a complex vector \(b\). The size of \(a\) is \(n\). Here \( {\rm Diag}[a,a,a,.,a]\) is the block diagonal square matrix, whose size is \({\rm dim}\times d\).

Parameters
a

A complex square matrix, whose size is \({\rm dim}\).

b

A complex vector, whose size is \(n\times d\)

x

A complex vector into which the solution is set.

dim

Size of the matrix \(a\)

d

\({\rm dim}\times d\) is the size of \(b\) and \(x\).

Definition at line 91 of file linalg_eigen.cpp.

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

92 {
93  int l;
94  cdouble *b1=(cdouble*)b;
95  cdouble *x1=(cdouble*)x;
96  cdmatrix A_eigen;
97  cdvector b_eigen,X_eigen;
98  set_cdmatrix(n,a,A_eigen);
99  Eigen::FullPivLU<cdmatrix> lu(A_eigen);
100  for(l=0;l<d;l++){
101  set_cdvector(n,b1+n*l,b_eigen);
102  X_eigen=lu.solve(b_eigen);
103  get_cdvector(n,x1+n*l,X_eigen);
104  }
105 }
std::complex< double > cdouble
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: