Skip to content

Commit

Permalink
updated method for type specialization
Browse files Browse the repository at this point in the history
  • Loading branch information
adknudson committed Feb 21, 2024
1 parent 27c01dd commit afca446
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Bigsimr.jl
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,10 @@ false
```
"""
function is_correlation(X::AbstractMatrix{T}) where {T<:Real}
issymmetric(X) || return false
all(diag(X) .== 1) || return false
all(-1 .≤ X .≤ 1) || return false
isposdef(X) || return false
issymmetric(X) || return false
all(diag(X) .== one(T)) || return false
all(-one(T) .≤ X .≤ one(T)) || return false
isposdef(X) || return false

return true
end
Expand Down

0 comments on commit afca446

Please sign in to comment.