diff --git a/src/Integrals/Frameworks/OneBody.jl b/src/Integrals/Frameworks/OneBody.jl index cc1698b0..ac3dc9bc 100644 --- a/src/Integrals/Frameworks/OneBody.jl +++ b/src/Integrals/Frameworks/OneBody.jl @@ -1,18 +1,19 @@ -function genNormalizer(o::PrimitiveOrbCore{T, D}, - paramPtr::PrimOrbParamPtr{T, D}) where {T, D} +function genNormalizer(o::PrimitiveOrbCore{T, D}, ::PrimOrbParamPtr{T, D}) where {T, D} fCore = function (x::AbtVecOfAbtArr{T}) (AbsSqrtInv∘numericalOneBodyInt)(Identity(), (o.f.apply,), (x,)) end - ParamFilterFunc(OnlyBody(fCore∘getField), paramPtr.scope) + OnlyBody(fCore∘getField) end function getNormCoeff!(cache::DimSpanDataCacheBox{T}, orbs::NonEmptyTuple{FrameworkOrb{T, D}}) where {T, D} ptr = ChainPointer((:core, :f, :apply, :right)) - paramSets = map(Base.Fix2(getfield, :param), orbs) # better than broadcasting + localParamSets = map(orbs) do orb # better than broadcasting + FilteredObject(orb.param, orb.pointer.scope) + end normalizers = map(Base.Fix2(getField, ptr), orbs) # better than broadcasting - mapreduce(StableBinary(*, T), paramSets, normalizers, init=one(T)) do pSet, f + mapreduce(StableBinary(*, T), localParamSets, normalizers, init=one(T)) do pSet, f getNormCoeffCore!(cache, pSet, f) end end @@ -21,18 +22,19 @@ function getNormCoeff!(cache::DimSpanDataCacheBox{T}, orb::FrameworkOrb{T, D}, degree::Int) where {T, D} ptr = ChainPointer((:core, :f, :apply, :right)) normalizer = getField(orb, ptr) - normCoeff = getNormCoeffCore!(cache, orb.param, normalizer) + normCoeff = getNormCoeffCore!(cache, FilteredObject(orb.param, orb.pointer.scope), + normalizer) normCoeff^abs(degree) end -function getNormCoeffCore!(cache::DimSpanDataCacheBox{T}, pSet::FlatParamSet{T}, - normalizer::ReturnTyped{T, <:ParamFilterFunc}) where {T} - paramVal = cacheParam!(cache, pSet, normalizer.f.scope) - normalizer.f.apply(nothing, paramVal)::T +function getNormCoeffCore!(cache::DimSpanDataCacheBox{T}, pSource::TypedParamInput{T}, + normalizer::ReturnTyped{T}) where {T} + paramVal = cacheParam!(cache, pSource) + normalizer.f(nothing, paramVal)::T end -function getNormCoeffCore!(::DimSpanDataCacheBox{T}, ::FlatParamSet{T}, +function getNormCoeffCore!(::DimSpanDataCacheBox{T}, ::TypedParamInput{T}, normalizer::Storage{T}) where {T} normalizer.val end diff --git a/src/Integrals/GaussianOrbitals.jl b/src/Integrals/GaussianOrbitals.jl index 1b82ea02..43aaa940 100644 --- a/src/Integrals/GaussianOrbitals.jl +++ b/src/Integrals/GaussianOrbitals.jl @@ -87,7 +87,7 @@ function genNormalizer(o::PrimGTOcore{T, D}, paramPtr::PrimOrbParamPtr{T, D}) wh ns = map(x->Base.Fix2(polyGaussFuncSquaredNorm, x), angularFunc.f.m.tuple) nCore = OnlyBody( AbsSqrtInv ∘ ChainReduce(StableBinary(*, T), VectorMemory(ns)) ) ptrTuple = (getXpnPtr(paramPtr.body),) - ParamFilterFunc(ParamSelectFunc(nCore, ptrTuple), paramPtr.scope) + ParamSelectFunc(nCore, ptrTuple) end diff --git a/src/SpatialBasis.jl b/src/SpatialBasis.jl index b00b9011..5d3757ed 100644 --- a/src/SpatialBasis.jl +++ b/src/SpatialBasis.jl @@ -30,7 +30,7 @@ function normalizeOrbital(fCore::EvalComposedOrb{T, D}, ScaledOrbital(fCore, ReturnTyped(normalizerCore, T), paramPointer.scope) end -const NormFuncType{T} = Union{ReturnTyped{T, <:ParamFilterFunc}, Storage{T}} +const NormFuncType{T} = Union{ReturnTyped{T}, Storage{T}} function unpackParamFunc!(f::ComposedOrb{T}, paramSet::FlatParamSet, paramSetId::Identifier=Identifier(paramSet)) where {T}