Refactor: lalg_adv module structure and use of X macro
Files:
-
lalg_adv_lapack_inc.F90: lalg_adv.F90
Issues with the module:
- File is very large.
- Suggested splitting is given below
- Many implementations are with ifdefs in the inc file, which defeats the purpose of an inc file
- Should refactor to use
X()macro
- Should refactor to use
- Several use Octopus-defined f90 interfaces, like
lapack_getrf, which is just an interface tod/zgetrf, suggesting that there's zero need to be writing caller routines twice: for real and complex- Should refactor to a single routine, replacing real/complex with
RTYPEas required - In some instances, an extra arg
rworkis required - this needs some thought
- Should refactor to a single routine, replacing real/complex with
Routines:
X(cholesky)-
X(geneigensolve).- Generalised eigenvalue problem for symmetric/Hermitian
- Wraps
lapack_sygv/lapack_hegv - Implemented with ifdefs in an inc file
-
X(eigensolve_nonh)- Wraps
lapack_geev
- Wraps
-
X(lowest_geneigensolve)- Wraps
dsygvx/zhegvx - Implemented with ifdefs in an inc file
- Wraps
-
X(eigensolve)- Wraps
lapack_syev/lapack_heev - Implemented with ifdefs in an inc file
- Wraps
-
X(lowest_eigensolve)- Computes the
klowest eigenvalues and the eigenvectors of a symmetric/Hermitian matrix - Wraps
dsyevx/zheevx - Implemented with ifdefs in an inc file
- Computes the
-
X(determinant)- Wraps
lapack_getrf
- Wraps
-
X(direct_inverse)- Wraps
lapack_getri
- Wraps
-
X(matrix_norm2)- Norm of a 2D matrix
-
X(sym_inverse)- Invert a real/complex symmetric square matrix a
- Wraps
lapack_sytri
-
dlinsyssolve- Compute the solution to a real system of linear equations A*X = B,
- Wraps
X(gesvx)
-
zlinsyssolve- Compute the solution to a complex system of linear equations A*X = B,
- Wraps
X(gesvx)... upon skimming, looks identical todlinsyssolve
-
dsingular_value_decomp- Singular value decomposition, on real matrix
- Wraps
X(gesvd)
-
zsingular_value_decomp- Singular value decomposition, on complex matrix
- Wraps
X(gesvd)
-
dsvd_inverse- Pseudo-inverse on real matrix
-
zsvd_inverse- Pseudo-inverse on complex matrix
-
lalg_zpseudoinverse* Pseudo-inverse on complex matrix * Completely redundant, and should be replaced byzsvd_inverseorX(lalg_pseudo_inverse) -
X(upper_triangular_inverse)- Calculate the inverse of a real/complex upper triangular matrix
- Wraps
X(trtri)
-
X(least_squares_vec)- No docs
- Wraps
lapack_gelssbut differs in its use ofrworkfor complex - Implemented with ifdefs in an inc file
-
X(eigensolve_parallel)- Wrapper for scalapack/ELPA
- Would benefit from splitting
-
X(inverse)- Interface to different inversion routines
X(lalg_matrix_function)
Group as:
New folder lapack_drivers/
- decompositon.F90
dsingular_value_decompzsingular_value_decompX(cholesky)X(lalg_matrix_function)
- eigensolver.F90
-
X(geneigensolve). X(eigensolve_nonh)X(lowest_geneigensolve)X(lowest_geneigensolve)X(eigensolve)X(lowest_eigensolve)X(eigensolve_parallel)
-
- inversion.F90
X(direct_inverse)dsvd_inversezsvd_inverseX(upper_triangular_inverse)X(inverse)
- matrix_properties.F90
X(determinant)X(matrix_norm2)
- linear_systems.F90
dlinsyssolvezlinsyssolveX(least_squares_vec)
Edited by Alex Buccheri