function [X,gradX,fval,iter] = EXTREMA(eps,T,A,f,Niter)
% [X,gradX,fval,iter] = EXTREMA(eps,T,A,f,Niter)
n    = length(T); 
F    = conj((jacobian(f,T))'); H  = hessian(f,T);
[X,gradX,iter] = NEWTONmultiD(eps,T,A,F,Niter); 
fval = eval(subs(f,T,X)); Hval = eval(subs(H,T,X)); 
detH = det(Hval); Eig = eig(Hval); Sig = sign(Eig); 
if iter == Niter 
    'non convergence'
else if det(Hval) < eps
    'point critique singulier' 
else 
    if Sig == -ones(n,1) 
        'maximum local' 
    elseif Sig == ones(n,1) 
        'minimum local' 
    else 
        'point selle' 
    end
end 
end

