I'm working on a project in Julia where I create a 13x13 matrix with random numbers, then I check if that matrix is diagonally dominate. I'm pretty new with Julia, but I've worked a lot with some other prgrams so this program is kind of an iteration off of python.
function checkD()
A=2*rand(13,13).-1
G=A'A
j=1
i=1
for i=1:13
sum = 0
for j=1:13
sum = sum + abs.(G[i,j])
end
sum = sum - abs.(G[i,i])
if(abs.(G[i,i]) < sum)
return false
end
return true
end
I understand the declaration of the j and i at the start is a little redundant but for now I leave them there. My issue is that I keep getting false even though I know that the matrix G=A'A is diagonally dominate.