ABACUS/src/MATRIX/det_LU_CX.cc

22 lines
346 B
C++

#include "ABACUS.h"
using namespace std;
complex<DP> ABACUS::det_LU_CX (SQMat_CX a)
{
// Returns the determinant of matrix a, through LU decomposition
Vect_INT indx(a.size());
SQMat_CX mat = a;
DP d;
ABACUS::ludcmp_CX (mat, indx, d);
complex<DP> dd = d;
for (int j = 0; j < mat.size(); j++) dd *= mat[j][j];
return(dd);
}