Skip to content

Commit

Permalink
factorize! -> factorize
Browse files Browse the repository at this point in the history
  • Loading branch information
briochemc committed Mar 14, 2019
1 parent fb567d9 commit 044e4f1
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "HyperDualMatrixTools"
uuid = "04d39a18-1502-5db8-a704-9ca743349cef"
authors = ["Benoit Pasquier <[email protected]>"]
version = "2.0.1"
version = "2.0.2"

[deps]
HyperDualNumbers = "50ceba7f-c3ee-5a84-a6e8-3ad40456ec97"
Expand Down
5 changes: 3 additions & 2 deletions src/HyperDualMatrixTools.jl
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ for f in (:lu, :qr, :cholesky, :factorize)
end

# In-place factorization for the case where the real part is already stored
function factorize!(Mf::HyperDualFactors, M; update_factors = false)
import LinearAlgebra: factorize
function factorize(Mf::HyperDualFactors, M; update_factors = false)
Mf.B = ε₁part.(M)
Mf.C = ε₂part.(M)
Mf.D = ε₁ε₂part.(M)
Expand All @@ -74,7 +75,7 @@ function factorize!(Mf::HyperDualFactors, M; update_factors = false)
end
return Mf
end
export factorize!
export factorize

# Adjoint and transpose definitions for `HyperDualFactors`
for f in (:adjoint, :transpose)
Expand Down
4 changes: 2 additions & 2 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,12 @@ using HyperDualNumbers, LinearAlgebra, SparseArrays, SuiteSparse
@testset "Inplace factorization" begin
Mf1 =factorize(M)
Mf2 = factorize(M)
factorize!(Mf2, 2M)
factorize(Mf2, 2M)
@test Mf2.Af == Mf1.Af
@test Mf2.B == 2Mf1.B
@test Mf2.C == 2Mf1.C
@test Mf2.D == 2Mf1.D
factorize!(Mf2, 2M, update_factors=true)
factorize(Mf2, 2M, update_factors=true)
@test Mf2.Af Mf1.Af
@test Mf2.B == 2Mf1.B
@test Mf2.C == 2Mf1.C
Expand Down

0 comments on commit 044e4f1

Please sign in to comment.