Infinite Domains
A technical manual for infinite domains in InfiniteOpt
. See the respective guide for more information.
Domain Types
InfiniteOpt.AbstractInfiniteDomain
— TypeAbstractInfiniteDomain
An abstract type for domains that characterize infinite parameters.
InfiniteOpt.InfiniteScalarDomain
— TypeInfiniteScalarDomain <: AbstractInfiniteDomain
An abstract type for infinite domains that are one-dimensional.
InfiniteOpt.IntervalDomain
— TypeIntervalDomain <: InfiniteScalarDomain
A DataType
that stores the lower and upper interval bounds for infinite parameters that are continuous over a certain that interval. This is for use with a IndependentParameter
.
Fields
lower_bound::Float64
Lower bound of the infinite parameter.upper_bound::Float64
Upper bound of the infinite parameter.
InfiniteOpt.UniDistributionDomain
— TypeUniDistributionDomain{T <: Distributions.UnivariateDistribution} <: InfiniteScalarDomain
A DataType
that stores the distribution characterizing an infinite parameter that is random. This is for use with a IndependentParameter
.
Fields
distribution::T
Distribution of the random parameter.
InfiniteOpt.InfiniteArrayDomain
— TypeInfiniteArrayDomain <: AbstractInfiniteDomain
An abstract type for multi-dimensional infinite domains.
InfiniteOpt.MultiDistributionDomain
— TypeMultiDistributionDomain{T <: NonUnivariateDistribution} <: InfiniteArrayDomain
A DataType
that stores the distribution characterizing a collection of infinite parameters that follows its form. This is for use with DependentParameters
.
Fields
distribution::T
Distribution of the random parameters.
InfiniteOpt.CollectionDomain
— TypeCollectionDomain{T <: InfiniteScalarDomain} <: InfiniteArrayDomain
A DataType
that stores a collection of InfiniteScalarDomain
s characterizing a collection of infinite parameters that follows its form. This is for use with DependentParameters
.
Fields
domains::Array{T}
The collection of scalar domains.
Domain Methods
InfiniteOpt.collection_domains
— Functioncollection_domains(domain::AbstractInfiniteDomain)
Return the array of domains associated with a CollectionDomain
. Error if the input domain is not a CollectionDomain
.
JuMP.has_lower_bound
— MethodJuMP.has_lower_bound(domain::AbstractInfiniteDomain)::Bool
Return Bool
indicating if domain
has a lower bound that can be determined. This should be extended for user-defined infinite domains. It defaults to false
for unrecognized domain types.
Example
julia> domain = IntervalDomain(0, 1);
julia> has_lower_bound(domain)
true
JuMP.lower_bound
— MethodJuMP.lower_bound(domain::AbstractInfiniteDomain)::Union{Real, Vector{<:Real}}
Return the lower bound of domain
if one exists. This should be extended for user-defined infinite domains if appropriate. Errors if JuMP.has_lower_bound
returns false
. Extensions are enabled by JuMP.has_lower_bound(domain)
and JuMP.lower_bound(domain)
.
Example
julia> domain = IntervalDomain(0, 1);
julia> lower_bound(domain)
0.0
JuMP.set_lower_bound
— MethodJuMP.set_lower_bound(domain::AbstractInfiniteDomain,
lower::Union{Real, Vector{<:Real}})::AbstractInfiniteDomain
Set and return the lower bound of domain
if such an operation makes sense. Errors if the type of domain
does not support this operation or has not been extended. User-defined domain types should extend this if appropriate.
Example
julia> domain = IntervalDomain(0, 1);
julia> set_lower_bound(domain, 0.5)
[0.5, 1]
JuMP.has_upper_bound
— MethodJuMP.has_upper_bound(domain::AbstractInfiniteDomain)::Bool
Return Bool
indicating if domain
has a upper bound that can be determined. This should be extended for user-defined infinite domains. It defaults to false
for unrecognized domain types.
Example
julia> domain = IntervalDomain(0, 1);
julia> has_upper_bound(domain)
true
JuMP.upper_bound
— MethodJuMP.upper_bound(domain::AbstractInfiniteDomain)::Union{Real, Vector{<:Real}}
Return the upper bound of domain
if one exists. This should be extended for user-defined infinite domains if appropriate. Errors if JuMP.has_upper_bound
returns false
. Extensions are enabled by JuMP.has_upper_bound(domain)
and JuMP.upper_bound(domain)
.
Example
julia> domain = IntervalDomain(0, 1);
julia> upper_bound(domain)
1.0
JuMP.set_upper_bound
— MethodJuMP.set_upper_bound(domain::AbstractInfiniteDomain,
upper::Real)::AbstractInfiniteDomain
Set and return the upper bound of domain
if such an aoperation makes sense. Errors if the type of domain
does not support this operation or has not been extended. User-defined domain types should extend this if appropriate.
Example
julia> domain = IntervalDomain(0, 1);
julia> set_upper_bound(domain, 0.5)
[0, 0.5]
InfiniteOpt.round_domain
— Functionround_domain(domain::AbstractInfiniteDomain, sig_digits::Int)
Return a rounded domain of domain
where its bounds use a number of significant digits equal to sig_digs
. This is intended as an internal method and should be extended by those adding a new kind of infinite domain that has bounds.
Support Point Labels
InfiniteOpt.AbstractSupportLabel
— TypeAbstractSupportLabel
An abstract type for support label types. These are used to distinguish different kinds of supports that are added to infinite parameters.
InfiniteOpt.All
— TypeAll <: AbstractSupportLabel
This support label is unique in that it isn't associated with a particular set of supports, but rather is used used to indicate that all supports should be used.
InfiniteOpt.PublicLabel
— TypePublicLabel <: AbstractSupportLabel
An abstract type used to denote that labels that should be given to the user by default.
InfiniteOpt.UserDefined
— TypeUserDefined <: PublicLabel
A support label for supports that are supplied by the user directly to an infinite parameter.
InfiniteOpt.UniformGrid
— TypeUniformGrid <: PublicLabel
A support label for supports that are generated uniformly accross a given interval.
InfiniteOpt.SampleLabel
— TypeSampleLabel <: PublicLabel
An abstract type for labels of supports that are generated via some sampling technique.
InfiniteOpt.MCSample
— TypeMCSample <: SampleLabel
A support label for supports that are generated via Monte Carlo Sampling.
InfiniteOpt.WeightedSample
— TypeWeightedSample <: SampleLabel
A support label for supports that are generated by sampling from a statistical distribution.
InfiniteOpt.Mixture
— TypeMixture <: PublicLabel
A support label for multi-dimensional supports that are generated from a variety of methods.
InfiniteOpt.UniqueMeasure
— TypeUniqueMeasure{S::Symbol} <: PublicLabel
A support label for supports that are provided from the DiscreteMeasureData
associated with a measure where a unique label is generated to distinguish those supports. This is done by invoking generate_unique_label
.
InfiniteOpt.generate_unique_label
— Functiongenerate_unique_label()::Type{UniqueMeasure}
Generate and return a unique support label for measures.
InfiniteOpt.MeasureBound
— TypeMeasureBound <: PublicLabel
A support label for supports that are generated using the upper and lower bounds for FunctionalDiscreteMeasureData
.
InfiniteOpt.InternalLabel
— TypeInternalLabel <: AbstractSupportLabel
An abstract type for support labels that are associated with supports that should not be reported to the user by default.
InfiniteOpt.MeasureToolbox.InternalGaussLobatto
— TypeInternalGaussLobatto <: InfiniteOpt.InternalLabel
A support label Gauss Lobatto points that are used as generative supports.
Support Point Methods
InfiniteOpt.supports_in_domain
— Functionsupports_in_domain(
supports::Union{Real, Vector{<:Real}, Array{<:Real, 2}},
domain::AbstractInfiniteDomain
)::Bool
Used to check if supports
are in the domain of domain
. Returns true
if supports
are in domain of domain
and returns false
otherwise. This is primarily an internal method for performing checks but can be extended for user-defined domain types. Extending this is optional, but recommended where possible. Note by fallback, this returns true
for unrecognized domain types such that an error won't be thrown.
InfiniteOpt.generate_supports
— Functiongenerate_supports(domain::AbstractInfiniteDomain
[method::Type{<:AbstractSupportLabel}];
[num_supports::Int = DefaultNumSupports,
sig_digits::Int = DefaultSigDigits]
)::Tuple{Array{<:Real}, DataType}
Generate num_supports
support values with sig_digits
significant digits in accordance with domain
and return them along with the correct generation label(s). IntervalDomain
s generate supports uniformly with label UniformGrid
and distribution domains generate them randomly accordingly to the underlying distribution. Moreover, method
indicates the generation method that should be used. These methods
correspond to parameter support labels. Current labels that can be used as generation methods include (but may not be defined for certain domain types):
MCSample
: Uniformly distributed Monte Carlo samples.WeightedSample
: Monte Carlo samples that are weighted by an underlying PDF.UniformGrid
: Samples that are generated uniformly over the domain.
Extensions that employ user-defined infinite domain types and/or methods should extend generate_support_values
to enable this. Errors if the domain
type and /or methods are unrecognized. This is intended as an internal method to be used by methods such as generate_and_add_supports!
.
InfiniteOpt.generate_support_values
— Functiongenerate_support_values(domain::AbstractInfiniteDomain,
[method::Type{MyMethod} = MyMethod];
[num_supports::Int = DefaultNumSupports,
sig_digits::Int = DefaultSigDigits]
)::Tuple{Array{<:Real}, Symbol}
A multiple dispatch method for generate_supports
. This will return a tuple where the first element are the supports and the second is their label. This can be extended for user-defined infinite domains and/or generation methods. When defining a new domain type the default method dispatch should make method
an optional argument (making it the default). Otherwise, other method dispatches for a given domain must ensure that method
is positional argument without a default value (contrary to the definition above). Note that the method
must be a subtype of either PublicLabel
or InternalLabel
.