Result.m

 avatar
unknown
matlab
2 months ago
1.1 kB
2
Indexable
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Result.m
classdef Result < handle

    properties
        f_call_count int32 = 0;
        iters = {};
        simplexes = {};
        arrows = {};
    end


    methods
        function obj = addIteration(obj, point, f_val, normgrad, grad)
            obj.iters{end + 1} = [point, f_val, normgrad, grad];
        end   

        function obj = addFastestIteration(obj, point, f, normgrad, grad, gamma)
            obj.iters{end + 1} = [point(1), point(2), f(point), normgrad, grad, gamma];
        end 

        function obj = addIterSimplex(obj, point)
            obj.iters{end + 1} = point;
        end

        function obj = incFuncCallCount(obj)
            obj.f_call_count = obj.f_call_count + 1;
        end

        function obj = addSimplex(obj, simplex)
            obj.simplexes{end + 1} = simplex;
        end

        function obj = addArrow(obj, start, endd)
            obj.arrows{end + 1} = [start, endd];
        end
    end

end
Leave a Comment