Code
Hub
Workspaces
Connect
Indexed graphs
Engine
MCP
copy
hub
/
github.com/arnauddri/algorithms
/ trace
Method
trace
data-structures/matrix/matrix.go:83–89 ·
view source on GitHub ↗
()
Source
from the content-addressed store, hash-verified
81
}
82
83
func
(A *Matrix) trace() float64 {
84
var
tr float64 = 0
85
for
i := 0; i < A.cols; i++ {
86
tr += A.GetElm(i, i)
87
}
88
return
tr
89
}
90
91
func
(A *Matrix) add(B *Matrix) error {
92
if
A.cols != B.cols && A.rows != B.rows {
Callers
1
TestTrace
Function · 0.80
Calls
1
GetElm
Method · 0.95
Tested by
1
TestTrace
Function · 0.64