Internal API
These functions and types are for internal usage and should generally not be accessed during normal use of the package. This will likely be useful if implementing an extension to the package.
Fully documenting every function is currently ongoing. Please raise an issue if information is missing.
Core
Missing docstring for DirectSearch.OptimizationStatus. Check Documenter's build log for details.
Missing docstring for DirectSearch.EvaluateInitialPoint. Check Documenter's build log for details.
DirectSearch.EvaluatePoint! — FunctionEvaluatePoint!(p::DSProblem{T}, trial_points)::IterationOutcome where TDetermine whether the set of trial points result in a dominating, improving, or unsuccesful algorithm iteration. Update the feasible and infeasible incumbent points of p.
DirectSearch.function_evaluation — Methodfunction_evaluation(p::DSProblem{T}, trial_points::Vector{Vector{T}})::Vector{T} where TCalculate the cost of the points in trial_points and return as a vector.
If the number of available workers is greater than one, and the maxsimultaniousevaluations value of p is greater than one then the calculation is distributed across several cores.
Currently, this has significant overheads and is much slower than evaluating in a single threaded manner on all testcases. This may give performance benefits when f is a heavy, single threaded operation.
If a specialised way of calling the function is needed then this function should be overriden, e.g.:
function DS.function_evaluation(p::DS.DSProblem{T}, trial_points::Vector{Vector{T}}) where T
println("I am overriden")
return map(p.objective, trial_points)
endDirectSearch.function_evaluation — Methodfunction_evaluation(p::DSProblem{T}, trial_point::Vector{T})::T where TEvaluate a single trial point with the objective function of p.
By default calls the function with the trial point and returns the result. Override to provide custom evaluation behaviour.
Missing docstring for DirectSearch.MeshUpdate!(::DSProblem, ::DirectSearch.IterationOutcome). Check Documenter's build log for details.
Missing docstring for DirectSearch.GetMeshSize. Check Documenter's build log for details.
Missing docstring for DirectSearch.min_mesh_size(::DSProblem{Float64}). Check Documenter's build log for details.
Missing docstring for DirectSearch.min_mesh_size(::DSProblem{T}) where T. Check Documenter's build log for details.
DirectSearch.AbstractMesh — Typeabstract type AbstractMesh endParent type of any struct implementing the construction of a mesh. To maintain compatibility with other aspects of the package, the naming convention for variables within structs must be followed. These respect the notation used within Audet & Dennis 2006.
Missing docstring for DirectSearch.Mesh. Check Documenter's build log for details.
Missing docstring for DirectSearch.AbstractProblem. Check Documenter's build log for details.
Constraints
Missing docstring for DirectSearch.AbstractConstraint. Check Documenter's build log for details.
DirectSearch.IterationOutcome — Type@enum IterationOutcomeHas values Dominating, Improving, or Unsuccessful. Corresponding to the three iteration outcomes in MADS-PB.
DirectSearch.ConstraintOutcome — Type@enum ConstraintOutcomeHas the values Feasible, WeakInfeasible, or StrongInfeasible to classify the outcome of the constraint evaluations of a single point.
A Feasible point meets the requirement of all constraints with no relaxation.
A WeakInfeasible outcome has at least one relaxable constraint violated but no unrelaxable constraints violated.
A StrongInfeasible outcome indicates at least one unrelaxable constraint has been violated or the relaxable constraint violation is reater than hmax.
DirectSearch.CollectionIndex — TypeCollectionIndexAn Int wrapper that is used for indexing constraint collections within a Constraints object.
DirectSearch.ConstraintIndex — TypeCollectionIndexAn Int wrapper that is used for indexing constraints within a ConstraintCollection object.
DirectSearch.ConstraintCollection — TypeConstraintCollection{T,C}(h_max::T,
h_max_update::Function,
aggregator::Function
) where {T,C<:AbstractConstraint}Contains multiple constraints of the same type that have the same settings applied to them.
h_max is the initial hmax value. h_max_update is a function that should update h_max given an IterationOutcome value. aggregator is a function that will bring all constraint violations of a collection into a single h result.
Defaults for each of these values are set in the AddProgressiveCollection and AddExtremeCollection functions.
Missing docstring for DirectSearch.h_max_update. Check Documenter's build log for details.
DirectSearch.AbstractProgressiveConstraint — TypeAbstractProgressiveConstraint <: AbstractConstraintParent type for progressive contraints.
DirectSearch.ProgressiveConstraint — TypeProgressiveConstraint(f::Function)Create a progressive barrier constraint.
Argument f is a function that should take a single vector argument and return a value that gives the amount the constraint function has been violated.
A value greater than 0 indicates the function has been violated, 0 shows that the input lies on the constraint, and negative numbers show a feasible value.
Negative numbers may be truncated to 0 without affecting the algorithm.
DirectSearch.ExtremeConstraint — TypeExtremeConstraint(f::Function)Create an extreme barrier constraint. Function f should take a vector argument and return true or false to indicate if the vector meets the constraint.
DirectSearch.Constraints — TypeConstraints{T}() where TCreate an object that constains multiple ConstraintCollection objects and their corresponding ConstraintCache.
Upon creation Constraints is automaticvally populated with two constraint collections, an ExtremeCollection and a ProgressiveCollection.
DirectSearch.CollectionTypeCount — FunctionCollectionTypeCount(c::Constraints{T}, C::AbstractConstraint)::Int where TReturn the total number of constraints of type C that are stored in all collections.
Missing docstring for DirectSearch.ConstraintUpdate!. Check Documenter's build log for details.
DirectSearch.ConstraintEvaluation — FunctionConstraintEvaluation(constraints::Constraints{T}, p::Vector{T})::Tuple{ConstraintOutcome,T} where TEvaluate point p over all constraint collections in constraints. Returns a ConstraintOutcome indicating the result of the evaluation:
Feasible: p evaluated as feasible for all constraints (extreme and progressive barrier)
WeakInfeasible: p evaluated as feasible for all extreme barrier constraints, and had no progressive barrier constraint violations greater than h_max
StrongInfeasible: At least one extreme barrier constraint evaluated as infeasible, or at least one progressive barrier constraint had a violation greater than h_max
The second returned value is the sum of h_max values evaluated during the constraint checks.
Missing docstring for DirectSearch.GetHmaxSum. Check Documenter's build log for details.
DirectSearch.ConstraintCollectionEvaluation — MethodConstraintCollectionEvaluation(collection::ConstraintCollection{T,ProgressiveConstraint},
x::Vector{T})::ConstraintOutcome where TEvalute every constraint within progressive constraint collection collection for point x.
If the aggregate value of the constraint evaluations exceeds the collection's h_max then a StrongInfeasible is returned. If the value is less than or equal to 0.0 then Feasible is returned. Otherwise WeakInfeasible is returned.
DirectSearch.ConstraintCollectionEvaluation — MethodConstraintCollectionEvaluation(collection::ConstraintCollection{T,ExtremeConstraint},
x::Vector{T})::ConstraintOutcome where TEvalute every constraint within extreme constraint collection collection for point x.
If any constraint returns false or a value greater than 0 then a StrongInfeasible result is returned. Otherwise a Feasible result is returned.
Poll
DirectSearch.Poll — FunctionPoll(p::DSProblem{T})::IterationOutcome where TGenerate points and call evaluate on them.
DirectSearch.AbstractPoll — Typeabstract type AbstractPollDirectionGenerator endParent type for any type used for implementing a direction generator.
Generally any direction generators should return vectors with unit length of one
DirectSearch.GeneratePollPoints — FunctionGeneratePollPoints(p::DSProblem{T}, ::AbstractMesh)::Vector{Vector{T}} where TGenerate a set of directions with the configured polling algorithm, then return the set of points these directions give from the incumbent points.
DirectSearch.GenerateDirections — MethodGenerateDirections(p::DSProblem{T}, DG::LTMADS{T})::Vector{Vector{T}}Generates columns and forms a basis matrix for direction generation.
GenerateDirections(p::DSProblem{T}, DG::LTMADS{T})::Vector{Vector{T}}Generates columns and forms a basis matrix for direction generation.
Search
Missing docstring for DirectSearch.Search. Check Documenter's build log for details.
Missing docstring for DirectSearch.AbstractSearch. Check Documenter's build log for details.
DirectSearch.GenerateSearchPoints — MethodGenerateSearchPoints(p::DSProblem{T})::Vector{Vector{T}} where TCalls GenerateSearchPoints for the search step within p.
DirectSearch.GenerateSearchPoints — MethodGenerateSearchPoints(p::DSProblem{T}, ::RandomSearch)::Vector{Vector{T}} where TFinds points that are Δᵐ distance from any point in the mesh in a uniformly random direction.
DirectSearch.GenerateSearchPoints — MethodGenerateSearchPoints(p::DSProblem)Search method that returns an empty vector.
Use when no search method is desired.
LTMADS
DirectSearch.MeshUpdate! — MethodMeshUpdate!(mesh::Mesh, improvement_found::Bool)Implements LTMADS update rule from Audet & Dennis 2006 pg. 203 adapted for progressive barrier constraints with Audet & Dennis 2009 expression 2.4.
DirectSearch.GenerateDirections — MethodGenerateDirections(p::DSProblem{T}, DG::LTMADS{T})::Vector{Vector{T}}Generates columns and forms a basis matrix for direction generation.
Missing docstring for DirectSearch.form_basis_matrix. Check Documenter's build log for details.
Missing docstring for DirectSearch.LT_basis_generation. Check Documenter's build log for details.
Missing docstring for DirectSearch.B′_generation. Check Documenter's build log for details.
Missing docstring for DirectSearch.b_l_generation. Check Documenter's build log for details.
Missing docstring for DirectSearch.L_generation. Check Documenter's build log for details.
Missing docstring for DirectSearch.B_generation. Check Documenter's build log for details.
OrthoMADS
DirectSearch.MeshUpdate! — MethodMeshUpdate!(mesh::Mesh, o::OrthoMADS, result::IterationOutcome)Implements the OrthoMads update rules.
DirectSearch.GenerateDirections — MethodGenerateDirections(p::DSProblem{T}, DG::LTMADS{T})::Vector{Vector{T}}Generates columns and forms a basis matrix for direction generation.
Missing docstring for DirectSearch.GenerateDirections(::Int64, ::OrthoMADS). Check Documenter's build log for details.
Missing docstring for DirectSearch.GenerateOMBasis. Check Documenter's build log for details.
Missing docstring for DirectSearch.Halton. Check Documenter's build log for details.
Missing docstring for DirectSearch.HaltonEntry. Check Documenter's build log for details.
Missing docstring for DirectSearch.HaltonCoefficient. Check Documenter's build log for details.
Missing docstring for DirectSearch.AdjustedHalton. Check Documenter's build log for details.
Missing docstring for DirectSearch.AdjustedHaltonFamily. Check Documenter's build log for details.
Missing docstring for DirectSearch.bad_argmax. Check Documenter's build log for details.
Missing docstring for DirectSearch.HouseholderTransform. Check Documenter's build log for details.
Cache
Missing docstring for DirectSearch.AbstractCache. Check Documenter's build log for details.
DirectSearch.PointCache — TypePointCache{T} <: AbstractCacheAn abstract cache subtype that contains a dictionary of points/costs and a vector that stores the order of incumbent points.
DirectSearch.CachePush — MethodCachePush(p::AbstractProblem, x::Vector, cost)Add point x and its cost cost to the cache of p.
DirectSearch.CachePush — MethodCachePush(p::AbstractProblem)Add the feasible and infeasible incumbent points (assuming neither are nothing) to the cache.
DirectSearch.CacheQuery — MethodCacheQuery(p::AbstractProblem, x::Vector)Query the cache of p to find if it has a cost value for point x. Alias to haskey.
DirectSearch.CacheGet — MethodCacheGet(p::AbstractProblem, x::Vector)Return the cost of point x in the cache of p. Does not check if x is in the cache, use CacheQuery to check.
DirectSearch.CacheRandomSample — MethodCacheRandomSample(p::AbstractProblem, n::Int)Returns a uniformly sampled collection of n points from the cache. Points can be repeated in the sample.
DirectSearch.CacheInitialPoint — MethodCacheInitialPoint(p::AbstractProblem)Return a tuple of the initial point added to the cache and its cost.
DirectSearch.CacheGetRange — MethodCacheGetRange(p::AbstractProblem, points::Vector)::Vector{Vector}Return a vector of costs corresponding to the vector of points.
DirectSearch.CacheFilter — MethodCacheFilter(p::AbstractProblem{T}, points::Vector{T})::Tuple{Vector{Vector{T}},Vector{Vector{T}}} where TReturn a tuple where the first entry is the set of input points in the cache and the second is the set of input points not in the cache.