mirror of
https://github.com/gonum/gonum.git
synced 2025-10-05 23:26:52 +08:00
mat: relax list test type restrictions for Vector parameters
This commit is contained in:
@@ -371,14 +371,18 @@ type basicVector struct {
|
||||
m []float64
|
||||
}
|
||||
|
||||
func (v *basicVector) AtVec(i int) float64 {
|
||||
if i < 0 || i >= v.Len() {
|
||||
panic(ErrRowAccess)
|
||||
}
|
||||
return v.m[i]
|
||||
}
|
||||
|
||||
func (v *basicVector) At(r, c int) float64 {
|
||||
if c != 0 {
|
||||
panic(ErrColAccess)
|
||||
}
|
||||
if r < 0 || r >= v.Len() {
|
||||
panic(ErrRowAccess)
|
||||
}
|
||||
return v.m[r]
|
||||
return v.AtVec(r)
|
||||
}
|
||||
|
||||
func (v *basicVector) Dims() (r, c int) {
|
||||
@@ -411,7 +415,7 @@ func TestDot(t *testing.T) {
|
||||
}
|
||||
return sum
|
||||
}
|
||||
testTwoInputFunc(t, "Dot", f, denseComparison, sameAnswerFloatApproxTol(1e-12), legalTypesVecVec, legalSizeSameVec)
|
||||
testTwoInputFunc(t, "Dot", f, denseComparison, sameAnswerFloatApproxTol(1e-12), legalTypesVectorVector, legalSizeSameVec)
|
||||
}
|
||||
|
||||
func TestEqual(t *testing.T) {
|
||||
|
Reference in New Issue
Block a user