Check whether a square matrix has non-zero entries only on the main diagonal and the diagonal directly above it.
How It Works
How Bidiagonal Matrix Checker Works
This is a relaxed version of the diagonal test — it allows one extra band of non-zero values directly above the main diagonal (the superdiagonal), while every other position must still be zero.
FAQ
Frequently Asked Questions
Where does a bidiagonal structure come from in practice?
It commonly appears as an intermediate step in numerical algorithms like the QR algorithm and singular value decomposition, where a dense matrix is first reduced to bidiagonal form before further processing.
Is a diagonal matrix automatically bidiagonal too?
Yes — since a diagonal matrix already has zeros everywhere except the main diagonal, it automatically satisfies the (looser) bidiagonal condition as well.