mirror of
https://github.com/gonum/gonum.git
synced 2025-10-24 07:34:11 +08:00
Started adding example functions
This commit is contained in:
9
examples.go
Normal file
9
examples.go
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
package sliceops
|
||||||
|
|
||||||
|
// Set of examples for all the functions
|
||||||
|
|
||||||
|
func ExampleAdd() {
|
||||||
|
s1 := []float64{1, 2, 3, 4}
|
||||||
|
s2 := []float64{5, 6, 7, 8}
|
||||||
|
Add(s1, s2)
|
||||||
|
}
|
||||||
@@ -9,10 +9,10 @@ import (
|
|||||||
|
|
||||||
const (
|
const (
|
||||||
EQTOLERANCE = 1E-14
|
EQTOLERANCE = 1E-14
|
||||||
SMALL = 1E2
|
SMALL = 10
|
||||||
MEDIUM = 1E3
|
MEDIUM = 1000
|
||||||
LARGE = 1E5
|
LARGE = 100000
|
||||||
HUGE = 1E7
|
HUGE = 10000000
|
||||||
)
|
)
|
||||||
|
|
||||||
func AreSlicesEqual(t *testing.T, truth, comp []float64, str string) {
|
func AreSlicesEqual(t *testing.T, truth, comp []float64, str string) {
|
||||||
|
|||||||
Reference in New Issue
Block a user