`GLPK.CallbackFunction`

— Type`CallbackFunction()`

Set a generic GLPK callback function.

`GLPK.Optimizer`

— Type```
Optimizer(;
want_infeasibility_certificates::Bool = true,
method::MethodEnum = GLPK.SIMPLEX,
)
```

Create a new Optimizer object.

**Arguments**

`want_infeasibility_certificates::Bool`

: flag to control whether to attempt to generate an infeasibility certificate in the case of primal or dual infeasibility. Defaults to`true`

. You should set this to`false`

if you want GLPK to report primal or dual infeasiblity, but you don't need a certificate.`method::MethodEnum`

: Solution method to use. Default is`GLPK.SIMPLEX`

. Other options are`GLPK.EXACT`

and`GLPK.INTERIOR`

.

`GLPK._add_affine_constraint`

— Method```
_add_affine_constraint(
problem::Union{Optimizer, Ptr{glp_prob}},
columns::Vector{Cint},
coefficients::Vector{Float64},
sense::Cchar,
rhs::Float64,
)
```

Helper function to add a row to the problem. Sense must be one of `'E'`

(ax == b), `'G'`

(ax >= b), `'L'`

(ax <= b).

`GLPK._certificates_potentially_available`

— Method`_certificates_potentially_available(model::Optimizer)`

Return true if an infeasiblity certificate or an unbounded ray is potentially available (i.e., the model has been solved using either the Simplex or Exact methods).

`GLPK._get_infeasibility_ray`

— Method`_get_infeasibility_ray(model::Optimizer, ray::Vector{Float64})`

Compute a Farkas certificate of primal infeasibility (unbounded dual ray) and store in `ray`

. Returns `true`

if successful, and `false`

if a ray cannot be found.

Assumes `ray`

has been initialized to all `0.0`

s.

`GLPK._get_unbounded_ray`

— Method`_get_unbounded_ray(model::Optimizer, ray::Vector{Float64})::Bool`

Compute an unbounded primal ray and store in `ray`

. Returns `true`

if successful, and `false`

if a ray cannot be found.

Assumes the primal has been solved with primal simplex and is proven unbounded. Assumes `ray`

has been initialized to all `0.0`

s.

`GLPK._round_bounds_to_integer`

— Method`_round_bounds_to_integer(model)`

GLPK does not allow integer variables with fractional bounds. Therefore, we round the bounds of binary and integer variables to integer values prior to solving.

Returns a tuple `(column, lower, upper)`

for the bounds that need to be reset.

`GLPK._set_parameter`

— Method`_set_parameter(param_store, key::Symbol, value)::Bool`

Set the field name `key`

in a `param_store`

type (that is one of `InteriorParam`

, `IntoptParam`

, or `SimplexParam`

) to `value`

.

Returns a `Bool`

indicating if the parameter was set.

`GLPK._validate_constraint_types`

— Method`_validate_constraint_types(dest::Optimizer, src::MOI.ModelLike)`

Throw an error if unsupported constraint or objective types are present in `src`

.

`GLPK.offset`

— Method`offset(x::Vector)`

GLPK uses 1-based indexing for its arrays. But since C has 0-based indexing, all 1-based vectors passed to GLPK need to be padded with a "0'th" element that will never be accessed. To avoid doing this padding in Julia, we convert the vector to a reference, and use the optional second argument to ensure the reference points to the "0'th" element of the array. This is safe to do, provided C never accesses `x[0]`

.

See the GLPK manual for more details.