Function definition:
bool sumt(arma::vec& init_out_vals, std::function<double (const arma::vec& vals_inp, arma::vec* grad_out, void* opt_data)> opt_objfn, void* opt_data, std::function<arma::vec (const arma::vec& vals_inp, arma::mat* jacob_out, void* constr_data)> constr_fn, void* constr_data); bool sumt(arma::vec& init_out_vals, std::function<double (const arma::vec& vals_inp, arma::vec* grad_out, void* opt_data)> opt_objfn, void* opt_data, std::function<arma::vec (const arma::vec& vals_inp, arma::mat* jacob_out, void* constr_data)> constr_fn, void* constr_data, algo_settings_t& settings);
Function arguments:
init_out_vals
a column vector of initial values; will contain the final values.opt_objfn
the function to be minimized, taking three arguments:
vals_inp
a vector of inputs;grad_out
a vector to store the gradient; andopt_data
additional parameters passed to the function.opt_data
additional parameters passed to the function.constr_fn
the constraint functions in vector form, taking three arguments:
vals_inp
a vector of inputs;jacob_out
a matrix to store the jacobian; andconstr_data
additional parameters passed to the constraints.constr_data
additional parameters passed to the constraints.settings
parameters controlling the optimization routine; see below.Optimization control parameters:
double err_tol
the value controlling how small $\| f \|$ should be before 'convergence' is declared.int iter_max
the maximum number of iterations/updates before the algorithm exits.bool vals_bound
whether the search space is bounded. If true, thenarma::vec lower_bounds
this defines the lower bounds.arma::vec upper_bounds
this defines the upper bounds.The SUMT solves the augmented problem
$$\min_x \left\{ f(x) + c \times \dfrac{1}{2} \sum_{k=1}^K \left( \max(0, g_k(x)) \right)^2 \right\} =: \min_x h(x)$$where $g_k \leq 0$.
The algorithm stops when $\| \nabla h \|$ is less than err_tol, or the total number of 'generations' exceeds a desired (or default) value.