Developer reference
High level picture
The high precision SDPA solvers do not provide a library interface, only binary access. So SDPAFamily.jl takes the problem inputs from a MathOptInterface Optimizer object and writes them to a file in a temporary folder (in the SDPA format) and calls the binary. The binary reads the input file, solves the problem, and writes an output file. SDPAFamily.jl then reads the output file and populates the MathOptInterface Optimizer object.
Docstrings
SDPAFamily.Params
— Typestruct Params{variant, T <: Number}
An object holding a list of parameters to be used by the solver, parametrized by the variant and numeric type. variant
should be one of :sdpa_gmp, :sdpa_qd, :sdpa_dd
or sdpa
. The variant and numeric type are used to choose the default values for unspecified parameters; they are unused in the case that every parameter is specified.
It is often simpler to simply pass non-default parameters directly to the optimizer as a NamedTuple
; e.g. SDPAFamily.Optimizer(params = (maxIteration = 600,))
.
Example
julia> using SDPAFamily
julia> P = SDPAFamily.Params{:sdpa_gmp, BigFloat}(maxIteration = 600)
SDPAFamily.Params{:sdpa_gmp,BigFloat}(600, 1.0e-30, 10000.0, 2.0, -100000.0, 100000.0, 0.1, 0.3, 0.9, 1.0e-30, 200, "%+.Fe", "%+.Fe", "%+.Fe", "%+.Fe")
julia> SDPAFamily.Optimizer(params = P)
SDPAFamily.Optimizer{BigFloat}
List of parameters
The following is a brief summary of the parameters. See the SDPA manual for more details.
maxIteration
: number of iterations allowedepsilonStar
: constraint toleranceepsilonDash
: normalized duality gap tolerancelambdaStar
: determines initial point; should have the same order of magnitude as the optimal solutionomegaStar
: determines region in which SDPA searches for an optimal solution; must be at least 1.0.lowerBound
, (resp.upperBound
): bound on the primal (resp. dual) optimal objective value; serves as a stopping criteriabetaStar
: parameter controlling the search direction for feasible pointsbetaBar
: parameter controlling the search direction for infeasible pointsgammaStar
: reduction factor for the primal and dual step lengthsprecision
: number of significant bits used for SDPA-GMP; if set tob
bits, then(log(2)/log(10)) * b
is approximately the number of decimal digits of precision.xPrint
,XPrint
,YPrint
,infPrint
:printf
format specification used for printing the results to send them from the solver binary to Julia.
SDPAFamily.ParamsSetting
— TypePossible the parameter settings of an SDPAFamily.Optimizer
. One can also pass a path to the params
keyword argument to use a custom parameter file.
Options are DEFAULT
, UNSTABLE_BUT_FAST
, or STABLE_BUT_SLOW
.
SDPAFamily.Verbosity
— TypePossible verbosity levels of an SDPAFamily.Optimizer
.
Options are SILENT
, WARN
, or VERBOSE
.
SDPAFamily.BB_PATHS
— ConstantBB_PATHS::Dict{Symbol,String}
Holds the binary-builder-built paths to the executables for sdpa_gmp
, sdpa_dd
, and sdpa_qd
.
SDPAFamily.WSLize_path
— MethodWSLize_path(path::String) -> String
This function converts Windows paths for use via WSL.
SDPAFamily.initializeSolve
— MethodinitializeSolve(optimizer::Optimizer)
Writes problem data into an SDPA-formatted file named input.dat-s
. presolve.jl
routine is applied as indicated by optimizer.presolve
.
Returns a vector of indices for redundant constraints, which are omitted from the input file.
SDPAFamily.inputElement
— MethodinputElement(optimizer::Optimizer, constr_number::Int, blk::Int, i::Int, j::Int, value::T) where T
Stores the constraint data in optimizer.elemdata
as a vector of tuples. Each tuple corresponds to one line in the SDPA-formatted input file.
SDPAFamily.presolve
— Methodpresolve(optimizer::SDPAFamily.Optimizer{T}) where T
Identifies linearly dependent constraints in the problem. This is done by a naive Gaussian elimination.
Returns a vector with the indices of redundant constraints, which should be removed from the formulation. The rest of the constraints form a maximal linearly independent subset of the original set of constraints.
SDPAFamily.read_results!
— Methodread_results!(optimizer::Optimizer{T}, filepath::String, redundant_entries::Vector)
Populates optimizer
with results in a SDPA-formatted output file specified by filepath
. Redundant entries corresponding to linearly dependent constraints are set to 0.
SDPAFamily.reduce!
— Methodfunction reduce!(A::SparseMatrixCSC{T}, ɛ = T <: Union{Rational,Integer} ? 0 : eps(norm(A, Inf))) where T
Identifies linearly dependent constraints in the problem. The last column of input is constraint constants and they are included to check if the linearly dependent constraints are redundant or inconsistent. This is done by a naive Gaussian elimination.
Returns a vector with the indices of redundant constraints, which should be removed from the formulation. The rest of the constraints form a maximal linearly independent subset of the original set of constraints.
SDPAFamily.sdpa_gmp_binary_solve!
— Methodsdpa_gmp_binary_solve!(m::Optimizer, full_input_path, full_output_path; redundant_entries)
Calls the binary sdpa_gmp
to solve SDPA-formatted problem specified in a .dat-s file at full_input_path
. Results are written into the file at full_output_path
. redundant_entries
is a sorted vector listing indices of linearly dependent constraint which are already removed by presolve.jl
. The corresponding decision variables are populated as zeros.
This function returns m
with solutions already populated from results in the output file.