34#include "base/base_uses.f90"
38 CHARACTER(len=*),
PARAMETER,
PRIVATE :: moduleN =
'cp_dbcsr_cholesky'
62 INTEGER,
INTENT(in),
OPTIONAL :: n
66 CHARACTER(len=*),
PARAMETER :: routinen =
'cp_dbcsr_cholesky_decompose'
68 INTEGER :: handle, my_n, nfullcols_total, &
73 CALL timeset(routinen, handle)
76 CALL dbcsr_get_info(matrix, nfullrows_total=nfullrows_total, nfullcols_total=nfullcols_total)
79 ncol_global=nfullcols_total, para_env=para_env)
80 CALL cp_fm_create(fm_matrix, fm_struct, name=
"fm_matrix")
85 my_n = min(fm_matrix%matrix_struct%nrow_global, &
86 fm_matrix%matrix_struct%ncol_global)
115 INTEGER,
INTENT(in),
OPTIONAL :: n
118 LOGICAL,
INTENT(IN) :: uplo_to_full
120 CHARACTER(len=*),
PARAMETER :: routinen =
'cp_dbcsr_cholesky_invert'
122 INTEGER :: handle, my_n, nfullcols_total, &
127 CALL timeset(routinen, handle)
130 CALL dbcsr_get_info(matrix, nfullrows_total=nfullrows_total, nfullcols_total=nfullcols_total)
133 ncol_global=nfullrows_total, para_env=para_env)
134 CALL cp_fm_create(fm_matrix, fm_struct, name=
"fm_matrix")
139 my_n = min(fm_matrix%matrix_struct%nrow_global, &
140 fm_matrix%matrix_struct%ncol_global)
148 IF (uplo_to_full)
THEN
149 CALL cp_fm_create(fm_matrix_tmp, fm_matrix%matrix_struct, name=
"fm_matrix_tmp")
158 CALL timestop(handle)
177 INTEGER,
INTENT(IN) :: neig
179 CHARACTER(LEN=*),
INTENT(IN) :: op
180 CHARACTER(LEN=*),
INTENT(IN),
OPTIONAL :: pos, transa
184 CHARACTER(len=*),
PARAMETER :: routinen =
'cp_dbcsr_cholesky_restore'
186 CHARACTER :: chol_pos, chol_transa
187 INTEGER :: handle, nfullcols_total, nfullrows_total
189 TYPE(
cp_fm_type) :: fm_matrix, fm_matrixb, fm_matrixout
191 CALL timeset(routinen, handle)
195 CALL dbcsr_get_info(matrix, nfullrows_total=nfullrows_total, nfullcols_total=nfullcols_total)
197 ncol_global=nfullcols_total, para_env=para_env)
198 CALL cp_fm_create(fm_matrix, fm_struct, name=
"fm_matrix")
201 CALL dbcsr_get_info(matrixb, nfullrows_total=nfullrows_total, nfullcols_total=nfullcols_total)
203 ncol_global=nfullcols_total, para_env=para_env)
204 CALL cp_fm_create(fm_matrixb, fm_struct, name=
"fm_matrixb")
207 CALL dbcsr_get_info(matrixout, nfullrows_total=nfullrows_total, nfullcols_total=nfullcols_total)
209 ncol_global=nfullcols_total, para_env=para_env)
210 CALL cp_fm_create(fm_matrixout, fm_struct, name=
"fm_matrixout")
217 IF (op /=
"SOLVE" .AND. op /=
"MULTIPLY") &
218 cpabort(
"wrong argument op")
220 IF (
PRESENT(pos))
THEN
227 cpabort(
"wrong argument pos")
234 IF (
PRESENT(transa)) chol_transa = transa
236 IF ((fm_matrix%use_sp .NEQV. fm_matrixb%use_sp) .OR. (fm_matrix%use_sp .NEQV. fm_matrixout%use_sp)) &
237 cpabort(
"not the same precision")
247 CALL timestop(handle)
methods related to the blacs parallel environment
subroutine, public dbcsr_get_info(matrix, nblkrows_total, nblkcols_total, nfullrows_total, nfullcols_total, nblkrows_local, nblkcols_local, nfullrows_local, nfullcols_local, my_prow, my_pcol, local_rows, local_cols, proc_row_dist, proc_col_dist, row_blk_size, col_blk_size, row_blk_offset, col_blk_offset, distribution, name, matrix_type, group)
...
Interface to (sca)lapack for the Cholesky based procedures.
subroutine, public cp_dbcsr_cholesky_decompose(matrix, n, para_env, blacs_env)
used to replace a symmetric positive def. matrix M with its cholesky decomposition U: M = U^T * U,...
subroutine, public cp_dbcsr_cholesky_restore(matrix, neig, matrixb, matrixout, op, pos, transa, para_env, blacs_env)
...
subroutine, public cp_dbcsr_cholesky_invert(matrix, n, para_env, blacs_env, uplo_to_full)
used to replace the cholesky decomposition by the inverse
DBCSR operations in CP2K.
subroutine, public copy_dbcsr_to_fm(matrix, fm)
Copy a DBCSR matrix to a BLACS matrix.
subroutine, public copy_fm_to_dbcsr(fm, matrix, keep_sparsity)
Copy a BLACS matrix to a dbcsr matrix.
basic linear algebra operations for full matrices
subroutine, public cp_fm_potrf(fm_matrix, n, uplo)
Cholesky decomposition.
subroutine, public cp_fm_potri(fm_matrix, n, uplo)
Invert trianguar matrix.
subroutine, public cp_fm_cholesky_restore(fm_matrix, neig, fm_matrixb, fm_matrixout, op, pos, transa)
...
subroutine, public cp_fm_uplo_to_full(matrix, work, uplo)
given a triangular matrix according to uplo, computes the corresponding full matrix
represent the structure of a full matrix
subroutine, public cp_fm_struct_create(fmstruct, para_env, context, nrow_global, ncol_global, nrow_block, ncol_block, descriptor, first_p_pos, local_leading_dimension, template_fmstruct, square_blocks, force_block)
allocates and initializes a full matrix structure
subroutine, public cp_fm_struct_release(fmstruct)
releases a full matrix structure
represent a full matrix distributed on many processors
subroutine, public cp_fm_create(matrix, matrix_struct, name, use_sp)
creates a new full matrix with the given structure
Interface to the message passing library MPI.
represent a blacs multidimensional parallel environment (for the mpi corrispective see cp_paratypes/m...
keeps the information about the structure of a full matrix
stores all the informations relevant to an mpi environment