Skip to content

Options

CompileOptions

Bases: NamedTuple

Options of turning the functions of a problem into programs.

disk_cache class-attribute instance-attribute

disk_cache: bool = True

Whether lowered programs and executables are stored in the cache directory.

The directory is CYXLA_CACHE_DIR if set, and ~/.cache/cyxla otherwise.

zero_copy class-attribute instance-attribute

zero_copy: bool = True

Whether executions read and write host memory directly when the plugin allows it.

Hessian

Bases: Enum

How Ipopt gets second derivatives.

EXACT class-attribute instance-attribute

EXACT = 'exact'

The Hessian of the Lagrangian is compiled and evaluated at every iteration.

LIMITED_MEMORY class-attribute instance-attribute

LIMITED_MEMORY = 'limited-memory'

Ipopt approximates the Hessian from gradients, so no Hessian is compiled.

Derivatives

Bases: Enum

How the Jacobian and the Hessian are computed, and where their patterns come from.

AUTOMATIC class-attribute instance-attribute

AUTOMATIC = 'automatic'

asdex when it is installed, and dense derivatives with a warning when it is not.

SPARSE class-attribute instance-attribute

SPARSE = 'sparse'

asdex detects the patterns, colors them and evaluates the compressed derivatives.

A pattern that a problem gives replaces the detected one.

DENSE class-attribute instance-attribute

DENSE = 'dense'

JAX differentiates densely and the programs keep the entries of the pattern.

A problem without patterns gets all entries, and asdex is not needed.

SolveOptions

Bases: NamedTuple

Limits and settings of one solve.

tolerance class-attribute instance-attribute

tolerance: float = 1e-08

Ipopt's tol, the tolerance on the scaled optimality error.

time_limit class-attribute instance-attribute

time_limit: float | None = None

Seconds of wall time after which Ipopt stops, or None for no limit.

print_level class-attribute instance-attribute

print_level: int = 0

Ipopt's print_level from 0, which prints nothing, to 12.

blas_threads class-attribute instance-attribute

blas_threads: int | None = 1

Threads of OpenBLAS, or None to leave the setting as it is.

One thread suits the sparse factorizations of problems that fit in a few million entries, since the linear algebra calls are small.

settings class-attribute instance-attribute

settings: tuple[IpoptSetting, ...] = ()

Further option values, applied after the fields above.

callback class-attribute instance-attribute

callback: Callable[[IterationInfo], bool | None] | None = None

A function called at the end of every iteration, or None.

Ipopt stops with Status.USER_REQUESTED_STOP when it returns False. Returning nothing continues. The function runs with the GIL, so it slows a solve down.

IpoptSetting

Bases: NamedTuple

A value for one Ipopt option.

option instance-attribute

option: str

The name of the option, as in Ipopt's documentation.

LinearSolver

Bases: Enum

The sparse linear solvers that the Ipopt library of the wheel contains.