Private API

This page lists non-exported (internal) symbols of CTSolvers.Strategies.


From CTSolvers.Strategies

_default_parameter

CTSolvers.Strategies._default_parameterFunction
_default_parameter(
    _::Type{<:CTSolvers.Strategies.AbstractStrategy}
) -> Type{CTSolvers.Strategies.CPU}

Get the default parameter type for a strategy.

This function returns the default parameter type that a strategy accepts. Strategies should override this method to specify their default parameter.

Arguments

  • strategy_type::Type{<:AbstractStrategy}: The strategy type

Returns

  • Type{<:AbstractStrategyParameter}: Default parameter type

Default Behavior

By default, returns CPU for backward compatibility. Strategies that have a different default parameter should override this method.

Example

# Strategy that defaults to CPU
_default_parameter(::Type{<:MyStrategy}) = CPU

# Strategy that defaults to GPU
_default_parameter(::Type{<:MyOtherStrategy}) = GPU

See also: CPU, GPU

_default_parameter(
    _::Type{<:CTSolvers.Modelers.ADNLP}
) -> Type{CTSolvers.Strategies.CPU}

Default parameter type for ADNLP when not explicitly specified.

Returns CPU as the default execution parameter.

Implementation Notes

This method is part of the AbstractStrategy parameter contract and must be implemented by all parameterized strategies.

See also: ADNLP, CPU

_default_parameter(
    _::Type{<:CTSolvers.Modelers.Exa}
) -> Type{CTSolvers.Strategies.CPU}

Default parameter type for Exa when not explicitly specified.

Returns CPU as the default execution parameter.

Implementation Notes

This method is part of the AbstractStrategy parameter contract and must be implemented by all parameterized strategies.

See also: Exa, CPU

_default_parameter(
    _::Type{<:CTSolvers.Solvers.Ipopt}
) -> Type{CTSolvers.Strategies.CPU}

Default parameter type for Ipopt when not explicitly specified.

Returns CPU as the default execution parameter.

Implementation Notes

This method is part of the AbstractStrategy parameter contract and must be implemented by all parameterized strategies.

See also: Ipopt, CPU

_default_parameter(
    _::Type{<:CTSolvers.Solvers.MadNLP}
) -> Type{CTSolvers.Strategies.CPU}

Default parameter type for MadNLP when not explicitly specified.

Returns CPU as the default execution parameter.

See also: MadNLP, CPU

_default_parameter(
    _::Type{<:CTSolvers.Solvers.MadNCL}
) -> Type{CTSolvers.Strategies.CPU}

Default parameter type for MadNCL when not explicitly specified.

Returns CPU as the default execution parameter.

See also: MadNCL, CPU

_default_parameter(
    _::Type{<:CTSolvers.Solvers.Knitro}
) -> Type{CTSolvers.Strategies.CPU}

Default parameter type for Knitro when not explicitly specified.

Returns CPU as the default execution parameter.

Implementation Notes

This method is part of the AbstractStrategy parameter contract and must be implemented by all parameterized strategies.

See also: Knitro, CPU

_raw_options

CTSolvers.Strategies._raw_optionsFunction
_raw_options(
    opts::CTSolvers.Strategies.StrategyOptions
) -> NamedTuple

Private helper function - for internal framework use only.

Returns the raw NamedTuple of OptionValue objects from the internal storage. This is needed for Options.extract_raw_options which requires access to the full OptionValue objects, not just their .value fields.

Internal Use Only

This function is not part of the public API and may change without notice. External code should use the public collection interface (pairs, keys, values, etc.).

Returns

  • NamedTuple of (Symbol => OptionValue) from the internal storage

is_parameter_type

CTSolvers.Strategies.is_parameter_typeFunction
is_parameter_type(_::Type{T}) -> Bool

Check whether a type is a strategy parameter type.

This predicate is useful for contract validation and generic code paths that need to distinguish parameter types from other types.

Arguments

  • T::Type: Any Julia type

Returns

  • Bool: true if T <: AbstractStrategyParameter, otherwise false

Example

julia> Strategies.is_parameter_type(Strategies.CPU)
true

julia> Strategies.is_parameter_type(Int)
false

See also: AbstractStrategyParameter, validate_parameter_type

option

CTSolvers.Strategies.optionFunction
option(
    opts::CTSolvers.Strategies.StrategyOptions,
    key::Symbol
) -> Any

Get the OptionValue wrapper for an option.

Arguments

  • opts::StrategyOptions: Strategy options
  • key::Symbol: Option name

Returns

  • Options.OptionValue: The option value wrapper

Example

julia> opt = option(opts, :max_iter)
julia> Options.value(opt)
200

See also: Base.getproperty, Options.source

parameter_id

CTSolvers.Strategies.parameter_idFunction
parameter_id(
    parameter_type::Type{<:CTSolvers.Strategies.AbstractStrategyParameter}
) -> Symbol

Get the identifier of a strategy parameter type.

This is an explicit alias for id to make code using parameter IDs more self-documenting.

Arguments

  • parameter_type::Type{<:AbstractStrategyParameter}: The parameter type

Returns

  • Symbol: The parameter identifier

Example

julia> Strategies.parameter_id(Strategies.CPU)
:cpu

See also: id, AbstractStrategyParameter

validate_parameter_type

CTSolvers.Strategies.validate_parameter_typeFunction
validate_parameter_type(
    parameter_type::Type{<:CTSolvers.Strategies.AbstractStrategyParameter}
)

Validate that a parameter type satisfies the AbstractStrategyParameter contract.

This function performs lightweight structural checks:

  • the parameter type must be concrete
  • the parameter type must be a singleton type (no fields)
  • the parameter type must implement id

Arguments

  • parameter_type::Type{<:AbstractStrategyParameter}: The parameter type to validate

Returns

  • Nothing: Returns nothing if validation succeeds

Throws

  • Exceptions.IncorrectArgument: If the parameter type is not concrete or has fields
  • Exceptions.NotImplemented: If the parameter type does not implement id

Example

struct MyParam <: Strategies.AbstractStrategyParameter end
Strategies.id(::Type{MyParam}) = :my_param

Strategies.validate_parameter_type(MyParam)  # returns nothing

Notes

  • This function does not validate global ID uniqueness; that is handled by registry construction.

See also: id, parameter_id, is_parameter_type