WUT_Computer_Science/ENUME/references/ENUME_ProjectA_No31/task 3/rowDominant.m
2021-11-10 13:12:25 +01:00

22 lines
368 B
Matlab

function [out] = rowDominant(A)
%ROWDOMINANT checks row dominance of matrix A
% returns true when dominant, false otherwise
n = size(A);
for i = 1:1:n
sum = 0;
for j = 1:1:n
if i == j
continue
end
sum = sum + abs(A(i,j));
end
if abs(A(i,i)) <= sum
out = false;
return
end
end
out = true;
end