MCPcopy
hub / github.com/arnauddri/algorithms / TestSubstract

Function TestSubstract

data-structures/matrix/matrix_test.go:72–81  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

70}
71
72func TestSubstract(t *testing.T) {
73 a := []float64{1, 1, 1, 1}
74 A := MakeMatrix(a, 2, 2)
75 B := MakeMatrix([]float64{2, 2, 2, 2}, 2, 2)
76
77 B.substract(A)
78 if !FloatArrayEquals(A.Elements, B.Elements) {
79 t.Error()
80 }
81}
82
83func TestScale(t *testing.T) {
84 a := []float64{1, 1, 1, 1}

Callers

nothing calls this directly

Calls 3

MakeMatrixFunction · 0.85
substractMethod · 0.80
FloatArrayEqualsFunction · 0.70

Tested by

no test coverage detected