function [x, finalStats] = simple_mlp_optimWrapSolvOpt(initX, uFunc, uPar, ...
					 stepsize, maxIter, fgoal, ...
					 gnsgoal)
% The solvopt solver wrapped with the same interface as our own
% ones.
%
% (Similar wrapper can be used for any black-box optimizer.)
%
% Solvopt is not our creation, so we cannot distribute it.
% If you choose to download it from elsewhere, bear in mind that
% you need to apply a diff file to patch it so that it is 
% compatible with our cost evaluator.
%

f.fun = uFunc;
f.pars = uPar;

g.fun = uFunc;
g.pars = uPar;
g.pars.onlyGrad = true;

options=[0 0 0 maxIter 0 0 0 0];

[x, value, options] = solvoptWithParams(initX, f, g, options);

finalStats.outerIters = options(9);

% Even if stopped via "iteration limit exceeded", count all iters:
if finalStats.outerIters == -18, finalStats.outerIters = maxIter; end
