# BandedBlockBanded construction

**URL:** <https://discourse.julialang.org/t/bandedblockbanded-construction/51725>\
**Category:** General Usage\
**Created:** [December 12, 2020, 4:21pm UTC](https://discourse.julialang.org/t/bandedblockbanded-construction/51725 "2020-12-12T16:21:41Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![rveltz](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rveltz/32/2707_2.png) [@rveltz](https://discourse.julialang.org/u/rveltz)\
**Post date:** [December 12, 2020, 4:21pm UTC](https://discourse.julialang.org/t/bandedblockbanded-construction/51725/1 "2020-12-12T16:21:41Z")

</div>

Hi,

I have a block tri-diagonal matrix and I would like to try the solver associated to a BandedBlockBanded matrix (see [here](https://github.com/JuliaMatrices/BlockBandedMatrices.jl)).

I can easily construct the sparse matrix

```julia
Nx = 10
Ny = 10
T = spdiagm(0=> rand(Nx*Ny), -1=> rand(Nx*Ny-1), 1=> rand(Nx*Ny-1), Nx => rand(Nx*Ny-Nx), -Nx => rand(Nx*Ny-Nx))

```

However, the conversion to BandedBlockBanded is quite cumbersome. Is there a simple way rather than looping over the blocks, etc?

Thank you,  
Bests
