change `index` field to `target_size` field.
Browse filesThis commit moves 2e-integrals to a more CSR-like format, making
downstream concatenation much simpler.
- generation/Integrals.jl +4 -7
generation/Integrals.jl
CHANGED
|
@@ -84,7 +84,7 @@ struct BiIntegral4c{T} <: ArrayFields
|
|
| 84 |
xyz :: Array{T}
|
| 85 |
ijkl :: Array{Int16}
|
| 86 |
Bijkl :: Array{Float32}
|
| 87 |
-
|
| 88 |
end
|
| 89 |
function BiIntegral4c(
|
| 90 |
l :: Vector{Int64},
|
|
@@ -93,8 +93,8 @@ function BiIntegral4c(
|
|
| 93 |
ijkl :: Array{Int16},
|
| 94 |
Bijkl :: Array{Float32}
|
| 95 |
) where T<:Real
|
| 96 |
-
|
| 97 |
-
BiIntegral4c{T}(l, exp, xyz, ijkl, Bijkl,
|
| 98 |
end
|
| 99 |
|
| 100 |
"Stack array fields, excluding constant fields"
|
|
@@ -117,11 +117,8 @@ end
|
|
| 117 |
function stack(rows::Vector{BiIntegral4c}) :: BiIntegral4c
|
| 118 |
out = map(rows[1]) do field
|
| 119 |
k, fk = field
|
| 120 |
-
if k ∈ (:ijkl, :Bijkl)
|
| 121 |
reduce(vcat, map(r -> getfield(r, k), rows))
|
| 122 |
-
elseif k == :index
|
| 123 |
-
idx(r::BiIntegral4c, i::Int) :: Vector{Int16} = i .+ r.index
|
| 124 |
-
reduce(vcat, map(idx, rows, 1:length(rows)))
|
| 125 |
elseif k == :l
|
| 126 |
rows[1].l
|
| 127 |
else
|
|
|
|
| 84 |
xyz :: Array{T}
|
| 85 |
ijkl :: Array{Int16}
|
| 86 |
Bijkl :: Array{Float32}
|
| 87 |
+
target_size :: Vector{Int32}
|
| 88 |
end
|
| 89 |
function BiIntegral4c(
|
| 90 |
l :: Vector{Int64},
|
|
|
|
| 93 |
ijkl :: Array{Int16},
|
| 94 |
Bijkl :: Array{Float32}
|
| 95 |
) where T<:Real
|
| 96 |
+
target_size :: Array{Int32} = [length(Bijkl)]
|
| 97 |
+
BiIntegral4c{T}(l, exp, xyz, ijkl, Bijkl, target_size)
|
| 98 |
end
|
| 99 |
|
| 100 |
"Stack array fields, excluding constant fields"
|
|
|
|
| 117 |
function stack(rows::Vector{BiIntegral4c}) :: BiIntegral4c
|
| 118 |
out = map(rows[1]) do field
|
| 119 |
k, fk = field
|
| 120 |
+
if k ∈ (:ijkl, :Bijkl, :target_size)
|
| 121 |
reduce(vcat, map(r -> getfield(r, k), rows))
|
|
|
|
|
|
|
|
|
|
| 122 |
elseif k == :l
|
| 123 |
rows[1].l
|
| 124 |
else
|