diff --git a/src/special_arrays.jl b/src/special_arrays.jl index d8b9ac6..96db36d 100644 --- a/src/special_arrays.jl +++ b/src/special_arrays.jl @@ -352,7 +352,7 @@ $(SIGNATURES) Implementation of Cholesky factor calculation. """ -function calculate_corr_cholesky_factor!(U::AbstractMatrix{T}, flag::LogJacFlag, +@inline function calculate_corr_cholesky_factor!(U::AbstractMatrix{T}, flag::LogJacFlag, x::AbstractVector, index::Int) where {T<:Real} n = size(U, 1) ℓ = logjac_zero(flag, T) diff --git a/test/runtests.jl b/test/runtests.jl index fa352f9..451b174 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -819,6 +819,11 @@ end @test inverse(t, y) ≈ x end end + + # allocations + t7 = corr_cholesky_factor(SMatrix{7,7}) + z7 = zeros(dimension(t7)) + @test iszero(((t, z) -> @allocations(transform(t, z)))(t7, z7)) end @testset "corr cholesky factor large inputs" begin