You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

14 lines
401 B

function testSolveLR()
success = test( [1,3,2; 2,15,2; 1,3,4], [1;2;3] )
success = success & test ( [1,1,1; 4,3,-1; 3,5,3], [4;2;0] )
success = success & test ( [1, 0, 0; 0, 1, 0; 0, 0, 1], [4; 2; 0] )
if success
disp("It works!")
else
disp("It broke!")
end
end
function success = test(A, b)
success = isequal(linsolve(A, b), solveLR(gaussLR(A), b))
end