Home > Mobile >  Efficient way of creating a band (or banded) matrix
Efficient way of creating a band (or banded) matrix

Time:06-22

I'm trying to create a certain style of band(ed) matrix (see vs all

import perfplot

perfplot.show(
    setup = lambda M: M,
    kernels = [banded_matrix_einsum, banded_matrix_scipy, banded_matrix],
    n_range = [50, 100, 150, 200, 250, 300],
    logx = False
)

scipy.linalg.block_diag vs np.einsum details

scipy vs einsum

perfplot.show(
    setup = lambda M: M,
    kernels = [banded_matrix_einsum, banded_matrix_scipy],
    n_range = [50, 100, 150, 200, 250, 300, 350, 400],
    logx = False
)
  • Related