mirror of
https://github.com/sjwhitworth/golearn.git
synced 2025-04-28 13:48:56 +08:00
pairwise: update to latest mat64 API
This commit is contained in:
parent
c16fade796
commit
918a8c99ba
@ -24,8 +24,8 @@ func TestChebyshev(t *testing.T) {
|
||||
})
|
||||
|
||||
Convey("When calculating distance with row vectors", func() {
|
||||
vectorX.TCopy(vectorX)
|
||||
vectorY.TCopy(vectorY)
|
||||
vectorX.Copy(vectorX.T())
|
||||
vectorY.Copy(vectorY.T())
|
||||
result := chebyshev.Distance(vectorX, vectorY)
|
||||
|
||||
Convey("The result should be 8", func() {
|
||||
@ -34,7 +34,7 @@ func TestChebyshev(t *testing.T) {
|
||||
})
|
||||
|
||||
Convey("When calculating distance with different dimension matrices", func() {
|
||||
vectorX.TCopy(vectorX)
|
||||
vectorX.Clone(vectorX.T())
|
||||
So(func() { chebyshev.Distance(vectorX, vectorY) }, ShouldPanic)
|
||||
})
|
||||
|
||||
|
@ -33,8 +33,8 @@ func TestCranberrra(t *testing.T) {
|
||||
})
|
||||
|
||||
Convey("When calculating distance with row vectors", func() {
|
||||
vectorX.TCopy(vectorX)
|
||||
vectorY.TCopy(vectorY)
|
||||
vectorX.Copy(vectorX.T())
|
||||
vectorY.Copy(vectorY.T())
|
||||
result := cranberra.Distance(vectorX, vectorY)
|
||||
|
||||
Convey("The result should be 2.9", func() {
|
||||
@ -42,8 +42,8 @@ func TestCranberrra(t *testing.T) {
|
||||
})
|
||||
})
|
||||
|
||||
Convey("When calculating distance with different dimention matrices", func() {
|
||||
vectorX.TCopy(vectorX)
|
||||
Convey("When calculating distance with different dimension matrices", func() {
|
||||
vectorX.Clone(vectorX.T())
|
||||
So(func() { cranberra.Distance(vectorX, vectorY) }, ShouldPanic)
|
||||
})
|
||||
|
||||
|
@ -33,8 +33,8 @@ func TestManhattan(t *testing.T) {
|
||||
})
|
||||
|
||||
Convey("When calculating distance with row vectors", func() {
|
||||
vectorX.TCopy(vectorX)
|
||||
vectorY.TCopy(vectorY)
|
||||
vectorX.Copy(vectorX.T())
|
||||
vectorY.Copy(vectorY.T())
|
||||
result := manhattan.Distance(vectorX, vectorY)
|
||||
|
||||
Convey("The result should be 5", func() {
|
||||
@ -42,8 +42,8 @@ func TestManhattan(t *testing.T) {
|
||||
})
|
||||
})
|
||||
|
||||
Convey("When calculating distance with different dimention matrices", func() {
|
||||
vectorX.TCopy(vectorX)
|
||||
Convey("When calculating distance with different dimension matrices", func() {
|
||||
vectorX.Clone(vectorX.T())
|
||||
So(func() { manhattan.Distance(vectorX, vectorY) }, ShouldPanic)
|
||||
})
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user