picos.modeling.file_out¶
Functions for writing optimization problems to a file.
Functions

picos.modeling.file_out.
write
(picos_problem, filename, writer='picos')[source]¶ Write an optimization problem to a file.
 Parameters
P (Problem) – The problem to write.
filename (str) –
Path and name of the output file. The export format is inferred from the file extension. Supported extensions and their associated format are:
'.cbf'
– Conic Benchmark Format.This format is suitable for optimization problems involving second order and/or semidefinite cone constraints. This is a standard choice for conic optimization problems. Visit the website of The Conic Benchmark Library or read A benchmark library for conic mixedinteger and continuous optimization by Henrik A. Friberg for more information.
'.lp'
– LP format.This format handles only linear constraints, unless the writer
'cplex'
is used. In the latter case the extended CPLEX LP format is used instead.'.mps'
– MPS format.As the writer, you need to choose one of
'cplex'
,'gurobi'
or'mosek'
.'.opf'
– OPF format.As the writer, you need to choose
'mosek'
.'.dats'
– Sparse SDPA format.This format is suitable for semidefinite programs. Second order cone constraints are stored as semidefinite constraints on an arrow shaped matrix.
writer (str) – The default
'picos'
denotes PICOS’ internal writer, which can export to LP, CBF, and Sparse SDPA formats. If CPLEX, Gurobi or MOSEK is installed, you can choose'cplex'
,'gurobi'
, or'mosek'
, respectively, to make use of that solver’s export function and get access to more formats.
Warning
For problems involving a symmetric matrix variable (typically, semidefinite programs), the expressions involving are stored in PICOS as a function of , the symmetric vectorized form of (see Dattorro, ch.2.2.2.1), and are also exported in that form. As a result, using an external solver on a problem description file exported by PICOS will also yield a solution in this symmetric vectorized form.
The CBF writer tries to write symmetric variables in the section
PSDVAR
of the .cbf file. However, this is possible only if the constraint appears in the problem, and no other LMI involves . If these two conditions are not satisfied, then the symmetric vectorization of is used as a (free) variable of the sectionVAR
in the .cbf file, as explained in the previous paragraph.Warning
This function is severly outdated and may fail or not function as advertised.
Objects

picos.modeling.file_out.
INFINITY
¶ A number deemed too large to appear in practice.
 Default value
1e+16