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
_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
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)
200See 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