0

My colleages and I, for the past three days have being trying to define an $n$ by $n$ tridiagonal matrix in maple.

we try to use the toolbox provided in maple but we ran into a problem as the size of the matrix was too large.

Pedro
  • 18,817
  • 7
  • 65
  • 127

1 Answers1

2

Try using BandMatrix in the LinearAlgebra package. For example, if $A$, $B$ and $C$ are lists of length $n-1$, $n$ and $n-1$ respectively, the tridiagonal matrix whose subdiagonal, diagonal and superdiagonal are $A$, $B$ and $C$ can be constructed by

LinearAlgebra:-BandMatrix([A,B,C]);

This is memory-efficient because it uses a "band" storage option: no memory is required to store the zeros outside of those three diagonals.

Robert Israel
  • 448,999