Code
Hub
Workspaces
Connect
Indexed graphs
Engine
MCP
copy
hub
/
github.com/arnauddri/algorithms
/ diagonalCopy
Method
diagonalCopy
data-structures/matrix/matrix.go:59–65 ·
view source on GitHub ↗
()
Source
from the content-addressed store, hash-verified
57
}
58
59
func
(A *Matrix) diagonalCopy() []float64 {
60
diag := make([]float64, A.cols)
61
for
i := 0; i < len(diag); i++ {
62
diag[i] = A.GetElm(i, i)
63
}
64
return
diag
65
}
66
67
func
(A *Matrix) copy() *Matrix {
68
B := new(Matrix)
Callers
nothing calls this directly
Calls
1
GetElm
Method · 0.95
Tested by
no test coverage detected