用法一
Bidiagonal(dv::V, ev::V, uplo::Symbol) where V <: AbstractVector
使用給定的對角線 (dv
) 和 off-diagonal (ev
) 向量構造一個上 (uplo=:U
) 或下 (uplo=:L
) 雙對角矩陣。結果是類型Bidiagonal
並提供高效的專用線性求解器,但可以使用
(或簡稱convert(Array, _)
Array(_)
)轉換為規則矩陣。 ev
的長度必須比 dv
的長度小一。
例子
julia> dv = [1, 2, 3, 4]
4-element Vector{Int64}:
1
2
3
4
julia> ev = [7, 8, 9]
3-element Vector{Int64}:
7
8
9
julia> Bu = Bidiagonal(dv, ev, :U) # ev is on the first superdiagonal
4×4 Bidiagonal{Int64, Vector{Int64}}:
1 7 ⋅ ⋅
⋅ 2 8 ⋅
⋅ ⋅ 3 9
⋅ ⋅ ⋅ 4
julia> Bl = Bidiagonal(dv, ev, :L) # ev is on the first subdiagonal
4×4 Bidiagonal{Int64, Vector{Int64}}:
1 ⋅ ⋅ ⋅
7 2 ⋅ ⋅
⋅ 8 3 ⋅
⋅ ⋅ 9 4
用法二
Bidiagonal(A, uplo::Symbol)
從A
的主對角線及其第一個超(如果是uplo=:U
)或sub-diagonal(如果是uplo=:L
)構造一個Bidiagonal
矩陣。
例子
julia> A = [1 1 1 1; 2 2 2 2; 3 3 3 3; 4 4 4 4]
4×4 Matrix{Int64}:
1 1 1 1
2 2 2 2
3 3 3 3
4 4 4 4
julia> Bidiagonal(A, :U) # contains the main diagonal and first superdiagonal of A
4×4 Bidiagonal{Int64, Vector{Int64}}:
1 1 ⋅ ⋅
⋅ 2 2 ⋅
⋅ ⋅ 3 3
⋅ ⋅ ⋅ 4
julia> Bidiagonal(A, :L) # contains the main diagonal and first subdiagonal of A
4×4 Bidiagonal{Int64, Vector{Int64}}:
1 ⋅ ⋅ ⋅
2 2 ⋅ ⋅
⋅ 3 3 ⋅
⋅ ⋅ 4 4
相關用法
- Julia LinearAlgebra.BLAS.dot用法及代碼示例
- Julia LinearAlgebra.BLAS.dotu用法及代碼示例
- Julia LinearAlgebra.BunchKaufman用法及代碼示例
- Julia LinearAlgebra.BLAS.dotc用法及代碼示例
- Julia LinearAlgebra.BLAS.nrm2用法及代碼示例
- Julia LinearAlgebra.BLAS.asum用法及代碼示例
- Julia LinearAlgebra.bunchkaufman用法及代碼示例
- Julia LinearAlgebra.cholesky!用法及代碼示例
- Julia LinearAlgebra.istriu用法及代碼示例
- Julia LinearAlgebra.istril用法及代碼示例
- Julia LinearAlgebra.stride1用法及代碼示例
- Julia LinearAlgebra.svd用法及代碼示例
- Julia LinearAlgebra.logdet用法及代碼示例
- Julia LinearAlgebra.eigen用法及代碼示例
- Julia LinearAlgebra.ldlt!用法及代碼示例
- Julia LinearAlgebra.I用法及代碼示例
- Julia LinearAlgebra.Transpose用法及代碼示例
- Julia LinearAlgebra.det用法及代碼示例
- Julia LinearAlgebra.tril!用法及代碼示例
- Julia LinearAlgebra.schur!用法及代碼示例
- Julia LinearAlgebra.tr用法及代碼示例
- Julia LinearAlgebra.axpby!用法及代碼示例
- Julia LinearAlgebra.adjoint!用法及代碼示例
- Julia LinearAlgebra.eigvecs用法及代碼示例
- Julia LinearAlgebra.LU用法及代碼示例
注:本文由純淨天空篩選整理自julialang.org 大神的英文原創作品 LinearAlgebra.Bidiagonal — Type。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。