MCPcopy Index your code
hub / github.com/gonum/plot / complexContourBench

Function complexContourBench

plotter/contour_test.go:122–145  ·  view source on GitHub ↗
(noise float64, b *testing.B)

Source from the content-addressed store, hash-verified

120var cp map[float64][]vg.Path
121
122func complexContourBench(noise float64, b *testing.B) {
123 rnd := rand.New(rand.NewPCG(1, 1))
124
125 data := make([]float64, 6400)
126 for i := range data {
127 r := float64(i/80) - 40
128 c := float64(i%80) - 40
129
130 data[i] = rnd.NormFloat64()*noise + math.Hypot(r, c)
131 }
132
133 m := unitGrid{mat.NewDense(80, 80, data)}
134
135 levels := []float64{-1, 3, 7, 9, 13, 15, 19, 23, 27, 31}
136
137 var p map[float64][]vg.Path
138
139 b.ResetTimer()
140 for i := 0; i < b.N; i++ {
141 p = contourPaths(m, levels, unity, unity)
142 }
143
144 cp = p
145}
146
147func TestContourPaths(t *testing.T) {
148 m := unitGrid{mat.NewDense(3, 4, []float64{

Callers 7

BenchmarkComplexContour0Function · 0.85
BenchmarkComplexContour1Function · 0.85
BenchmarkComplexContour2Function · 0.85
BenchmarkComplexContour4Function · 0.85
BenchmarkComplexContour8Function · 0.85

Calls 1

contourPathsFunction · 0.85

Tested by

no test coverage detected