ParaMonte Fortran 2.0.0
Parallel Monte Carlo and Machine Learning Library
See the latest version documentation.
pm_matrixLUP::setMatLUP Interface Reference

Return the LU-Pivoted decomposition of the input square matrix mat(ndim,ndim).
More...

Detailed Description

Return the LU-Pivoted decomposition of the input square matrix mat(ndim,ndim).

The LUP factorization takes the form,

\begin{equation} \text{mat} = P * L * U \end{equation}

where,

  1. \(P\) is the permutation matrix,
  2. \(L\) is lower triangular with unit diagonal elements (that are missing in the output mat),
  3. \(U\) is upper triangular of the decomposition.

The abbreviation LUP stands for the LU factorization with partial Pivoting.

Parameters
[in,out]mat: The input contiguous square matrix of shape (ndim, ndim) of,
  1. type complex of kind any supported by the processor (e.g., CK, CK32, CK64, or CK128),
  2. type real of kind any supported by the processor (e.g., RK, RK32, RK64, or RK128),
containing the matrix whose LUP factorization must be returned.
On output, mat is completely overwritten by its LU Pivoted decomposition.
[out]rperm: The output contiguous vector of size ndim of type integer of default kind IK containing the pivot indices (row permutations).
For 1 <= i <= ndim, the ith row of the matrix is interchanged with row rperm(i).
[out]info: The output scalar integer of default kind IK that is non-zero if a singular matrix is detected, indicating the LUP decomposition failure.


Possible calling interfaces

call setMatLUP(mat(1 : ndim, 1 : ndim), rperm(1 : ndim), info)
Return the LU-Pivoted decomposition of the input square matrix mat(ndim,ndim).
This module contains procedures and generic interfaces relevant to the partially LU Pivoted decomposi...
Warning
The condition size(mat, 1) == size(mat, 2)) must hold for the corresponding input arguments (unless dispatch to LAPACK is enabled).
The condition size(rperm) == shape(mat, 1, IK) must hold for the corresponding input arguments.
These conditions are verified only if the library is built with the preprocessor macro CHECK_ENABLED=1.
The pure procedure(s) documented herein become impure when the ParaMonte library is compiled with preprocessor macro CHECK_ENABLED=1.
By default, these procedures are pure in release build and impure in debug and testing builds.
Remarks
This routine can be used in combination with the generic interfaces of pm_matrixMulTri to iteratively solve systems of linear equations or to invert matrices.
See also
getMatInv
setMatInv
getMatChol
setMatChol
setMatLUP
BLAS/LAPACK equivalent:
The procedures under discussion combine, modernize, and extend the interface and functionalities of Version 3.11 of BLAS/LAPACK routine(s): SGETRF, DGETRF, CGETRF, and ZGETRF.


Example usage

