Bidiagonal

``````..  Bidiagonal(dv, ev, isupper)

Constructs an upper (``isupper=true``) or lower (``isupper=false``) bidiagonal matrix
using the given diagonal (``dv``) and off-diagonal (``ev``) vectors.  The result is of type ``Bidiagonal`` and provides efficient specialized linear solvers, but may be converted into a regular matrix with :func:`full`.``````

Examples

``````"""
Bidiagonal(dv, ev, isupper)

Constructs an upper (`isupper=true`) or lower (`isupper=false`) bidiagonal matrix using the given diagonal (`dv`) and off-diagonal (`ev`) vectors. The result is of type `Bidiagonal` and provides efficient specialized linear solvers but may be converted into a regular matrix with `full`.
"""

# Example 1: Construct an upper bidiagonal matrix
julia> dv = [1, 2, 3]
julia> ev = [4, 5, 6]
julia> isupper = true
julia> b = Bidiagonal(dv, ev, isupper)
3×3 Bidiagonal{Int64,Array{Int64,1}}:
1  4  ⋅
⋅  2  5
⋅  ⋅  3

# Example 2: Construct a lower bidiagonal matrix
julia> dv = [1, 2, 3]
julia> ev = [4, 5, 6]
julia> isupper = false
julia> b = Bidiagonal(dv, ev, isupper)
3×3 Bidiagonal{Int64,Array{Int64,1}}:
1  ⋅  ⋅
4  2  ⋅
⋅  5  3

# Example 3: Convert Bidiagonal matrix to a full matrix
julia> full(b)
3×3 Array{Int64,2}:
1  0  0
4  2  0
0  5  3``````

This function constructs a bidiagonal matrix using the given diagonal (`dv`) and off-diagonal (`ev`) vectors. The `isupper` argument determines whether the matrix is upper or lower bidiagonal. The resulting matrix can be used for efficient specialized linear solvers. If needed, the `Bidiagonal` matrix can be converted into a regular matrix using the `full` function.