用法一
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。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。