Dark Mode

Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

JuliaLinearAlgebra/BandedMatrices.jl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

737 Commits

Repository files navigation

BandedMatrices.jl

A Julia package for representing banded matrices

This package supports representing banded matrices by only the entries on the bands.

One can create banded matrices of type BandedMatrix as follows:

BandedMatrix(-1=> 1:5, 2=>1:3) # creates a 6 x 6 banded matrix version of diagm(-1=> 1:5, 2=>1:3)
BandedMatrix((-1=> 1:5, 2=>1:3), (n,m)) # creates an n x m banded matrix with 1 sub-diagonals and u super-diagonals with the specified diagonals
BandedMatrix((-1=> 1:5, 2=>1:3), (n,m), (l,u)) # creates an n x m banded matrix with l sub-diagonals and u super-diagonals with the specified diagonals
BandedMatrix(FillArrays.Zeros(m,n), (l,u)) # creates a banded matrix of zeros, with l sub-diagonals and u super-diagonals
BandedMatrix(FillArrays.Ones(m,n), (l,u)) # creates a banded matrix of ones, with l sub-diagonals and u super-diagonals
BandedMatrix(FillArrays.Eye(n), (l,u)) # creates a banded n x n identity matrix, with l sub-diagonals and u super-diagonals
brand(m,n,l,u) # creates a random banded matrix, with l sub-diagonals and u super-diagonals

For more examples, see the documentation.

Specialized algebra routines are overriden, include * and \:

A = brand(10000,10000,4,3) # creates a 10000 x 10000 matrix with 4 sub-diagonals
# and 3 super-diagonals
b = randn(10000)
A*b # Calls optimized matrix*vector routine
A*A # Calls optimized matrix*matrix routine
A\b # Calls optimized matrix\vector routine

About

A Julia package for representing banded matrices

Resources

Readme

License

View license

Stars

Watchers

Forks

Contributors

Languages