mat: add Banded methods to Diagonal

This commit is contained in:
Dan Kortschak
2018-11-21 14:32:31 +10:30
committed by Dan Kortschak
parent a4ff288f27
commit 17a33f2c20

View File

@@ -16,6 +16,7 @@ var (
_ MutableDiagonal = diagDense _ MutableDiagonal = diagDense
_ Triangular = diagDense _ Triangular = diagDense
_ Symmetric = diagDense _ Symmetric = diagDense
_ SymBanded = diagDense
_ Banded = diagDense _ Banded = diagDense
_ RawBander = diagDense _ RawBander = diagDense
_ RawSymBander = diagDense _ RawSymBander = diagDense
@@ -30,6 +31,12 @@ type Diagonal interface {
// matrices to be used in functions taking symmetric inputs. // matrices to be used in functions taking symmetric inputs.
Diag() int Diag() int
Symmetric() int Symmetric() int
// Bandwidth and TBand are included in the Diagonal interface
// to allow the use of Diagonal types in banded functions.
// Bandwidth will always return (0, 0).
Bandwidth() (kl, ku int)
TBand() Banded
} }
// MutableDiagonal is a Diagonal matrix whose elements can be set. // MutableDiagonal is a Diagonal matrix whose elements can be set.