function [w,f] = findMin(funObj,w,maxEvals,alpha)

[f,g] = funObj(w);
funEvals = 1;

while 1
	w = w - alpha*g;
	[f,g] = funObj(w);
	funEvals = funEvals+1;
	
	optCond = norm(g,'inf');
	fprintf('%6d %15.5e %15.5e %15.5e\n',funEvals,alpha,f,optCond);
	
	if optCond < 1e-2
		break;
	end
	
	if funEvals >= maxEvals
		break;
	end
end