Max-plus algebra trace of a square matrix A
[v] = maxplustrace(A)
: an ouput scalar that is the trace of matrix A .
Function returns trace of matrix A
v = a1,1⊕a2,2⊕ ... ⊕an,n
a = [ 4. -%inf 1. 11. 18.; 15. 13. 11. 5. -%inf; -%inf 17. 13. 5. 13.; 7. 14. 15. -%inf 6.; 13. 18. 4. 4. 19.] v=maxplustrace(a)