# Reference

## Contents

## Index

`SolverCore.AbstractSolver`

`SolverCore.GenericExecutionStats`

`LinearOperators.reset!`

`SolverCore.log_header`

`SolverCore.log_row`

`SolverCore.set_bounds_multipliers!`

`SolverCore.set_constraint_multipliers!`

`SolverCore.set_dual_residual!`

`SolverCore.set_iter!`

`SolverCore.set_multipliers!`

`SolverCore.set_objective!`

`SolverCore.set_primal_residual!`

`SolverCore.set_residuals!`

`SolverCore.set_solution!`

`SolverCore.set_solver_specific!`

`SolverCore.set_status!`

`SolverCore.set_time!`

`SolverCore.show_statuses`

`SolverCore.solve!`

`SolverCore.AbstractSolver`

— TypeAbstract type from which JSO solvers derive.

`SolverCore.GenericExecutionStats`

— Type`GenericExecutionStats(nlp; ...)`

A GenericExecutionStats is a struct for storing output information of solvers. It contains the following fields:

`status`

: Indicates the output of the solver. Use`show_statuses()`

for the full list;`solution`

: The final approximation returned by the solver (default: an uninitialzed vector like`nlp.meta.x0`

);`objective`

: The objective value at`solution`

(default:`Inf`

);`dual_feas`

: The dual feasibility norm at`solution`

(default:`Inf`

);`primal_feas`

: The primal feasibility norm at`solution`

(default:`0.0`

if uncontrained,`Inf`

otherwise);`multipliers`

: The Lagrange multiplers wrt to the constraints (default: an uninitialzed vector like`nlp.meta.y0`

);`multipliers_L`

: The Lagrange multiplers wrt to the lower bounds on the variables (default: an uninitialzed vector like`nlp.meta.x0`

if there are bounds, or a zero-length vector if not);`multipliers_U`

: The Lagrange multiplers wrt to the upper bounds on the variables (default: an uninitialzed vector like`nlp.meta.x0`

if there are bounds, or a zero-length vector if not);`iter`

: The number of iterations computed by the solver (default:`-1`

);`elapsed_time`

: The elapsed time computed by the solver (default:`Inf`

);`solver_specific::Dict{Symbol,Any}`

: A solver specific dictionary.

The constructor preallocates storage for the fields above. Special storage may be used for `multipliers_L`

and `multipliers_U`

by passing them to the constructor. For instance, if a problem has few bound constraints, those multipliers could be held in sparse vectors.

The following fields indicate whether the information above has been updated and is reliable:

`solution_reliable`

`objective_reliable`

`residuals_reliable`

(for`dual_feas`

and`primal_feas`

)`multipliers_reliable`

(for`multiplers`

)`bounds_multipliers_reliable`

(for`multipliers_L`

and`multipliers_U`

)`iter_reliable`

`time_reliable`

`solver_specific_reliable`

.

Setting fields using one of the methods `set_solution!()`

, `set_objective!()`

, etc., also marks the field value as reliable.

The `reset!()`

method marks all fields as unreliable.

`nlp`

is mandatory to set default optional fields. All other variables can be input as keyword arguments.

Notice that `GenericExecutionStats`

does not compute anything, it simply stores.

`LinearOperators.reset!`

— Method`reset!(stats::GenericExecutionStats)`

Reset the internal flags of `stats`

to `false`

to Indicate that the contents should not be trusted.

`SolverCore.log_header`

— Method`log_header(colnames, coltypes)`

Creates a header using the names in `colnames`

formatted according to the types in `coltypes`

. Uses internal formatting specification given by `SolverCore.formats`

and default header translation given by `SolverCore.default_headers`

.

Input:

`colnames::Vector{Symbol}`

: Column names.`coltypes::Vector{DataType}`

: Column types.

Keyword arguments:

`hdr_override::Dict{Symbol,String}`

: Overrides the default headers.`colsep::Int`

: Number of spaces between columns (Default: 2)

See also `log_row`

.

`SolverCore.log_row`

— Method`log_row(vals)`

Creates a table row from the values on `vals`

