From 03c210adbb8ea4b87593041a028d2e7b9ee42ff3 Mon Sep 17 00:00:00 2001 From: chriselrod Date: Thu, 21 Sep 2023 00:42:06 -0400 Subject: [PATCH] fix dim branches --- src/pdiagmat.jl | 2 +- src/pdmat.jl | 2 +- src/pdsparsemat.jl | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/pdiagmat.jl b/src/pdiagmat.jl index 4e6c2c3..fec037c 100644 --- a/src/pdiagmat.jl +++ b/src/pdiagmat.jl @@ -12,7 +12,7 @@ function PDiagMat(dim::Int, diag::V) where {T,V<:AbstractVector{T}} end function Base.getproperty(a::PDiagMat, s::Symbol) - if s !== :dim + if s === :dim return length(getfield(a, :diag)) end return getfield(a, s) diff --git a/src/pdmat.jl b/src/pdmat.jl index 4c9e9ca..cc39935 100644 --- a/src/pdmat.jl +++ b/src/pdmat.jl @@ -26,7 +26,7 @@ PDMat(mat::AbstractMatrix) = PDMat(mat, cholesky(mat)) PDMat(fac::Cholesky) = PDMat(AbstractMatrix(fac), fac) function Base.getproperty(a::PDMat, s::Symbol) - if s !== :dim + if s === :dim return size(getfield(a, :mat), 1) end return getfield(a, s) diff --git a/src/pdsparsemat.jl b/src/pdsparsemat.jl index b883f6a..4d0929f 100644 --- a/src/pdsparsemat.jl +++ b/src/pdsparsemat.jl @@ -26,7 +26,7 @@ PDSparseMat(mat::SparseMatrixCSC) = PDSparseMat(mat, cholesky(mat)) PDSparseMat(fac::CholTypeSparse) = PDSparseMat(sparse(fac), fac) function Base.getproperty(a::PDSparseMat, s::Symbol) - if s !== :dim + if s === :dim return size(getfield(a, :mat), 1) end return getfield(a, s)