function [gf_nlp,gg_nlp,C,B] = grad (x,y)

if size(x,2) > 1
  y = x(2:2);         // NLP com integralidade relaxada
end

// * * *  exemplo 7 - Floudas pag 141 * * *
gf_nlp(1) = 2;
gg_nlp(1,1) = - 2*x(1);
gg_nlp(2,1) = 1;

if nargout > 2 | size(x,2) > 1
  C = [1];  
  B = [-1; 1];
end

if size(x,2) > 1         // NLP com integralidade relaxada
  gf_nlp = [gf_nlp C];
  gg_nlp = [gg_nlp B];
end
gg_nlp=gg_nlp';

endfunction
