Line data Source code
1 : !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
2 : !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
3 : !!!! !!!!
4 : !!!! ParaMonte: Parallel Monte Carlo and Machine Learning Library. !!!!
5 : !!!! !!!!
6 : !!!! Copyright (C) 2012-present, The Computational Data Science Lab !!!!
7 : !!!! !!!!
8 : !!!! This file is part of the ParaMonte library. !!!!
9 : !!!! !!!!
10 : !!!! LICENSE !!!!
11 : !!!! !!!!
12 : !!!! https://github.com/cdslaborg/paramonte/blob/main/LICENSE.md !!!!
13 : !!!! !!!!
14 : !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
15 : !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
16 :
17 : !> \brief
18 : !> This include file contains procedure implementations of [pm_matrixClass](@ref pm_matrixClass).
19 : !>
20 : !> \finmain
21 : !>
22 : !> \author
23 : !> \AmirShahmoradi, Monday March 6, 2017, 3:22 pm, Institute for Computational Engineering and Sciences (ICES), The University of Texas at Austin.<br>
24 :
25 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
26 :
27 : ! Define the logical equality check.
28 : #if LK_ENABLED
29 : #define ISEQ .eqv.
30 : #else
31 : #define ISEQ ==
32 : #endif
33 :
34 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
35 : #if isMatClass_ENABLED && Herm_ENABLED || Symm_ENABLED
36 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
37 :
38 : #if Herm_ENABLED && CK_ENABLED
39 : #define GET_CONJG(X) conjg(X)
40 : #elif Symm_ENABLED || Herm_ENABLED
41 : #define GET_CONJG(X) X
42 : #else
43 : #error "Unrecorgnized interface."
44 : #endif
45 : integer(IK) :: irow, icol
46 1234433 : itis = logical(size(mat, 1, IK) == size(mat, 2, IK), LK) ! check square shape.
47 1234433 : if (itis) then
48 3699634 : loopOverCol: do icol = 1, size(mat, 2, IK)
49 8629673 : loopOverRow: do irow = 1, size(mat, 1, IK)
50 4930108 : if (mat(irow, icol) ISEQ GET_CONJG(mat(icol, irow))) cycle loopOverRow
51 : itis = .false._LK
52 7395288 : return
53 : end do loopOverRow
54 : end do loopOverCol
55 : end if
56 :
57 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
58 : #elif isMatClass_ENABLED && PosDef_ENABLED && Ful_ENABLED
59 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
60 :
61 1234233 : itis = logical(isMatClass(mat, hermitian), LK)
62 1234233 : if (itis) itis = isMatClass(mat, posdefmat, uppDia, rdpack)
63 :
64 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
65 : #elif isMatClass_ENABLED && PosDef_ENABLED && (Upp_ENABLED || Low_ENABLED)
66 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
67 :
68 : integer(IK) :: info
69 : #if CK_ENABLED
70 94 : complex(CKC) :: chol(size(mat, 1, IK), size(mat, 2, IK))
71 : #elif RK_ENABLED
72 2468344 : real(RKC) :: chol(size(mat, 1, IK), size(mat, 2, IK))
73 : #else
74 : #error "Unrecorgnized interface."
75 : #endif
76 : #if RDP_ENABLED
77 : itis = logical(size(mat, 1, IK) == size(mat, 2, IK), LK) ! check square shape.
78 : #elif RFP_ENABLED
79 0 : itis = isMatPack(pack, shape(mat, IK))
80 : #else
81 : #error "Unrecorgnized interface."
82 : #endif
83 1234219 : if (itis) then
84 : !call setMatCopy(chol, rdpack, mat, pack, subset)
85 : !call setMatChol(chol, subset, info, recursion)
86 1234219 : call setMatChol(mat, subset, info, chol, nothing)
87 : end if
88 1234219 : itis = logical(info == 0_IK, LK)
89 : #else
90 : !%%%%%%%%%%%%%%%%%%%%%%%%%
91 : #error "Unrecorgnized interface."
92 : !%%%%%%%%%%%%%%%%%%%%%%%%%
93 : #endif
94 : #undef GET_CONJG
95 : #undef ISEQ
|