You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+63-63
Original file line number
Diff line number
Diff line change
@@ -13,49 +13,49 @@ For example, starting with a 6 by 6 matrix whose elements are numbered 1 to 36 i
13
13
```julia
14
14
julia>using LinearAlgebra, RectangularFullPacked
15
15
16
-
julia> A =reshape(1:36, (6, 6))
17
-
6×6reshape(::UnitRange{Int64}, 6, 6) with eltype Int64:
18
-
1713192531
19
-
2814202632
20
-
3915212733
21
-
41016222834
22
-
51117232935
23
-
61218243036
16
+
julia> A =reshape(1.:36., (6, 6))
17
+
6×6reshape(::StepRangeLen{Float64, Base.TwicePrecision{Float64}, Base.TwicePrecision{Float64}, Int64}, 6, 6) with eltype Float64:
18
+
1.07.013.019.025.031.0
19
+
2.08.014.020.026.032.0
20
+
3.09.015.021.027.033.0
21
+
4.010.016.022.028.034.0
22
+
5.011.017.023.029.035.0
23
+
6.012.018.024.030.036.0
24
24
```
25
25
the lower triangular matrix `AL` is constructed by replacing the elements above the diagonal with zero.
26
26
```julia
27
27
julia> AL =tril!(collect(A))
28
-
6×6 Matrix{Int64}:
29
-
100000
30
-
280000
31
-
3915000
32
-
410162200
33
-
5111723290
34
-
61218243036
35
-
```
36
-
`AL` requires the same amount of storage as does `A` even though there are only 21 potential non-zeros in `AL`.
28
+
6×6 Matrix{Float64}:
29
+
1.00.00.00.00.00.0
30
+
2.08.00.00.00.00.0
31
+
3.09.015.00.00.00.0
32
+
4.010.016.022.00.00.0
33
+
5.011.017.023.029.00.0
34
+
6.012.018.024.030.036.0
35
+
```
36
+
`AL` requires the same amount of storage as does `A` even though there are only 21 potential non-zeros in `AL`.
37
37
The RFP version of the lower triangular matrix
38
-
```julia
39
-
julia> ArfpL =Int.(TriangularRFP(float.(A), :L))
40
-
6×6Matrix{Int64}:
41
-
100000
42
-
280000
43
-
3915000
44
-
410162200
45
-
5111723290
46
-
61218243036
38
+
```julia
39
+
julia> ArfpL =TriangularRFP(A, :L)
40
+
6×6TriangularRFP{Float64}:
41
+
1.00.00.00.00.00.0
42
+
2.08.00.00.00.00.0
43
+
3.09.015.00.00.00.0
44
+
4.010.016.022.00.00.0
45
+
5.011.017.023.029.00.0
46
+
6.012.018.024.030.036.0
47
47
```
48
-
provides the same displayed form but the underlying, "parent" array is 7 by 3
49
-
```julia
50
-
julia> ALparent =Int.(ArfpL.data)
51
-
7×3 Matrix{Int64}:
52
-
222324
53
-
12930
54
-
2836
55
-
3915
56
-
41016
57
-
51117
58
-
61218
48
+
provides the same displayed form but the underlying, "parent" array is 7 by 3
49
+
```julia
50
+
julia> ALparent = ArfpL.data
51
+
7×3 Matrix{Float64}:
52
+
22.023.024.0
53
+
1.029.030.0
54
+
2.08.036.0
55
+
3.09.015.0
56
+
4.010.016.0
57
+
5.011.017.0
58
+
6.012.018.0
59
59
```
60
60
61
61
The three blocks of `AL` are the lower triangle of `AL[1:3, 1:3]`, stored as the lower triangle of `ALparent[2:4, :]`; the square block `AL[4:6, 1:3]` stored in `ALparent[5:7, :]`; and the lower triangle of `AL[4:6, 4:6]` stored transposed in `ALparent[1:3, :]`.
@@ -64,50 +64,50 @@ For odd values of n, the parent is of size `(n, div(n + 1, 2))` and the non-zero
RFP storage is especially useful for large positive definite Hermitian matrices because the Cholesky factor can be evaluated nearly as quickly (by applying Level-3 BLAS to the blocks) as in full storage mode but requiring about half the storage.
84
+
RFP storage is especially useful for large positive definite Hermitian matrices because the Cholesky factor can be evaluated nearly as quickly (by applying Level-3 BLAS to the blocks) as in full storage mode but requiring about half the storage.
0 commit comments