diff --git a/src/pdiagmat.jl b/src/pdiagmat.jl index 8c4887c..6edf925 100644 --- a/src/pdiagmat.jl +++ b/src/pdiagmat.jl @@ -28,7 +28,7 @@ diag(a::PDiagMat) = copy(a.diag) function pdadd!(r::Matrix, a::Matrix, b::PDiagMat, c) @check_argdims size(r) == size(a) == size(b) - if is(r, a) + if r === a _adddiag!(r, b.diag, c) else _adddiag!(copy!(r, a), b.diag, c) diff --git a/src/scalmat.jl b/src/scalmat.jl index b111b7f..d2105c2 100644 --- a/src/scalmat.jl +++ b/src/scalmat.jl @@ -23,7 +23,7 @@ diag(a::ScalMat) = fill(a.value, a.dim) function pdadd!(r::Matrix, a::Matrix, b::ScalMat, c) @check_argdims size(r) == size(a) == size(b) - if is(r, a) + if r === a _adddiag!(r, b.value * c) else _adddiag!(copy!(r, a), b.value * c) diff --git a/src/testutils.jl b/src/testutils.jl index 0311d58..34bb82c 100644 --- a/src/testutils.jl +++ b/src/testutils.jl @@ -115,7 +115,7 @@ function pdtest_add(C::AbstractPDMat, Cmat::Matrix, verbose::Int) _pdt(verbose, "add_scal!") R = M + Cmat * convert(eltype(C),2) Mr = pdadd!(M, C, convert(eltype(C),2)) - @test is(Mr, M) + @test Mr === M @test_approx_eq Mr R end diff --git a/src/utils.jl b/src/utils.jl index 1ce56fc..a336b9c 100644 --- a/src/utils.jl +++ b/src/utils.jl @@ -7,7 +7,7 @@ macro check_argdims(cond) end end -_rcopy!(r::StridedVecOrMat, x::StridedVecOrMat) = (is(r, x) || copy!(r, x); r) +_rcopy!(r::StridedVecOrMat, x::StridedVecOrMat) = (r === x || copy!(r, x); r) @compat function _addscal!(r::Matrix, a::Matrix, b::Union{Matrix, SparseMatrixCSC}, c::Real)