You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: ssm_localsolver.m
    path of file: ./repos/d2d/arFramework3/ThirdParty/strike-goldd/STRIKE-GOLDD/MEIGO64/MEIGO/eSS
    
    the code of the file until where you have to start completion: % $Header: svn://172.19.32.13/trunk/AMIGO2R2016/Kernel/OPT_solvers/eSS/ssm_localsolver.m 2031 2015-08-24 11:49:26Z attila $
function [x,fval,exitflag,numeval]=ssm_localsolver(X0,x_L,x_U,c_L,c_U,neq,ndata,int_var,bin_var,fobj,fjac,...
   
    
function [x,fval,exitflag,numeval]=ssm_localsolver(X0,x_L,x_U,c_L,c_U,neq,ndata,int_var,bin_var,fobj,fjac,...
    local_solver,local_iterprint,local_tol,weight,nconst,tolc,local_opts,varargin)
global ccll ccuu n_upper n_lower n_fun_eval

global hjfun hjxl hjxu hjcl hjcu hjweight hjtolc
hjfun=fobj;
hjxl=x_L;
hjxu=x_U;
hjcl=c_L;
hjcu=c_U;
hjweight=weight;
hjtolc=tolc;

nvar=length(X0);

%Scaling factors (can be useful for some local solvers). This could be
%defined just once in the main ssm.m
scale.x=x_U-x_L;

f1=feval(fobj,X0,varargin{:});
n_fun_eval=1;
if nconst
    g_u=c_U;
    g_l=c_L;
    
    g_l(abs(g_l)==inf)=1;
    g_u(abs(g_u)==inf)=1;
    
    g_l=abs(g_l);
    g_u=abs(g_u);
    
    scale.g=max(g_l,g_u);
else
    scale.g=1;
end