mat: fix lint and vet errors
MODIFY
mat/band.go
mat/band.go
@@ -12,7 +12,7 @@ var (
bandDense *BandDense
_ Matrix = bandDense
_ Banded = bandDense
- _ RawBand = bandDense
+ _ RawBander = bandDense
)
// BandDense represents a band matrix in dense storage format.
@@ -20,6 +20,7 @@ type BandDense struct {
mat blas64.Band
}
+// Banded is a band matrix representation.
type Banded interface {
Matrix
// Bandwidth returns the lower and upper bandwidth values for
@@ -31,7 +32,10 @@ type Banded interface {
TBand() Banded
}
-type RawBand interface {
+// A RawBander can return a blas64.Band representation of the receiver.
+// Changes to the blas64.Band.Data slice will be reflected in the original
+// matrix, changes to the Rows, Cols, KL, KU and Stride fields will not.
+type RawBander interface {
RawBand() blas64.Band
}

MODIFY
mat/band_test.go
mat/band_test.go
@@ -274,13 +274,13 @@ func TestBandAtSet(t *testing.T) {
for i := 0; i < 6; i++ {
for j := 0; j < 6; j++ {
if band.At(i, j) != want.At(i, j) {
- t.Errorf("unexpected value for band.At(%d, %d): got:%v want:%v", band.At(i, j), want.At(i, j))
+ t.Errorf("unexpected value for band.At(%d, %d): got:%v want:%v", i, j, band.At(i, j), want.At(i, j))
}
}
}
// Do that same thing via a call to Equal.
if !Equal(band, want) {
- t.Errorf("unexpected value via mat.Equal: got: %v want: %v", band, want)
+ t.Errorf("unexpected value via mat.Equal:\ngot:\n% v\nwant:\n% v", Formatted(band), Formatted(want))
}
// Check At out of bounds
@@ -343,7 +343,7 @@ func TestBandAtSet(t *testing.T) {
}
band.SetBand(st.row, st.col, st.new)
if e := band.At(st.row, st.col); e != st.new {
- t.Errorf("unexpected value for At(%d, %d) after SetTri(%[1]d, %d, %v): got: %v want: %[3]v", st.row, st.col, st.new, e)
+ t.Errorf("unexpected value for At(%d, %d) after SetBand(%[1]d, %d, %v): got: %v want: %[3]v", st.row, st.col, st.new, e)
}
}
}

mat: fix lint and vet errors