function test_suite = test_steepest_descent
    clear all;
    initTestSuite;
end


function test_1
    A = [3 2; 2 6];
    X = [ 2 1 0 4; 
         -2 2 0 4];
    B = A * X;
    solver = SPX_SteepestDescent(A, B);
    x = solver.solve();
    %solver.printResults();
    verifyTrue(testCase, solver.hasConverged());
end

function test_2
    A  = [
    2 -1 0; 
    -1 2 -1;
    0 -1 2];
    X = randi(10, 3,3);
    B = A * X;
    solver = SPX_SteepestDescent(A, B);
    % This one doesn't converge in 30 iterations
    solver.MaxIterations = 50; 
    x = solver.solve();
    verifyTrue(testCase, solver.hasConverged());
end



indigits
github-repos/MATLAB/indigits-sparse-plex/sparse-plex-43cae2978f62938d001baaa03308a2a717ee6c9b/library/+spx/+opt/convex_optimization/steepest_descent/tests/test_steepest_descent.m
sparse-plex
github-repos/MATLAB/indigits-sparse-plex
43cae2978f62938d001baaa03308a2a717ee6c9b