|
13 | 13 |
|
14 | 14 | function _BandedMatrix end |
15 | 15 |
|
16 | | -mutable struct BandedMatrix{T, CONTAINER, RAXIS} <: AbstractBandedMatrix{T} |
| 16 | +struct BandedMatrix{T, CONTAINER, RAXIS} <: AbstractBandedMatrix{T} |
17 | 17 | data::CONTAINER # l+u+1 x n (# of columns) |
18 | 18 | raxis::RAXIS # axis for rows (col axis comes from data) |
19 | 19 | l::Int # lower bandwidth ≥0 |
@@ -163,7 +163,7 @@ promote_rule(::Type{BandedMatrix{T1, C1}}, ::Type{BandedMatrix{T2, C2}}) where { |
163 | 163 | BandedMatrix{promote_type(T1,T2), promote_type(C1, C2)} |
164 | 164 |
|
165 | 165 |
|
166 | | -for (op,bop) in ((:(rand),:brand),) |
| 166 | +for (op,bop) in ((:rand,:brand), (:randn,:brandn)) |
167 | 167 | @eval begin |
168 | 168 | $bop(::Type{T},n::Integer,m::Integer,a::Integer,b::Integer) where {T} = |
169 | 169 | _BandedMatrix($op(T,max(0,b+a+1),m),n,a,b) |
@@ -193,6 +193,13 @@ Creates an `n×m` banded matrix with random numbers in the bandwidth of type `T |
193 | 193 | """ |
194 | 194 | brand |
195 | 195 |
|
| 196 | +""" |
| 197 | + brandn(T,n,m,l,u) |
| 198 | +
|
| 199 | +Creates an `n×m` banded matrix with random normals in the bandwidth of type `T` with bandwidths `(l,u)` |
| 200 | +""" |
| 201 | +brand |
| 202 | + |
196 | 203 | ## Conversions from AbstractArrays, we include FillArrays in case `zeros` is ever faster |
197 | 204 | BandedMatrix{T}(A::AbstractMatrix, bnds::NTuple{2,Integer}) where T = |
198 | 205 | BandedMatrix{T, Matrix{T}}(A, bnds) |
|
0 commit comments