mirror of
https://github.com/gonum/gonum.git
synced 2025-12-24 13:47:56 +08:00
integrate: make tests parallel
This commit is contained in:
@@ -13,6 +13,7 @@ import (
|
||||
)
|
||||
|
||||
func TestHermite(t *testing.T) {
|
||||
t.Parallel()
|
||||
for cas, test := range []struct {
|
||||
n int
|
||||
f func(float64) float64
|
||||
@@ -70,6 +71,7 @@ func TestHermite(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestHermiteLocations(t *testing.T) {
|
||||
t.Parallel()
|
||||
// Test the hermite locations and weights against other precomputed table.
|
||||
// Data from http://dlmf.nist.gov/3.5.
|
||||
for _, test := range []struct {
|
||||
@@ -139,6 +141,7 @@ func TestHermiteLocations(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestHermiteInitialGuesses(t *testing.T) {
|
||||
t.Parallel()
|
||||
for _, test := range []struct {
|
||||
n int
|
||||
want []float64
|
||||
@@ -164,6 +167,7 @@ func TestHermiteInitialGuesses(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestHermiteLocationsAsy0(t *testing.T) {
|
||||
t.Parallel()
|
||||
for _, test := range []struct {
|
||||
n int
|
||||
x []float64
|
||||
@@ -199,6 +203,7 @@ func TestHermiteLocationsAsy0(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestHermiteAsyAiry(t *testing.T) {
|
||||
t.Parallel()
|
||||
for _, test := range []struct {
|
||||
n int
|
||||
theta []float64
|
||||
|
||||
@@ -12,6 +12,7 @@ import (
|
||||
)
|
||||
|
||||
func TestLegendre(t *testing.T) {
|
||||
t.Parallel()
|
||||
for i, test := range []struct {
|
||||
f func(float64) float64
|
||||
min, max float64
|
||||
@@ -43,6 +44,7 @@ func TestLegendre(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestLegendreSingle(t *testing.T) {
|
||||
t.Parallel()
|
||||
for c, test := range []struct {
|
||||
n int
|
||||
min, max float64
|
||||
|
||||
@@ -13,6 +13,7 @@ import (
|
||||
)
|
||||
|
||||
func TestFixed(t *testing.T) {
|
||||
t.Parallel()
|
||||
for i, test := range []struct {
|
||||
f func(float64) float64
|
||||
min, max float64
|
||||
@@ -85,6 +86,7 @@ func (l legendreNonSingle) FixedLocations(x, weight []float64, min, max float64)
|
||||
}
|
||||
|
||||
func TestFixedNonSingle(t *testing.T) {
|
||||
t.Parallel()
|
||||
// TODO(btracey): Add tests with infinite bounds when we have native support
|
||||
// for indefinite integrals.
|
||||
for i, test := range []struct {
|
||||
|
||||
@@ -13,6 +13,7 @@ import (
|
||||
)
|
||||
|
||||
func TestRomberg(t *testing.T) {
|
||||
t.Parallel()
|
||||
for i, test := range []struct {
|
||||
integral testquad.Integral
|
||||
n int
|
||||
|
||||
@@ -14,6 +14,7 @@ import (
|
||||
)
|
||||
|
||||
func TestSimpsons(t *testing.T) {
|
||||
t.Parallel()
|
||||
rnd := rand.New(rand.NewSource(1))
|
||||
for i, test := range []struct {
|
||||
integral testquad.Integral
|
||||
|
||||
@@ -14,6 +14,7 @@ import (
|
||||
)
|
||||
|
||||
func TestTrapezoidal(t *testing.T) {
|
||||
t.Parallel()
|
||||
rnd := rand.New(rand.NewSource(1))
|
||||
for i, test := range []struct {
|
||||
integral testquad.Integral
|
||||
|
||||
Reference in New Issue
Block a user