function [ maxnormval ] = tjsr_computemaxnormval(type);
% maxnormval = tjsr_computemaxnormval(type);
% This function belongs to tjsr!
% computes the value maxnormval, respects the value of delta and epspolyte
% Input
%   type        type struct from tjsr
% Output
%   maxnormval  
%
% Written by tommsch, 2018

    idx=tjsr_getlivevertex(type);
    normval=[type.cyclictree.norm{:}];
    maxnormval=max(normval(idx));
    
    %consider epspolytope and delta    
    if(isempty(maxnormval)); maxnormval=1; end; %compute maxnormval
    if(isnan(maxnormval)); maxnormval=inf; end;    
    maxnormval=maxnormval*(max(1,1-type.opt.epspolytope))/min(1,type.opt.delta);
    
    
end

function dummy; end %#ok<DEFNU> %Generates an error, if the 'end' of a function is missing.   