function [dF, dce, dci] = GradFhg(x)

% Returns the central difference gradients of F(x), h(x), g(x) in the NBI subproblem
% computes dh, dg by calling GRADFUN, calls Fns.m to evaluate F

global n nvars ne ni

h = 1e-4;
dF = zeros(nvars,n);

for i = 1:nvars
	xplus = x;
	xplus(i) = x(i) + h;
	xminus = x;
	xminus(i) = x(i) - h;

	Fplus = Fns(xplus);
	Fminus = Fns(xminus);

	dF(i,:) = (Fplus' - Fminus')/(2*h);
end

[dce, dci] = GRADFUN(x);
