Skip to content

Commit

Permalink
mat: reduce method load on SymBandDens
Browse files Browse the repository at this point in the history
For discussion.
  • Loading branch information
kortschak committed Jul 9, 2017
1 parent 1b09a59 commit cb039e6
Showing 1 changed file with 2 additions and 17 deletions.
19 changes: 2 additions & 17 deletions mat/symband.go
Expand Up @@ -23,21 +23,11 @@ type SymBandDense struct {
mat blas64.SymmetricBand
}

// SymBanded represents a symmetric banded matrix (where the element at {i, j} equals
// the element at {j, i}). Only elements within k of the diagonal are non-zero. Symmetric
// matrices are always square.
type SymBanded interface {
Symmetric

// HalfBandwidth returns the half bandwidth value for the matrix.
// The total bandwidth of the matrix is 2*k+1.
HalfBandwidth() (k int)
}

// MutableSymBanded is a symmetric band matrix interface type that allows elements
// to be altered.
type MutableSymBanded interface {
SymBanded
Symmetric
Bandwidth() (kl, ku int)
SetSymBand(i, j int, v float64)
}

Expand Down Expand Up @@ -118,11 +108,6 @@ func (s *SymBandDense) Bandwidth() (kl, ku int) {
return s.mat.K, s.mat.K
}

// HalfBandwidth returns the bandwidth of the matrix.
func (s *SymBandDense) HalfBandwidth() (k int) {
return s.mat.K
}

// T implements the Matrix interface. Symmetric matrices, by definition, are
// equal to their transpose, and this is a no-op.
func (s *SymBandDense) T() Matrix {
Expand Down

0 comments on commit cb039e6

Please sign in to comment.