linalg(deprecated)/band - Help

linalg(deprecated)

 band
 create a band matrix

 Calling Sequence band(b, n)

Parameters

 b - list or vector n - positive integer

Description

 • Important: The linalg package has been deprecated. Use the superseding command LinearAlgebra[BandMatrix], instead.
 - For information on migrating linalg code to the new packages, see examples/LinearAlgebraMigration.
 • The call band(b, n) creates an n x n banded matrix using the elements of b. The number of elements of b must be odd and not greater than 2*n-1.
 • If b has n elements, the middle n diagonals of the result are initialized to the elements of b, in left-to-right order. In each diagonal all elements have the same value.
 • If 2*n-1 is larger than the length of b, then the remaining sub- and super-diagonals are set to zero.
 • The matrix result uses a sparse indexing function.
 • The command with(linalg,band) allows the use of the abbreviated form of this command.

Examples

Important: The linalg package has been deprecated. Use the superseding command LinearAlgebra[BandMatrix], instead.

 > $\mathrm{with}\left(\mathrm{linalg}\right):$
 > $\mathrm{band}\left(\left[1\right],3\right)$
 $\left[\begin{array}{rrr}{1}& {0}& {0}\\ {0}& {1}& {0}\\ {0}& {0}& {1}\end{array}\right]$ (1)
 > $\mathrm{band}\left(\left[1,2,-1\right],4\right)$
 $\left[\begin{array}{rrrr}{2}& {-}{1}& {0}& {0}\\ {1}& {2}& {-}{1}& {0}\\ {0}& {1}& {2}& {-}{1}\\ {0}& {0}& {1}& {2}\end{array}\right]$ (2)