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

Method scale

data-structures/matrix/matrix.go:117–123  ·  view source on GitHub ↗
(a float64)

Source from the content-addressed store, hash-verified

115}
116
117func (A *Matrix) scale(a float64) {
118 for i := 0; i < A.rows; i++ {
119 for j := 0; j < A.cols; j++ {
120 A.SetElm(i, j, a*A.GetElm(i, j))
121 }
122 }
123}
124
125func Add(A *Matrix, B *Matrix) *Matrix {
126 result := MakeMatrix(make([]float64, A.cols*A.rows), A.cols, A.rows)

Callers 1

TestScaleFunction · 0.80

Calls 2

SetElmMethod · 0.95
GetElmMethod · 0.95

Tested by 1

TestScaleFunction · 0.64