Private API
This page lists non-exported (internal) symbols of CTSolvers.Strategies.
From CTSolvers.Strategies
_default_parameter
CTSolvers.Strategies._default_parameter — Function
_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}) = GPUSee 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
_default_parameter(
_::Type{<:CTSolvers.Solvers.Uno}
) -> Type{CTSolvers.Strategies.CPU}
Default parameter type for Uno 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: Uno, CPU
_raw_options
CTSolvers.Strategies._raw_options — Function
_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.
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
_resolve_key
CTSolvers.Strategies._resolve_key — Function
_resolve_key(
opts::CTSolvers.Strategies.StrategyOptions,
key::Symbol
) -> Symbol
Private helper function - for internal framework use only.
Resolve an alias to its canonical name, or return the key unchanged if not an alias.
This function performs O(1) lookup in the aliasmap to resolve aliases to their canonical names. If the key is not found in the aliasmap, it is assumed to be already canonical and returned unchanged.
This function is not part of the public API and may change without notice. External code should use the public access methods which handle alias resolution automatically.
Arguments
opts::StrategyOptions: Strategy options containing the alias mapkey::Symbol: Key to resolve (can be canonical name or alias)
Returns
Symbol: Canonical name for the option
Example
# Internal usage only
canonical = _resolve_key(opts, :maxiter) # Returns :max_iter
canonical = _resolve_key(opts, :max_iter) # Returns :max_iter (already canonical)See also: Base.getindex, Base.haskey
is_parameter_type
CTSolvers.Strategies.is_parameter_type — Function
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:trueifT <: AbstractStrategyParameter, otherwisefalse
Example
julia> Strategies.is_parameter_type(Strategies.CPU)
true
julia> Strategies.is_parameter_type(Int)
falseSee also: AbstractStrategyParameter, validate_parameter_type
option
CTSolvers.Strategies.option — Function
option(
opts::CTSolvers.Strategies.StrategyOptions,
key::Symbol
) -> Any
Get the OptionValue wrapper for an option.
Arguments
opts::StrategyOptions: Strategy optionskey::Symbol: Option name
Returns
Options.OptionValue: The option value wrapper
Example
julia> opt = option(opts, :max_iter)
julia> Options.value(opt)
200
julia> opt = option(opts, :maxiter) # Alias - automatically resolved
julia> Options.value(opt)
200Notes
- Aliases are automatically resolved to canonical names
See also: Base.getproperty, Options.source
parameter_id
CTSolvers.Strategies.parameter_id — Function
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)
:cpuSee also: id, AbstractStrategyParameter
validate_parameter_type
CTSolvers.Strategies.validate_parameter_type — Function
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: Returnsnothingif validation succeeds
Throws
Exceptions.IncorrectArgument: If the parameter type is not concrete or has fieldsExceptions.NotImplemented: If the parameter type does not implementid
Example
struct MyParam <: Strategies.AbstractStrategyParameter end
Strategies.id(::Type{MyParam}) = :my_param
Strategies.validate_parameter_type(MyParam) # returns nothingNotes
- This function does not validate global ID uniqueness; that is handled by registry construction.
See also: id, parameter_id, is_parameter_type