Commit 7f354f4
authored
Make
`fillstored!` offers a way to fill only the stored indices of a
structured matrix without having to populate the parent. E.g.:
```julia
julia> U = UpperTriangular(zeros(4,4))
4×4 UpperTriangular{Float64, Matrix{Float64}}:
0.0 0.0 0.0 0.0
⋅ 0.0 0.0 0.0
⋅ ⋅ 0.0 0.0
⋅ ⋅ ⋅ 0.0
julia> LinearAlgebra.fillstored!(U, 2)
4×4 UpperTriangular{Float64, Matrix{Float64}}:
2.0 2.0 2.0 2.0
⋅ 2.0 2.0 2.0
⋅ ⋅ 2.0 2.0
⋅ ⋅ ⋅ 2.0
```
This seems like a useful function that should be public. This came up on
discourse:
https://discourse.julialang.org/t/how-to-set-all-elements-in-a-lower-triangular-matrix/128603fillstored! public (#1333)1 parent 2702a49 commit 7f354f4
File tree
5 files changed
+63
-8
lines changed- src
- test
5 files changed
+63
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
179 | 179 | | |
180 | 180 | | |
181 | 181 | | |
182 | | - | |
| 182 | + | |
| 183 | + | |
183 | 184 | | |
184 | 185 | | |
185 | 186 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
320 | 320 | | |
321 | 321 | | |
322 | 322 | | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
323 | 343 | | |
324 | 344 | | |
325 | 345 | | |
326 | | - | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
327 | 350 | | |
328 | 351 | | |
329 | 352 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
402 | 402 | | |
403 | 403 | | |
404 | 404 | | |
405 | | - | |
406 | | - | |
407 | | - | |
408 | | - | |
409 | | - | |
410 | | - | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
411 | 408 | | |
| 409 | + | |
412 | 410 | | |
413 | 411 | | |
414 | 412 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
841 | 841 | | |
842 | 842 | | |
843 | 843 | | |
| 844 | + | |
| 845 | + | |
| 846 | + | |
| 847 | + | |
| 848 | + | |
| 849 | + | |
| 850 | + | |
| 851 | + | |
| 852 | + | |
| 853 | + | |
| 854 | + | |
| 855 | + | |
| 856 | + | |
| 857 | + | |
| 858 | + | |
| 859 | + | |
| 860 | + | |
| 861 | + | |
| 862 | + | |
| 863 | + | |
| 864 | + | |
| 865 | + | |
| 866 | + | |
| 867 | + | |
844 | 868 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1190 | 1190 | | |
1191 | 1191 | | |
1192 | 1192 | | |
| 1193 | + | |
| 1194 | + | |
| 1195 | + | |
| 1196 | + | |
| 1197 | + | |
| 1198 | + | |
| 1199 | + | |
| 1200 | + | |
| 1201 | + | |
1193 | 1202 | | |
0 commit comments