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

Function TestAdd

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

Source from the content-addressed store, hash-verified

59}
60
61func TestAdd(t *testing.T) {
62 a := []float64{1, 1, 1, 1}
63 A := MakeMatrix(a, 2, 2)
64 B := MakeMatrix([]float64{2, 2, 2, 2}, 2, 2)
65
66 A.add(A)
67 if !FloatArrayEquals(A.Elements, B.Elements) {
68 t.Error()
69 }
70}
71
72func TestSubstract(t *testing.T) {
73 a := []float64{1, 1, 1, 1}

Callers

nothing calls this directly

Calls 3

MakeMatrixFunction · 0.85
addMethod · 0.80
FloatArrayEqualsFunction · 0.70

Tested by

no test coverage detected