Skip to content

Commit

Permalink
remove misleading bidiag constructor, make Bidiagonal immutable
Browse files Browse the repository at this point in the history
  • Loading branch information
fredrikekre committed Jul 11, 2017
1 parent d91583d commit e34e35b
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
3 changes: 1 addition & 2 deletions base/linalg/bidiag.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# This file is a part of Julia. License is MIT: https://julialang.org/license

# Bidiagonal matrices
mutable struct Bidiagonal{T} <: AbstractMatrix{T}
struct Bidiagonal{T} <: AbstractMatrix{T}
dv::Vector{T} # diagonal
ev::Vector{T} # sub/super diagonal
uplo::Char # upper bidiagonal ('U') or lower ('L')
Expand Down Expand Up @@ -58,7 +58,6 @@ julia> Bl = Bidiagonal(dv, ev, :L) # ev is on the first subdiagonal
function Bidiagonal(dv::AbstractVector{T}, ev::AbstractVector{T}, uplo::Symbol) where T
Bidiagonal{T}(collect(dv), collect(ev), char_uplo(uplo))
end
Bidiagonal(dv::AbstractVector, ev::AbstractVector) = throw(ArgumentError("did you want an upper or lower Bidiagonal? Try again with an additional true (upper) or false (lower) argument."))

function Bidiagonal(dv::AbstractVector{Td}, ev::AbstractVector{Te}, uplo::Symbol) where {Td,Te}
T = promote_type(Td,Te)
Expand Down
1 change: 0 additions & 1 deletion test/linalg/bidiag.jl
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ srand(1)
@test Bidiagonal(dv,ev,:U) != Bidiagonal(dv,ev,:L)
@test_throws ArgumentError Bidiagonal(dv,ev,:R)
@test_throws DimensionMismatch Bidiagonal(dv,ones(elty,n),:U)
@test_throws ArgumentError Bidiagonal(dv,ev)
end

@testset "getindex, setindex!, size, and similar" begin
Expand Down

0 comments on commit e34e35b

Please sign in to comment.