You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
length(dv) -1<=length(ev) <=length(dv) ||throw(DimensionMismatch("subdiagonal has wrong length. Has length $(length(ev)), but should be either $(length(dv) -1) or $(length(dv))."))
10
+
if!(length(dv) -1<=length(ev) <=length(dv))
11
+
throw(DimensionMismatch("subdiagonal has wrong length. Has length $(length(ev)), but should be either $(length(dv) -1) or $(length(dv))."))
12
+
end
11
13
new(dv,ev)
12
14
end
13
15
end
@@ -19,7 +21,14 @@ function SymTridiagonal{Td,Te}(dv::Vector{Td}, ev::Vector{Te})
SymTridiagonal(A::AbstractMatrix) =diag(A,1)==diag(A,-1)?SymTridiagonal(diag(A), diag(A,1)):throw(DimensionMismatch("matrix is not symmetric; cannot convert to SymTridiagonal"))
24
+
functionSymTridiagonal(A::AbstractMatrix)
25
+
ifdiag(A,1) ==diag(A,-1)
26
+
SymTridiagonal(diag(A), diag(A,1))
27
+
else
28
+
throw(ArgumentError("Matrix is not symmetric; cannot convert to SymTridiagonal"))
29
+
end
30
+
end
31
+
23
32
full{T}(M::SymTridiagonal{T}) =convert(Matrix{T}, M)
0 commit comments