according to their types. Pass the names and types of `vals`

to `log_header`

for a logging table. Uses internal formatting specification given by `SolverCore.formats`

.

To handle a missing value, add the type instead of the number:

```
@info log_row(Any[1.0, 1])
@info log_row(Any[Float64, Int])
```

Prints

```
[ Info: 1.0e+00 1
[ Info: - -
```

Keyword arguments:

`colsep::Int`

: Number of spaces between columns (Default: 2)

`SolverCore.set_bounds_multipliers!`

— Method`set_bounds_multipliers!(stats::GenericExecutionStats{T, S, V}, zL::V, zU::V)`

Register `zL`

and `zU`

as optimal multipliers associated to lower-bounded and upper-bounded constraints, respectively, in `stats`

and mark them as reliable.

`SolverCore.set_constraint_multipliers!`

— Method`set_constraint_multipliers!(stats::GenericExecutionStats{T, S, V}, y::S, zL::V, zU::V)`

Register `y`

as optimal multipliers associated to general constraints in `stats`

and mark them as reliable.

`SolverCore.set_dual_residual!`

— Method`set_dual_residual!(stats::GenericExecutionStats{T, S, V}, dual::T)`

Register `dual`

as optimal dual feasibility residuals in `stats`

and mark it as reliable.

`SolverCore.set_iter!`

— Method`set_iter!(stats::GenericExecutionStats, iter::Int)`

Register `iter`

as optimal iteration number in `stats`

and mark it as reliable.

`SolverCore.set_multipliers!`

— Method`set_multipliers!(stats::GenericExecutionStats{T, S, V}, y::S, zL::V, zU::V)`

Register `y`

, `zL`

and `zU`

as optimal multipliers associated to general constraints, lower-bounded and upper-bounded constraints, respectively, in `stats`

and mark them as reliable.

`SolverCore.set_objective!`

— Method`set_objective!(stats::GenericExecutionStats{T, S, V}, val::T)`

Register `val`

as optimal objective value in `stats`

and mark it as reliable.

`SolverCore.set_primal_residual!`

— Method`set_primal_residual!(stats::GenericExecutionStats{T, S, V}, primal::T)`

Register `primal`

as optimal primal residuals in `stats`

and mark it as reliable.

`SolverCore.set_residuals!`

— Method`set_residuals!(stats::GenericExecutionStats{T, S, V}, primal::T, dual::T)`

Register `primal`

and `dual`

as optimal primal and dual feasibility residuals, respectively, in `stats`

and mark them as reliable.

`SolverCore.set_solution!`

— Method`set_solution!(stats::GenericExecutionStats, x::AbstractVector)`

Register `x`

as optimal solution in `stats`

and mark it as reliable.

`SolverCore.set_solver_specific!`

— Method`set_solver_specific!(stats::GenericExecutionStats, field::Symbol, value)`

Register `value`

as a solver-specific value identified by `field`

in `stats`

and mark it as reliable.

`SolverCore.set_status!`

— Method`set_status!(stats::GenericExecutionStats, status::Symbol)`

Register `status`

as final status in `stats`

and mark it as reliable.

`SolverCore.set_time!`

— Method`set_time!(stats::GenericExecutionStats, time::Float64)`

Register `time`

as optimal solution time in `stats`

and mark it as reliable.

`SolverCore.show_statuses`

— Method`show_statuses()`

Show the list of available statuses to use with `GenericExecutionStats`

.

`SolverCore.solve!`

— Method```
solve!(solver, model; kwargs...)
solve!(solver, model, stats; kwargs...)
```

Apply `solver`

to `model`

.

**Arguments**

`solver::AbstractOptimizationSolver`

: solver structure to hold all storage necessary for a solve`model::AbstractNLPModel`

: the model solved, see`NLPModels.jl`

`stats::GenericExecutionStats`

: stats structure to hold solution information.

The first invocation allocates and returns a new `GenericExecutionStats`

. The second one fills out a preallocated stats structure and allows for efficient re-solves.

The `kwargs`

are passed to the solver.

**Return Value**

`stats::GenericExecutionStats`

: stats structure holding solution information.