1program example
2
3 use pm_kind, only: IK, LK, SK, RKS, RKD, RKH
6 use pm_matrixLUP, only: setMatLUP
7 use pm_io, only: display_type
8
9 implicit none
10
11 integer(IK), allocatable :: rperm(:), rperm_ref(:)
12 integer(IK) :: info
13
14 type(display_type) :: disp
15 disp = display_type(file = "main.out.F90")
16
17 call disp%skip
18 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
19 call disp%show("! Compute the LU-Pivoted decomposition of a real square matrix.")
20 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
21 call disp%skip
22
23 block
24 use pm_kind, only: TKG => RKS
25 real(TKG), allocatable :: mat_lup(:,:), lup_ref(:,:)
26 mat_lup = reshape( [ 1.0_TKG, +1.2_TKG, 1.4_TKG, 1.6_TKG, 1.8_TKG, 2.0_TKG, 2.2_TKG, 2.4_TKG, 2.6_TKG &
27 , 1.2_TKG, +1.0_TKG, 1.2_TKG, 1.4_TKG, 1.6_TKG, 1.8_TKG, 2.0_TKG, 2.2_TKG, 2.4_TKG &
28 , 1.4_TKG, +1.2_TKG, 1.0_TKG, 1.2_TKG, 1.4_TKG, 1.6_TKG, 1.8_TKG, 2.0_TKG, 2.2_TKG &
29 , 1.6_TKG, +1.4_TKG, 1.2_TKG, 1.0_TKG, 1.2_TKG, 1.4_TKG, 1.6_TKG, 1.8_TKG, 2.0_TKG &
30 , 1.8_TKG, +1.6_TKG, 1.4_TKG, 1.2_TKG, 1.0_TKG, 1.2_TKG, 1.4_TKG, 1.6_TKG, 1.8_TKG &
31 , 2.0_TKG, +1.8_TKG, 1.6_TKG, 1.4_TKG, 1.2_TKG, 1.0_TKG, 1.2_TKG, 1.4_TKG, 1.6_TKG &
32 , 2.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TKG, 0.0_TKG, 0.4_TKG &
45 ], shape = [9, 9], order = [2, 1])
46 rperm_ref = [9, 9, 9, 9, 9, 9, 9, 9, 9]
47 call disp%skip
48 call disp%show("mat_lup")
49 call disp%show( mat_lup )
50 call disp%show("call setResized(rperm, size(mat_lup, 1, IK))")
51 call setResized(rperm, size(mat_lup, 1, IK))
52 call disp%show("call setMatLUP(mat_lup, rperm, info); if (info /= 0) error stop")
53 call setMatLUP(mat_lup, rperm, info); if (info /= 0) error stop
54 call disp%show("mat_lup")
55 call disp%show( mat_lup )
56 call disp%show("call setResized(rperm, size(mat_lup, 1, IK)) ! reconstruct the original matrix.")
57 call setResized(rperm, size(mat_lup, 1, IK))
58 call disp%show("lup_ref ! reference matrix rounded to 1 significant digit.")
59 call disp%show( lup_ref )
60 call disp%show("lup_ref - mat_lup, format = SK_'(*(f0.1,:,"", ""))'")
61 call disp%show( lup_ref - mat_lup, format = SK_"(*(f0.1,:,"", ""))")
62 call disp%show("rperm_ref")
63 call disp%show( rperm_ref )
64 call disp%show("rperm")
65 call disp%show( rperm )
66 call disp%skip
67 end block
68
69 block
70 use pm_kind, only: TKG => RKD
71 real(TKG), allocatable :: mat_lup(:,:), lup_ref(:,:)
72 mat_lup = reshape( [ 1.0_TKG, +1.2_TKG, 1.4_TKG, 1.6_TKG, 1.8_TKG, 2.0_TKG, 2.2_TKG, 2.4_TKG, 2.6_TKG &
73 , 1.2_TKG, +1.0_TKG, 1.2_TKG, 1.4_TKG, 1.6_TKG, 1.8_TKG, 2.0_TKG, 2.2_TKG, 2.4_TKG &
74 , 1.4_TKG, +1.2_TKG, 1.0_TKG, 1.2_TKG, 1.4_TKG, 1.6_TKG, 1.8_TKG, 2.0_TKG, 2.2_TKG &
75 , 1.6_TKG, +1.4_TKG, 1.2_TKG, 1.0_TKG, 1.2_TKG, 1.4_TKG, 1.6_TKG, 1.8_TKG, 2.0_TKG &
76 , 1.8_TKG, +1.6_TKG, 1.4_TKG, 1.2_TKG, 1.0_TKG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KG, 0.0_TKG, 0.0_TKG, 0.0_TKG, 0.0_TKG, 0.0_TKG, 0.4_TKG, 0.8_TKG &
90 , 0.9_TKG, -0.1_TKG, 0.0_TKG, 0.0_TKG, 0.0_TKG, 0.0_TKG, 0.0_TKG, 0.0_TKG, 0.4_TKG &
91 ], shape = [9, 9], order = [2, 1])
92 rperm_ref = [9, 9, 9, 9, 9, 9, 9, 9, 9]
93 call disp%skip
94 call disp%show("mat_lup")
95 call disp%show( mat_lup )
96 call disp%show("call setResized(rperm, size(mat_lup, 1, IK))")
97 call setResized(rperm, size(mat_lup, 1, IK))
98 call disp%show("call setMatLUP(mat_lup, rperm, info); if (info /= 0) error stop")
99 call setMatLUP(mat_lup, rperm, info); if (info /= 0) error stop
100 call disp%show("mat_lup")
101 call disp%show( mat_lup )
102 call disp%show("call setResized(rperm, size(mat_lup, 1, IK)) ! reconstruct the original matrix.")
103 call setResized(rperm, size(mat_lup, 1, IK))
104 call disp%show("lup_ref ! reference matrix rounded to 1 significant digit.")
105 call disp%show( lup_ref )
106 call disp%show("lup_ref - mat_lup, format = SK_'(*(f0.1,:,"", ""))'")
107 call disp%show( lup_ref - mat_lup, format = SK_"(*(f0.1,:,"", ""))")
108 call disp%show("rperm_ref")
109 call disp%show( rperm_ref )
110 call disp%show("rperm")
111 call disp%show( rperm )
112 call disp%skip
113 end block
114
115 block
116 use pm_kind, only: TKG => RKH
117 real(TKG), allocatable :: mat_lup(:,:), lup_ref(:,:)
118 mat_lup = reshape( [ 1.0_TKG, +1.2_TKG, 1.4_TKG, 1.6_TKG, 1.8_TKG, 2.0_TKG, 2.2_TKG, 2.4_TKG, 2.6_TKG &
119 , 1.2_TKG, +1.0_TKG, 1.2_TKG, 1.4_TKG, 1.6_TKG, 1.8_TKG, 2.0_TKG, 2.2_TKG, 2.4_TKG &
120 , 1.4_TKG, +1.2_TKG, 1.0_TKG, 1.2_TKG, 1.4_TKG, 1.6_TKG, 1.8_TKG, 2.0_TKG, 2.2_TKG &
121 ,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.8_TKG, 1.2_TKG, 1.6_TKG &
134 , 0.8_TKG, -0.2_TKG, 0.0_TKG, 0.0_TKG, 0.0_TKG, 0.0_TKG, 0.4_TKG, 0.8_TKG, 1.2_TKG &
135 , 0.8_TKG, -0.1_TKG, 0.0_TKG, 0.0_TKG, 0.0_TKG, 0.0_TKG, 0.0_TKG, 0.4_TKG, 0.8_TKG &
136 , 0.9_TKG, -0.1_TKG, 0.0_TKG, 0.0_TKG, 0.0_TKG, 0.0_TKG, 0.0_TKG, 0.0_TKG, 0.4_TKG &
137 ], shape = [9, 9], order = [2, 1])
138 rperm_ref = [9, 9, 9, 9, 9, 9, 9, 9, 9]
139 call disp%skip
140 call disp%show("mat_lup")
141 call disp%show( mat_lup )
142 call disp%show("call setResized(rperm, size(mat_lup, 1, IK))")
143 call setResized(rperm, size(mat_lup, 1, IK))
144 call disp%show("call setMatLUP(mat_lup, rperm, info); if (info /= 0) error stop")
145 call setMatLUP(mat_lup, rperm, info); if (info /= 0) error stop
146 call disp%show("mat_lup")
147 call disp%show( mat_lup )
148 call disp%show("call setResized(rperm, size(mat_lup, 1, IK)) ! reconstruct the original matrix.")
149 call setResized(rperm, size(mat_lup, 1, IK))
150 call disp%show("lup_ref ! reference matrix rounded to 1 significant digit.")
151 call disp%show( lup_ref )
152 call disp%show("lup_ref - mat_lup, format = SK_'(*(f0.1,:,"", ""))'")
153 call disp%show( lup_ref - mat_lup, format = SK_"(*(f0.1,:,"", ""))")
154 call disp%show("rperm_ref")
155 call disp%show( rperm_ref )
156 call disp%show("rperm")
157 call disp%show( rperm )
158 call disp%skip
159 end block
160
161#if 1 || LAPACK_ENABLED
162 call disp%skip
163 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
164 call disp%show("! Compute the LU-Pivoted decomposition of a complex square matrix.")
165 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
166 call disp%skip
167
168 block
169 use pm_kind, only: TKG => CKS
170 complex(TKG), allocatable :: mat_lup(:,:), lup_ref(:,:)
171 mat_lup = reshape( [ (2.0, 1.0), (2.4,-1.0), (2.8,-1.0), (3.2,-1.0), (3.6,-1.0), (4.0,-1.0), (4.4,-1.0), (4.8,-1.0), (5.2,-1.0) &
172 , (2.4, 1.0), (2.0, 1.0), (2.4,-1.0), (2.8,-1.0), (3.2,-1.0), (3.6,-1.0), (4.0,-1.0), (4.4,-1.0), (4.8,-1.0) &
173 , (2.8, 1.0), (2.4, 1.0), (2.0, 1.0), (2.4,-1.0), (2.8,-1.0), (3.2,-1.0), (3.6,-1.0), (4.0,-1.0), (4.4,-1.0) &
174 , (3.2, 1.0), (2.8, 1.0), (2.4, 1.0), (2.0, 1.0), (2.4,-1.0), (2.8,-1.0), (3.2,-1.0), (3.6,-1.0), (4.0,-1.0) &
175 , (3.6, 1.0), (3.2, 1.0), (2.8, 1.0), (2.4, 1.0), (2.0, 1.0), (2.4,-1.0), (2.8,-1.0), (3.2,-1.0), (3.6,-1.0) &
176 , (4.0, 1.0), (3.6, 1.0), (3.2, 1.0), (2.8, 1.0), (2.4, 1.0), (2.0, 1.0), (2.4,-1.0), (2.8,-1.0), (3.2,-1.0) &
177 , (4.4, 1.0), (4.0, 1.0), (3.6, 1.0), (3.2, 1.0), (2.8, 1.0), (2.4, 1.0), (2.0, 1.0), (2.4,-1.0), (2.8,-1.0) &
178 , (4.8, 1.0), (4.4, 1.0), (4.0, 1.0), (3.6, 1.0), (3.2, 1.0), (2.8, 1.0), (2.4, 1.0), (2.0, 1.0), (2.4,-1.0) &
179 , (5.2, 1.0), (4.8, 1.0), (4.4, 1.0), (4.0, 1.0), (3.6, 1.0), (3.2, 1.0), (2.8, 1.0), (2.4, 1.0), (2.0, 1.0) &
180 ], shape = [9, 9], order = [2, 1])
181 lup_ref = reshape( [ (5.2, 1.0), (4.8, 1.0), (4.4, 1.0), (4.0, 1.0), (+3.6, 1.0), (3.2, 1.0), (2.8, 1.0), (2.4, 1.0), (2.0, 1.0) &
182 , (0.4, 0.1), (0.6,-2.0), (1.1,-1.9), (1.7,-1.9), (+2.3,-1.8), (2.8,-1.8), (3.4,-1.7), (3.9,-1.7), (4.5,-1.6) &
183 , (0.5, 0.1), (0.0,-0.1), (0.6,-1.9), (1.2,-1.8), (+1.8,-1.7), (2.5,-1.6), (3.1,-1.5), (3.7,-1.4), (4.3,-1.3) &
184 , (0.6, 0.1), (0.0,-0.1),(-0.1,-0.1), (0.7,-1.9), (+1.3,-1.7), (2.0,-1.6), (2.7,-1.5), (3.4,-1.4), (4.0,-1.2) &
185 , (0.6, 0.1), (0.0,-0.1),(-0.1,-0.1),(-0.1, 0.0), (+0.7,-1.9), (1.5,-1.7), (2.2,-1.6), (2.9,-1.5), (3.7,-1.3) &
186 , (0.7, 0.1), (0.0,-0.1), (0.0, 0.0),(-0.1, 0.0), (-0.1, 0.0), (0.8,-1.9), (1.6,-1.8), (2.4,-1.6), (3.2,-1.5) &
187 , (0.8, 0.0), (0.0, 0.0), (0.0, 0.0), (0.0, 0.0), (+0.0, 0.0), (0.0, 0.0), (0.8,-1.9), (1.7,-1.8), (2.5,-1.8) &
188 , (0.9, 0.0), (0.0, 0.0), (0.0, 0.0), (0.0, 0.0), (+0.0, 0.0), (0.0, 0.0), (0.0, 0.0), (0.8,-2.0), (1.7,-1.9) &
189 , (0.9, 0.0), (0.0, 0.0), (0.0, 0.0), (0.0, 0.0), (+0.0, 0.0), (0.0, 0.0), (0.0, 0.0), (0.0, 0.0), (0.8,-2.0) &
190 ], shape = [9, 9], order = [2, 1])
191 rperm_ref = [9, 9, 9, 9, 9, 9, 9, 9, 9]
192 call disp%skip
193 call disp%show("mat_lup")
194 call disp%show( mat_lup )
195 call disp%show("call setResized(rperm, size(mat_lup, 1, IK))")
196 call setResized(rperm, size(mat_lup, 1, IK))
197 call disp%show("call setMatLUP(mat_lup, rperm, info); if (info /= 0) error stop")
198 call setMatLUP(mat_lup, rperm, info); if (info /= 0) error stop
199 call disp%show("mat_lup")
200 call disp%show( mat_lup )
201 call disp%show("call setResized(rperm, size(mat_lup, 1, IK)) ! reconstruct the original matrix.")
202 call setResized(rperm, size(mat_lup, 1, IK))
203 call disp%show("lup_ref ! reference matrix rounded to 1 significant digit.")
204 call disp%show( lup_ref )
205 call disp%show("lup_ref - mat_lup, format = SK_'(*(""("",f0.1,"","",f0.1,"")"",:,"", ""))'")
206 call disp%show( lup_ref - mat_lup, format = SK_"(*(""("",f0.1,"","",f0.1,"")"",:,"", ""))")
207 call disp%show("rperm_ref")
208 call disp%show( rperm_ref )
209 call disp%show("rperm")
210 call disp%show( rperm )
211 call disp%skip
212 end block
213
214 block
215 use pm_kind, only: TKG => CKD
216 complex(TKG), allocatable :: mat_lup(:,:), lup_ref(:,:)
217 mat_lup = reshape( [ (2.0, 1.0), (2.4,-1.0), (2.8,-1.0), (3.2,-1.0), (3.6,-1.0), (4.0,-1.0), (4.4,-1.0), (4.8,-1.0), (5.2,-1.0) &
218 , (2.4, 1.0), (2.0, 1.0), (2.4,-1.0), (2.8,-1.0), (3.2,-1.0), (3.6,-1.0), (4.0,-1.0), (4.4,-1.0), (4.8,-1.0) &
219 , (2.8, 1.0), (2.4, 1.0), (2.0, 1.0), (2.4,-1.0), (2.8,-1.0), (3.2,-1.0), (3.6,-1.0), (4.0,-1.0), (4.4,-1.0) &
220 , (3.2, 1.0), (2.8, 1.0), (2.4, 1.0), (2.0, 1.0), (2.4,-1.0), (2.8,-1.0), (3.2,-1.0), (3.6,-1.0), (4.0,-1.0) &
221 , (3.6, 1.0), (3.2, 1.0), (2.8, 1.0), (2.4, 1.0), (2.0, 1.0), (2.4,-1.0), (2.8,-1.0), (3.2,-1.0), (3.6,-1.0) &
222 , (4.0, 1.0), (3.6, 1.0), (3.2, 1.0), (2.8, 1.0), (2.4, 1.0), (2.0, 1.0), (2.4,-1.0), (2.8,-1.0), (3.2,-1.0) &
223 , (4.4, 1.0), (4.0, 1.0), (3.6, 1.0), (3.2, 1.0), (2.8, 1.0), (2.4, 1.0), (2.0, 1.0), (2.4,-1.0), (2.8,-1.0) &
224 , (4.8, 1.0), (4.4, 1.0), (4.0, 1.0), (3.6, 1.0), (3.2, 1.0), (2.8, 1.0), (2.4, 1.0), (2.0, 1.0), (2.4,-1.0) &
225 , (5.2, 1.0), (4.8, 1.0), (4.4, 1.0), (4.0, 1.0), (3.6, 1.0), (3.2, 1.0), (2.8, 1.0), (2.4, 1.0), (2.0, 1.0) &
226 ], shape = [9, 9], order = [2, 1])
227 lup_ref = reshape( [ (5.2, 1.0), (4.8, 1.0), (4.4, 1.0), (4.0, 1.0), (+3.6, 1.0), (3.2, 1.0), (2.8, 1.0), (2.4, 1.0), (2.0, 1.0) &
228 , (0.4, 0.1), (0.6,-2.0), (1.1,-1.9), (1.7,-1.9), (+2.3,-1.8), (2.8,-1.8), (3.4,-1.7), (3.9,-1.7), (4.5,-1.6) &
229 , (0.5, 0.1), (0.0,-0.1), (0.6,-1.9), (1.2,-1.8), (+1.8,-1.7), (2.5,-1.6), (3.1,-1.5), (3.7,-1.4), (4.3,-1.3) &
230 , (0.6, 0.1), (0.0,-0.1),(-0.1,-0.1), (0.7,-1.9), (+1.3,-1.7), (2.0,-1.6), (2.7,-1.5), (3.4,-1.4), (4.0,-1.2) &
231 , (0.6, 0.1), (0.0,-0.1),(-0.1,-0.1),(-0.1, 0.0), (+0.7,-1.9), (1.5,-1.7), (2.2,-1.6), (2.9,-1.5), (3.7,-1.3) &
232 , (0.7, 0.1), (0.0,-0.1), (0.0, 0.0),(-0.1, 0.0), (-0.1, 0.0), (0.8,-1.9), (1.6,-1.8), (2.4,-1.6), (3.2,-1.5) &
233 , (0.8, 0.0), (0.0, 0.0), (0.0, 0.0), (0.0, 0.0), (+0.0, 0.0), (0.0, 0.0), (0.8,-1.9), (1.7,-1.8), (2.5,-1.8) &
234 , (0.9, 0.0), (0.0, 0.0), (0.0, 0.0), (0.0, 0.0), (+0.0, 0.0), (0.0, 0.0), (0.0, 0.0), (0.8,-2.0), (1.7,-1.9) &
235 , (0.9, 0.0), (0.0, 0.0), (0.0, 0.0), (0.0, 0.0), (+0.0, 0.0), (0.0, 0.0), (0.0, 0.0), (0.0, 0.0), (0.8,-2.0) &
236 ], shape = [9, 9], order = [2, 1])
237 rperm_ref = [9, 9, 9, 9, 9, 9, 9, 9, 9]
238 call disp%skip
239 call disp%show("mat_lup")
240 call disp%show( mat_lup )
241 call disp%show("call setResized(rperm, size(mat_lup, 1, IK))")
242 call setResized(rperm, size(mat_lup, 1, IK))
243 call disp%show("call setMatLUP(mat_lup, rperm, info); if (info /= 0) error stop")
244 call setMatLUP(mat_lup, rperm, info); if (info /= 0) error stop
245 call disp%show("mat_lup")
246 call disp%show( mat_lup )
247 call disp%show("call setResized(rperm, size(mat_lup, 1, IK)) ! reconstruct the original matrix.")
248 call setResized(rperm, size(mat_lup, 1, IK))
249 call disp%show("lup_ref ! reference matrix rounded to 1 significant digit.")
250 call disp%show( lup_ref )
251 call disp%show("lup_ref - mat_lup, format = SK_'(*(""("",f0.1,"","",f0.1,"")"",:,"", ""))'")
252 call disp%show( lup_ref - mat_lup, format = SK_"(*(""("",f0.1,"","",f0.1,"")"",:,"", ""))")
253 call disp%show("rperm_ref")
254 call disp%show( rperm_ref )
255 call disp%show("rperm")
256 call disp%show( rperm )
257 call disp%skip
258 end block
259
260 block
261 use pm_kind, only: TKG => CKH
262 complex(TKG), allocatable :: mat_lup(:,:), lup_ref(:,:)
263 mat_lup = reshape( [ (2.0, 1.0), (2.4,-1.0), (2.8,-1.0), (3.2,-1.0), (3.6,-1.0), (4.0,-1.0), (4.4,-1.0), (4.8,-1.0), (5.2,-1.0) &
264 , (2.4, 1.0), (2.0, 1.0), (2.4,-1.0), (2.8,-1.0), (3.2,-1.0), (3.6,-1.0), (4.0,-1.0), (4.4,-1.0), (4.8,-1.0) &
265 , (2.8, 1.0), (2.4, 1.0), (2.0, 1.0), (2.4,-1.0), (2.8,-1.0), (3.2,-1.0), (3.6,-1.0), (4.0,-1.0), (4.4,-1.0) &
266 , (3.2, 1.0), (2.8, 1.0), (2.4, 1.0), (2.0, 1.0), (2.4,-1.0), (2.8,-1.0), (3.2,-1.0), (3.6,-1.0), (4.0,-1.0) &
267 , (3.6, 1.0), (3.2, 1.0), (2.8, 1.0), (2.4, 1.0), (2.0, 1.0), (2.4,-1.0), (2.8,-1.0), (3.2,-1.0), (3.6,-1.0) &
268 , (4.0, 1.0), (3.6, 1.0), (3.2, 1.0), (2.8, 1.0), (2.4, 1.0), (2.0, 1.0), (2.4,-1.0), (2.8,-1.0), (3.2,-1.0) &
269 , (4.4, 1.0), (4.0, 1.0), (3.6, 1.0), (3.2, 1.0), (2.8, 1.0), (2.4, 1.0), (2.0, 1.0), (2.4,-1.0), (2.8,-1.0) &
270 , (4.8, 1.0), (4.4, 1.0), (4.0, 1.0), (3.6, 1.0), (3.2, 1.0), (2.8, 1.0), (2.4, 1.0), (2.0, 1.0), (2.4,-1.0) &
271 , (5.2, 1.0), (4.8, 1.0), (4.4, 1.0), (4.0, 1.0), (3.6, 1.0), (3.2, 1.0), (2.8, 1.0), (2.4, 1.0), (2.0, 1.0) &
272 ], shape = [9, 9], order = [2, 1])
273 lup_ref = reshape( [ (5.2, 1.0), (4.8, 1.0), (4.4, 1.0), (4.0, 1.0), (+3.6, 1.0), (3.2, 1.0), (2.8, 1.0), (2.4, 1.0), (2.0, 1.0) &
274 , (0.4, 0.1), (0.6,-2.0), (1.1,-1.9), (1.7,-1.9), (+2.3,-1.8), (2.8,-1.8), (3.4,-1.7), (3.9,-1.7), (4.5,-1.6) &
275 , (0.5, 0.1), (0.0,-0.1), (0.6,-1.9), (1.2,-1.8), (+1.8,-1.7), (2.5,-1.6), (3.1,-1.5), (3.7,-1.4), (4.3,-1.3) &
276 , (0.6, 0.1), (0.0,-0.1),(-0.1,-0.1), (0.7,-1.9), (+1.3,-1.7), (2.0,-1.6), (2.7,-1.5), (3.4,-1.4), (4.0,-1.2) &
277 , (0.6, 0.1), (0.0,-0.1),(-0.1,-0.1),(-0.1, 0.0), (+0.7,-1.9), (1.5,-1.7), (2.2,-1.6), (2.9,-1.5), (3.7,-1.3) &
278 , (0.7, 0.1), (0.0,-0.1), (0.0, 0.0),(-0.1, 0.0), (-0.1, 0.0), (0.8,-1.9), (1.6,-1.8), (2.4,-1.6), (3.2,-1.5) &
279 , (0.8, 0.0), (0.0, 0.0), (0.0, 0.0), (0.0, 0.0), (+0.0, 0.0), (0.0, 0.0), (0.8,-1.9), (1.7,-1.8), (2.5,-1.8) &
280 , (0.9, 0.0), (0.0, 0.0), (0.0, 0.0), (0.0, 0.0), (+0.0, 0.0), (0.0, 0.0), (0.0, 0.0), (0.8,-2.0), (1.7,-1.9) &
281 , (0.9, 0.0), (0.0, 0.0), (0.0, 0.0), (0.0, 0.0), (+0.0, 0.0), (0.0, 0.0), (0.0, 0.0), (0.0, 0.0), (0.8,-2.0) &
282 ], shape = [9, 9], order = [2, 1])
283 rperm_ref = [9, 9, 9, 9, 9, 9, 9, 9, 9]
284 call disp%skip
285 call disp%show("mat_lup")
286 call disp%show( mat_lup )
287 call disp%show("call setResized(rperm, size(mat_lup, 1, IK))")
288 call setResized(rperm, size(mat_lup, 1, IK))
289 call disp%show("call setMatLUP(mat_lup, rperm, info); if (info /= 0) error stop")
290 call setMatLUP(mat_lup, rperm, info); if (info /= 0) error stop
291 call disp%show("mat_lup")
292 call disp%show( mat_lup )
293 call disp%show("call setResized(rperm, size(mat_lup, 1, IK)) ! reconstruct the original matrix.")
294 call setResized(rperm, size(mat_lup, 1, IK))
295 call disp%show("lup_ref ! reference matrix rounded to 1 significant digit.")
296 call disp%show( lup_ref )
297 call disp%show("lup_ref - mat_lup, format = SK_'(*(""("",f0.1,"","",f0.1,"")"",:,"", ""))'")
298 call disp%show( lup_ref - mat_lup, format = SK_"(*(""("",f0.1,"","",f0.1,"")"",:,"", ""))")
299 call disp%show("rperm_ref")
300 call disp%show( rperm_ref )
301 call disp%show("rperm")
302 call disp%show( rperm )
303 call disp%skip
304 end block
305#endif
306
307end program example
Allocate or resize (shrink or expand) an input allocatable scalar string or array of rank 1....
This is a generic method of the derived type display_type with pass attribute.
Definition: pm_io.F90:11726
This is a generic method of the derived type display_type with pass attribute.
Definition: pm_io.F90:11508
Copy a desired subset of the input source matrix of arbitrary shape (:) or (:,:) to the target subset...
This module contains procedures and generic interfaces for resizing allocatable arrays of various typ...
This module contains classes and procedures for input/output (IO) or generic display operations on st...
Definition: pm_io.F90:252
type(display_type) disp
This is a scalar module variable an object of type display_type for general display.
Definition: pm_io.F90:11393
This module defines the relevant Fortran kind type-parameters frequently used in the ParaMonte librar...
Definition: pm_kind.F90:268
integer, parameter LK
The default logical kind in the ParaMonte library: kind(.true.) in Fortran, kind(....
Definition: pm_kind.F90:541
integer, parameter CKH
The scalar integer constant of intrinsic default kind, representing the highest-precision complex kin...
Definition: pm_kind.F90:843
integer, parameter CKS
The single-precision complex kind in Fortran mode. On most platforms, this is a 32-bit real kind.
Definition: pm_kind.F90:570
integer, parameter IK
The default integer kind in the ParaMonte library: int32 in Fortran, c_int32_t in C-Fortran Interoper...
Definition: pm_kind.F90:540
integer, parameter CKD
The double precision complex kind in Fortran mode. On most platforms, this is a 64-bit real kind.
Definition: pm_kind.F90:571
integer, parameter RKD
The double precision real kind in Fortran mode. On most platforms, this is an 64-bit real kind.
Definition: pm_kind.F90:568
integer, parameter SK
The default character kind in the ParaMonte library: kind("a") in Fortran, c_char in C-Fortran Intero...
Definition: pm_kind.F90:539
integer, parameter RKH
The scalar integer constant of intrinsic default kind, representing the highest-precision real kind t...
Definition: pm_kind.F90:858
integer, parameter RKS
The single-precision real kind in Fortran mode. On most platforms, this is an 32-bit real kind.
Definition: pm_kind.F90:567
This module contains procedures and generic interfaces relevant to copying (diagonal or upper/lower t...
Generate and return an object of type display_type.
Definition: pm_io.F90:10282

Example Unix compile command via Intel ifort compiler
1#!/usr/bin/env sh
2rm main.exe
3ifort -fpp -standard-semantics -O3 -Wl,-rpath,../../../lib -I../../../inc main.F90 ../../../lib/libparamonte* -o main.exe
4./main.exe

Example Windows Batch compile command via Intel ifort compiler
1del main.exe
2set PATH=..\..\..\lib;%PATH%
3ifort /fpp /standard-semantics /O3 /I:..\..\..\include main.F90 ..\..\..\lib\libparamonte*.lib /exe:main.exe
4main.exe

Example Unix / MinGW compile command via GNU gfortran compiler
1#!/usr/bin/env sh
2rm main.exe
3gfortran -cpp -ffree-line-length-none -O3 -Wl,-rpath,../../../lib -I../../../inc main.F90 ../../../lib/libparamonte* -o main.exe
4./main.exe

Example output
1
2!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3! Compute the LU-Pivoted decomposition of a real square matrix.
4!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5
6
7mat_lup
8+1.00000000, +1.20000005, +1.39999998, +1.60000002, +1.79999995, +2.00000000, +2.20000005, +2.40000010, +2.59999990
9+1.20000005, +1.00000000, +1.20000005, +1.39999998, +1.60000002, +1.79999995, +2.00000000, +2.20000005, +2.40000010
10+1.39999998, +1.20000005, +1.00000000, +1.20000005, +1.39999998, +1.60000002, +1.79999995, +2.00000000, +2.20000005
11+1.60000002, +1.39999998, +1.20000005, +1.00000000, +1.20000005, +1.39999998, +1.60000002, +1.79999995, +2.00000000
12+1.79999995, +1.60000002, +1.39999998, +1.20000005, +1.00000000, +1.20000005, +1.39999998, +1.60000002, +1.79999995
13+2.00000000, +1.79999995, +1.60000002, +1.39999998, +1.20000005, +1.00000000, +1.20000005, +1.39999998, +1.60000002
14+2.20000005, +2.00000000, +1.79999995, +1.60000002, +1.39999998, +1.20000005, +1.00000000, +1.20000005, +1.39999998
15+2.40000010, +2.20000005, +2.00000000, +1.79999995, +1.60000002, +1.39999998, +1.20000005, +1.00000000, +1.20000005
16+2.59999990, +2.40000010, +2.20000005, +2.00000000, +1.79999995, +1.60000002, +1.39999998, +1.20000005, +1.00000000
17call setResized(rperm, size(mat_lup, 1, IK))
18call setMatLUP(mat_lup, rperm, info); if (info /= 0) error stop
19mat_lup
20+2.59999990, +2.40000010, +2.20000005, +2.00000000, +1.79999995, +1.60000002, +1.39999998, +1.20000005, +1.00000000
21+0.384615391, +0.276923060, +0.553846121, +0.830769241, +1.10769224, +1.38461542, +1.66153848, +1.93846154, +2.21538448
22+0.461538494, -0.388889551, +0.400000334, +0.800000429, +1.20000076, +1.60000086, +2.00000095, +2.40000129, +2.80000138
23+0.538461566, -0.333333760, +0.298022968E-6, +0.400000125, +0.800000072, +1.20000005, +1.60000002, +2.00000000, +2.40000033
24+0.615384638, -0.277778417, +0.894068876E-6, -0.558792806E-6, +0.400000066, +0.800000012, +1.20000017, +1.60000002, +2.00000024
25+0.692307711, -0.222222656, +0.298022968E-6, +0.335276212E-6, -0.372528973E-6, +0.400000006, +0.799999952, +1.19999993, +1.59999990
26+0.769230783, -0.166667312, +0.894068876E-6, -0.558792806E-6, +0.223516594E-6, -0.223516778E-6, +0.400000095, +0.800000012, +1.20000017
27+0.846153855, -0.111111544, +0.298022968E-6, +0.316649761E-6, -0.335276070E-6, +0.558793545E-7, -0.372527467E-7, +0.399999976, +0.799999952
28+0.923076987, -0.555566326E-1, +0.119209187E-5, -0.586732369E-6, +0.577419087E-6, -0.866129369E-6, +0.875443050E-6, -0.894069899E-6, +0.400000304
29call setResized(rperm, size(mat_lup, 1, IK)) ! reconstruct the original matrix.
30lup_ref ! reference matrix rounded to 1 significant digit.
31+2.59999990, +2.40000010, +2.20000005, +2.00000000, +1.79999995, +1.60000002, +1.39999998, +1.20000005, +1.00000000
32+0.400000006, +0.300000012, +0.600000024, +0.800000012, +1.10000002, +1.39999998, +1.70000005, +1.89999998, +2.20000005
33+0.500000000, -0.400000006, +0.400000006, +0.800000012, +1.20000005, +1.60000002, +2.00000000, +2.40000010, +2.79999995
34+0.500000000, -0.300000012, +0.00000000, +0.400000006, +0.800000012, +1.20000005, +1.60000002, +2.00000000, +2.40000010
35+0.600000024, -0.300000012, +0.00000000, +0.00000000, +0.400000006, +0.800000012, +1.20000005, +1.60000002, +2.00000000
36+0.699999988, -0.200000003, +0.00000000, +0.00000000, +0.00000000, +0.400000006, +0.800000012, +1.20000005, +1.60000002
37+0.800000012, -0.200000003, +0.00000000, +0.00000000, +0.00000000, +0.00000000, +0.400000006, +0.800000012, +1.20000005
38+0.800000012, -0.100000001, +0.00000000, +0.00000000, +0.00000000, +0.00000000, +0.00000000, +0.400000006, +0.800000012
39+0.899999976, -0.100000001, +0.00000000, +0.00000000, +0.00000000, +0.00000000, +0.00000000, +0.00000000, +0.400000006
40lup_ref - mat_lup, format = SK_'(*(f0.1,:,", "))'
41.0, .0, .0, .0, .0, .0, .0, .0, .0
42.0, .0, .0, -.0, -.0, .0, .0, -.0, -.0
43.0, -.0, -.0, -.0, -.0, -.0, -.0, -.0, -.0
44-.0, .0, -.0, -.0, -.0, .0, .0, .0, -.0
45-.0, -.0, -.0, .0, -.0, .0, -.0, .0, -.0
46.0, .0, -.0, -.0, .0, .0, .0, .0, .0
47.0, -.0, -.0, .0, -.0, .0, -.0, .0, -.0
48-.0, .0, -.0, -.0, .0, -.0, .0, .0, .0
49-.0, -.0, -.0, .0, -.0, .0, -.0, .0, -.0
50rperm_ref
51+9, +9, +9, +9, +9, +9, +9, +9, +9
52rperm
53+9, +9, +9, +9, +9, +9, +9, +9, +9
54
55
56mat_lup
57+1.0000000000000000, +1.2000000000000000, +1.3999999999999999, +1.6000000000000001, +1.8000000000000000, +2.0000000000000000, +2.2000000000000002, +2.3999999999999999, +2.6000000000000001
58+1.2000000000000000, +1.0000000000000000, +1.2000000000000000, +1.3999999999999999, +1.6000000000000001, +1.8000000000000000, +2.0000000000000000, +2.2000000000000002, +2.3999999999999999
59+1.3999999999999999, +1.2000000000000000, +1.0000000000000000, +1.2000000000000000, +1.3999999999999999, +1.6000000000000001, +1.8000000000000000, +2.0000000000000000, +2.2000000000000002
60+1.6000000000000001, +1.3999999999999999, +1.2000000000000000, +1.0000000000000000, +1.2000000000000000, +1.3999999999999999, +1.6000000000000001, +1.8000000000000000, +2.0000000000000000
61+1.8000000000000000, +1.6000000000000001, +1.3999999999999999, +1.2000000000000000, +1.0000000000000000, +1.2000000000000000, +1.3999999999999999, +1.6000000000000001, +1.8000000000000000
62+2.0000000000000000, +1.8000000000000000, +1.6000000000000001, +1.3999999999999999, +1.2000000000000000, +1.0000000000000000, +1.2000000000000000, +1.3999999999999999, +1.6000000000000001
63+2.2000000000000002, +2.0000000000000000, +1.8000000000000000, +1.6000000000000001, +1.3999999999999999, +1.2000000000000000, +1.0000000000000000, +1.2000000000000000, +1.3999999999999999
64+2.3999999999999999, +2.2000000000000002, +2.0000000000000000, +1.8000000000000000, +1.6000000000000001, +1.3999999999999999, +1.2000000000000000, +1.0000000000000000, +1.2000000000000000
65+2.6000000000000001, +2.3999999999999999, +2.2000000000000002, +2.0000000000000000, +1.8000000000000000, +1.6000000000000001, +1.3999999999999999, +1.2000000000000000, +1.0000000000000000
66call setResized(rperm, size(mat_lup, 1, IK))
67call setMatLUP(mat_lup, rperm, info); if (info /= 0) error stop
68mat_lup
69+2.6000000000000001, +2.3999999999999999, +2.2000000000000002, +2.0000000000000000, +1.8000000000000000, +1.6000000000000001, +1.3999999999999999, +1.2000000000000000, +1.0000000000000000
70+0.38461538461538458, +0.27692307692307705, +0.55384615384615377, +0.83076923076923093, +1.1076923076923078, +1.3846153846153846, +1.6615384615384619, +1.9384615384615385, +2.2153846153846155
71+0.46153846153846145, -0.38888888888888812, +0.39999999999999958, +0.79999999999999949, +1.1999999999999995, +1.5999999999999992, +1.9999999999999989, +2.3999999999999990, +2.7999999999999985
72+0.53846153846153832, -0.33333333333333198, -0.13877787807814473E-14, +0.40000000000000024, +0.80000000000000038, +1.2000000000000006, +1.6000000000000010, +2.0000000000000009, +2.4000000000000012
73+0.61538461538461542, -0.27777777777777823, +0.27755575615628943E-15, +0.34694469519536098E-15, +0.39999999999999980, +0.79999999999999960, +1.1999999999999997, +1.5999999999999996, +1.9999999999999991
74+0.69230769230769229, -0.22222222222222132, -0.18735013540549536E-14, +0.19428902930940243E-14, -0.76327832942979404E-15, +0.39999999999999991, +0.80000000000000016, +1.2000000000000000, +1.6000000000000003
75+0.76923076923076916, -0.16666666666666519, -0.18041124150158814E-14, +0.69388939039072392E-15, -0.69388939039071088E-16, -0.69388939039075254E-16, +0.40000000000000041, +0.80000000000000027, +1.2000000000000006
76+0.84615384615384615, -0.11111111111111066, -0.65919492087118739E-15, +0.69388939039072294E-15, -0.65919492087118660E-15, -0.73955709864469874E-30, +0.69388939039072234E-15, +0.39999999999999986, +0.79999999999999971
77+0.92307692307692291, -0.55555555555553728E-1, -0.22724877535296197E-14, +0.17347234759768081E-14, -0.60715321659188229E-15, -0.11102230246251597E-14, +0.17347234759768093E-14, -0.12143064331837640E-14, +0.40000000000000013
78call setResized(rperm, size(mat_lup, 1, IK)) ! reconstruct the original matrix.
79lup_ref ! reference matrix rounded to 1 significant digit.
80+2.6000000000000001, +2.3999999999999999, +2.2000000000000002, +2.0000000000000000, +1.8000000000000000, +1.6000000000000001, +1.3999999999999999, +1.2000000000000000, +1.0000000000000000
81+0.40000000000000002, +0.29999999999999999, +0.59999999999999998, +0.80000000000000004, +1.1000000000000001, +1.3999999999999999, +1.7000000000000000, +1.8999999999999999, +2.2000000000000002
82+0.50000000000000000, -0.40000000000000002, +0.40000000000000002, +0.80000000000000004, +1.2000000000000000, +1.6000000000000001, +2.0000000000000000, +2.3999999999999999, +2.7999999999999998
83+0.50000000000000000, -0.29999999999999999, +0.0000000000000000, +0.40000000000000002, +0.80000000000000004, +1.2000000000000000, +1.6000000000000001, +2.0000000000000000, +2.3999999999999999
84+0.59999999999999998, -0.29999999999999999, +0.0000000000000000, +0.0000000000000000, +0.40000000000000002, +0.80000000000000004, +1.2000000000000000, +1.6000000000000001, +2.0000000000000000
85+0.69999999999999996, -0.20000000000000001, +0.0000000000000000, +0.0000000000000000, +0.0000000000000000, +0.40000000000000002, +0.80000000000000004, +1.2000000000000000, +1.6000000000000001
86+0.80000000000000004, -0.20000000000000001, +0.0000000000000000, +0.0000000000000000, +0.0000000000000000, +0.0000000000000000, +0.40000000000000002, +0.80000000000000004, +1.2000000000000000
87+0.80000000000000004, -0.10000000000000001, +0.0000000000000000, +0.0000000000000000, +0.0000000000000000, +0.0000000000000000, +0.0000000000000000, +0.40000000000000002, +0.80000000000000004
88+0.90000000000000002, -0.10000000000000001, +0.0000000000000000, +0.0000000000000000, +0.0000000000000000, +0.0000000000000000, +0.0000000000000000, +0.0000000000000000, +0.40000000000000002
89lup_ref - mat_lup, format = SK_'(*(f0.1,:,", "))'
90.0, .0, .0, .0, .0, .0, .0, .0, .0
91.0, .0, .0, -.0, -.0, .0, .0, -.0, -.0
92.0, -.0, .0, .0, .0, .0, .0, .0, .0
93-.0, .0, .0, -.0, -.0, -.0, -.0, -.0, -.0
94-.0, -.0, -.0, -.0, .0, .0, .0, .0, .0
95.0, .0, .0, -.0, .0, .0, -.0, .0, -.0
96.0, -.0, .0, -.0, .0, .0, -.0, -.0, -.0
97-.0, .0, .0, -.0, .0, .0, -.0, .0, .0
98-.0, -.0, .0, -.0, .0, .0, -.0, .0, -.0
99rperm_ref
100+9, +9, +9, +9, +9, +9, +9, +9, +9
101rperm
102+9, +9, +9, +9, +9, +9, +9, +9, +9
103
104
105mat_lup
106+1.00000000000000000000000000000000000, +1.19999999999999999999999999999999996, +1.39999999999999999999999999999999992, +1.60000000000000000000000000000000008, +1.80000000000000000000000000000000004, +2.00000000000000000000000000000000000, +2.20000000000000000000000000000000015, +2.39999999999999999999999999999999992, +2.60000000000000000000000000000000008
107+1.19999999999999999999999999999999996, +1.00000000000000000000000000000000000, +1.19999999999999999999999999999999996, +1.39999999999999999999999999999999992, +1.60000000000000000000000000000000008, +1.80000000000000000000000000000000004, +2.00000000000000000000000000000000000, +2.20000000000000000000000000000000015, +2.39999999999999999999999999999999992
108+1.39999999999999999999999999999999992, +1.19999999999999999999999999999999996, +1.00000000000000000000000000000000000, +1.19999999999999999999999999999999996, +1.39999999999999999999999999999999992, +1.60000000000000000000000000000000008, +1.80000000000000000000000000000000004, +2.00000000000000000000000000000000000, +2.20000000000000000000000000000000015
109+1.60000000000000000000000000000000008, +1.39999999999999999999999999999999992, +1.19999999999999999999999999999999996, +1.00000000000000000000000000000000000, +1.19999999999999999999999999999999996, +1.39999999999999999999999999999999992, +1.60000000000000000000000000000000008, +1.80000000000000000000000000000000004, +2.00000000000000000000000000000000000
110+1.80000000000000000000000000000000004, +1.60000000000000000000000000000000008, +1.39999999999999999999999999999999992, +1.19999999999999999999999999999999996, +1.00000000000000000000000000000000000, +1.19999999999999999999999999999999996, +1.39999999999999999999999999999999992, +1.60000000000000000000000000000000008, +1.80000000000000000000000000000000004
111+2.00000000000000000000000000000000000, +1.80000000000000000000000000000000004, +1.60000000000000000000000000000000008, +1.39999999999999999999999999999999992, +1.19999999999999999999999999999999996, +1.00000000000000000000000000000000000, +1.19999999999999999999999999999999996, +1.39999999999999999999999999999999992, +1.60000000000000000000000000000000008
112+2.20000000000000000000000000000000015, +2.00000000000000000000000000000000000, +1.80000000000000000000000000000000004, +1.60000000000000000000000000000000008, +1.39999999999999999999999999999999992, +1.19999999999999999999999999999999996, +1.00000000000000000000000000000000000, +1.19999999999999999999999999999999996, +1.39999999999999999999999999999999992
113+2.39999999999999999999999999999999992, +2.20000000000000000000000000000000015, +2.00000000000000000000000000000000000, +1.80000000000000000000000000000000004, +1.60000000000000000000000000000000008, +1.39999999999999999999999999999999992, +1.19999999999999999999999999999999996, +1.00000000000000000000000000000000000, +1.19999999999999999999999999999999996
114+2.60000000000000000000000000000000008, +2.39999999999999999999999999999999992, +2.20000000000000000000000000000000015, +2.00000000000000000000000000000000000, +1.80000000000000000000000000000000004, +1.60000000000000000000000000000000008, +1.39999999999999999999999999999999992, +1.19999999999999999999999999999999996, +1.00000000000000000000000000000000000
115call setResized(rperm, size(mat_lup, 1, IK))
116call setMatLUP(mat_lup, rperm, info); if (info /= 0) error stop
117mat_lup
118+2.60000000000000000000000000000000008, +2.39999999999999999999999999999999992, +2.20000000000000000000000000000000015, +2.00000000000000000000000000000000000, +1.80000000000000000000000000000000004, +1.60000000000000000000000000000000008, +1.39999999999999999999999999999999992, +1.19999999999999999999999999999999996, +1.00000000000000000000000000000000000
119+0.384615384615384615384615384615384586, +0.276923076923076923076923076923077033, +0.553846153846153846153846153846153777, +0.830769230769230769230769230769230906, +1.10769230769230769230769230769230775, +1.38461538461538461538461538461538459, +1.66153846153846153846153846153846181, +1.93846153846153846153846153846153846, +2.21538461538461538461538461538461549
120+0.461538461538461538461538461538461464, -0.388888888888888888888888888888888220, +0.399999999999999999999999999999999634, +0.799999999999999999999999999999999557, +1.19999999999999999999999999999999958, +1.59999999999999999999999999999999931, +1.99999999999999999999999999999999904, +2.39999999999999999999999999999999915, +2.79999999999999999999999999999999869
121+0.538461538461538461538461538461538343, -0.333333333333333333333333333333332162, -0.120370621524202240815998621411558076E-32, +0.400000000000000000000000000000000212, +0.800000000000000000000000000000000327, +1.20000000000000000000000000000000054, +1.60000000000000000000000000000000085, +2.00000000000000000000000000000000077, +2.40000000000000000000000000000000108
122+0.615384615384615384615384615384615414, -0.277777777777777777777777777777778174, +0.240741243048404481631997242823116137E-33, +0.300926553810505602039996553528894560E-33, +0.399999999999999999999999999999999827, +0.799999999999999999999999999999999653, +1.19999999999999999999999999999999977, +1.59999999999999999999999999999999969, +1.99999999999999999999999999999999923
123+0.692307692307692307692307692307692293, -0.222222222222222222222222222222221441, -0.162500339057673025101598138905603391E-32, +0.168518870133883137142398069976181170E-32, -0.662038418383112324487992417763567950E-33, +0.399999999999999999999999999999999923, +0.800000000000000000000000000000000135, +1.19999999999999999999999999999999996, +1.60000000000000000000000000000000027
124+0.769230769230769230769230769230769172, -0.166666666666666666666666666666665383, -0.156481807981462913060798207835025493E-32, +0.601853107621011204079993107057790603E-33, -0.601853107621011204079993107057780792E-34, -0.601853107621011204079993107057812135E-34, +0.400000000000000000000000000000000356, +0.800000000000000000000000000000000231, +1.20000000000000000000000000000000054
125+0.846153846153846153846153846153846146, -0.111111111111111111111111111111110721, -0.571760452239960643875993451704900817E-33, +0.601853107621011204079993107057789861E-33, -0.571760452239960643875993451704900224E-33, -0.556380922603113207859760289232146041E-66, +0.601853107621011204079993107057789416E-33, +0.399999999999999999999999999999999875, +0.799999999999999999999999999999999750
126+0.923076923076923076923076923076922929, -0.555555555555555555555555555555539700E-1, -0.197106892745881169336197742561426333E-32, +0.150463276905252801019998276764447521E-32, -0.526621469168384803569993968675565915E-33, -0.962964972193617926527988971292466033E-33, +0.150463276905252801019998276764447610E-32, -0.105324293833676960713998793735113139E-32, +0.400000000000000000000000000000000116
127call setResized(rperm, size(mat_lup, 1, IK)) ! reconstruct the original matrix.
128lup_ref ! reference matrix rounded to 1 significant digit.
129+2.60000000000000000000000000000000008, +2.39999999999999999999999999999999992, +2.20000000000000000000000000000000015, +2.00000000000000000000000000000000000, +1.80000000000000000000000000000000004, +1.60000000000000000000000000000000008, +1.39999999999999999999999999999999992, +1.19999999999999999999999999999999996, +1.00000000000000000000000000000000000
130+0.400000000000000000000000000000000019, +0.299999999999999999999999999999999990, +0.599999999999999999999999999999999981, +0.800000000000000000000000000000000039, +1.10000000000000000000000000000000008, +1.39999999999999999999999999999999992, +1.69999999999999999999999999999999996, +1.89999999999999999999999999999999992, +2.20000000000000000000000000000000015
131+0.500000000000000000000000000000000000, -0.400000000000000000000000000000000019, +0.400000000000000000000000000000000019, +0.800000000000000000000000000000000039, +1.19999999999999999999999999999999996, +1.60000000000000000000000000000000008, +2.00000000000000000000000000000000000, +2.39999999999999999999999999999999992, +2.79999999999999999999999999999999985
132+0.500000000000000000000000000000000000, -0.299999999999999999999999999999999990, +0.00000000000000000000000000000000000, +0.400000000000000000000000000000000019, +0.800000000000000000000000000000000039, +1.19999999999999999999999999999999996, +1.60000000000000000000000000000000008, +2.00000000000000000000000000000000000, +2.39999999999999999999999999999999992
133+0.599999999999999999999999999999999981, -0.299999999999999999999999999999999990, +0.00000000000000000000000000000000000, +0.00000000000000000000000000000000000, +0.400000000000000000000000000000000019, +0.800000000000000000000000000000000039, +1.19999999999999999999999999999999996, +1.60000000000000000000000000000000008, +2.00000000000000000000000000000000000
134+0.699999999999999999999999999999999961, -0.200000000000000000000000000000000010, +0.00000000000000000000000000000000000, +0.00000000000000000000000000000000000, +0.00000000000000000000000000000000000, +0.400000000000000000000000000000000019, +0.800000000000000000000000000000000039, +1.19999999999999999999999999999999996, +1.60000000000000000000000000000000008
135+0.800000000000000000000000000000000039, -0.200000000000000000000000000000000010, +0.00000000000000000000000000000000000, +0.00000000000000000000000000000000000, +0.00000000000000000000000000000000000, +0.00000000000000000000000000000000000, +0.400000000000000000000000000000000019, +0.800000000000000000000000000000000039, +1.19999999999999999999999999999999996
136+0.800000000000000000000000000000000039, -0.100000000000000000000000000000000005, +0.00000000000000000000000000000000000, +0.00000000000000000000000000000000000, +0.00000000000000000000000000000000000, +0.00000000000000000000000000000000000, +0.00000000000000000000000000000000000, +0.400000000000000000000000000000000019, +0.800000000000000000000000000000000039
137+0.900000000000000000000000000000000019, -0.100000000000000000000000000000000005, +0.00000000000000000000000000000000000, +0.00000000000000000000000000000000000, +0.00000000000000000000000000000000000, +0.00000000000000000000000000000000000, +0.00000000000000000