graph/layout: handle difference between pure go and asm kernels

This commit is contained in:
Dan Kortschak
2019-08-08 14:26:45 +09:30
parent 2dfa205328
commit 99e48c9b02
8 changed files with 17 additions and 1 deletions

View File

@@ -0,0 +1,12 @@
// Copyright ©2019 The Gonum Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// +build noasm appengine safe
package layout
// Change the testdata path for calculations done without assembly kernels.
func init() {
tag = "_noasm"
}

View File

@@ -15,6 +15,10 @@ import (
"gonum.org/v1/plot/vg"
)
// tag is modified in isomap_noasm_test.go to "_noasm" when any
// build tag prevents use of the assembly numerical kernels.
var tag string
var isomapR2Tests = []struct {
name string
g graph.Graph
@@ -160,7 +164,7 @@ func TestIsomapR2(t *testing.T) {
}
p.Add(render{o})
p.HideAxes()
path := filepath.Join("testdata", test.name+".png")
path := filepath.Join("testdata", test.name+tag+".png")
err = p.Save(10*vg.Centimeter, 10*vg.Centimeter, path)
if err != nil {
t.Errorf("unexpected error: %v", err)

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB