Max-plus algebra the big power of A (i.e. A⊗m, 2p = m ≥ n)
[Z] = maxpluspwrbig(A,n)
This function returns Z = A⊗m, where m =2p with p is the smallest integer that satisfy 2p = m ≥ n. And n is not exceed 10300.
A = sprand(5,5,0.7); k = find(A == 0); A(k) = -%inf; A = round(10*A); A = full(A) A = 2. -Inf 8. 2. 9. 6. -Inf -Inf 8. 8. 8. -Inf 6. 1. 5. 0. 2. 5. 3. 10. 7. 4. -Inf -Inf 6. Z = maxpluspwrbig(A,10^100) Z = 1.0+101 * 1.3998405 1.3998405 1.3998405 1.3998405 1.3998405 1.3998405 1.3998405 1.3998405 1.3998405 1.3998405 1.3998405 1.3998405 1.3998405 1.3998405 1.3998405 1.3998405 1.3998405 1.3998405 1.3998405 1.3998405 1.3998405 1.3998405 1.3998405 1.3998405 1.3998405 | ![]() | ![]() |