Skip to content

Commit

Permalink
Add isapprox
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanaelbosch committed Nov 22, 2023
1 parent 87f9621 commit faafafd
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/PSDMatrices.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

module PSDMatrices

import Base: \, /, size, inv, copy, copy!, ==, show, similar, Matrix, iszero
import Base: \, /, size, inv, copy, copy!, ==, show, similar, Matrix, iszero, isapprox
using LinearAlgebra
import LinearAlgebra: det, logabsdet, diag

Expand All @@ -28,6 +28,7 @@ similar(M::PSDMatrix{T}, element_type::Type=eltype(M)) where {T} =
PSDMatrix{T}(similar(M.R, element_type))
copy!(dst::PSDMatrix, src::PSDMatrix) = (copy!(dst.R, src.R); dst)
==(M1::PSDMatrix, M2::PSDMatrix) = M1.R == M2.R # todo: same as isequal()?!
isapprox(M1::PSDMatrix, M2::PSDMatrix; kwargs...) = isapprox(M1.R, M2.R; kwargs...)
function show(io::IO, M::PSDMatrix)
print(io, "$(size(M,1))x$(size(M,2)) $(typeof(M)); R=")
show(io, M.R)
Expand Down

0 comments on commit faafafd

Please sign in to comment.