This chapter lists all functionality in the MOSEK Python API.
Functions in the interface grouped by functionality.
Analyzing the problem and associated data.
mosek.Task.analyzeproblem
Analyze the data of a task.
mosek.Task.analyzesolution
Print information related to the quality of the solution.
Reading and writing data files.
mosek.Task.readbranchpriorities
Reads branching priority data from a file.
mosek.Task.readdata
Reads problem data from a file.
mosek.Task.readparamfile
Reads a parameter file.
mosek.Task.readsolution
Reads a solution from a file.
mosek.Task.writebranchpriorities
Writes branching priority data to a file.
mosek.Task.writedata
Writes problem data to a file.
mosek.Task.writeparamfile
Writes all the parameters to a parameter file.
mosek.Task.writesolution
Write a solution to a file.
Obtain or define a solution.
mosek.Task.deletesolution
Undefines a solution and frees the memory it uses.
mosek.Task.getdbi
Obtains the dual bound infeasibility.
mosek.Task.getdcni
Obtains the dual cone infeasibility.
mosek.Task.getdeqi
Optains the dual equation infeasibility.
mosek.Task.getdualobj
Obtains the dual objective value.
mosek.Task.getinti
Obtains the primal equation infeasibility.
mosek.Task.getpbi
Obtains the primal bound infeasibility.
mosek.Task.getpcni
Obtains the primal cone infeasibility.
mosek.Task.getpeqi
Obtains the primal equation infeasibility.
mosek.Task.getprimalobj
Obtains the primal objective value.
mosek.Task.getreducedcosts
Obtains the difference of (slx-sux) for a sequence of variables.
mosek.Task.getsolution
Obtains the complete solution.
mosek.Task.getsolutioni
Obtains the solution for a single constraint or variable.
mosek.Task.getsolutioninf
Obtains information about a solution.
mosek.Task.getsolutionslice
Obtains a slice of the solution.
mosek.Task.getsolutionstatus
Obtains information about the problem and solution statuses.
mosek.Task.getsolutionstatuskeyslice
Obtains a slice of the solution status keys.
mosek.Task.makesolutionstatusunknown
Sets the solution status to unknown.
mosek.Task.optimizersummary
Prints a short summary with optimizer statistics for last optimization.
mosek.Task.putsolution
Inserts a solution.
mosek.Task.putsolutioni
Sets the primal and dual solution information for a single constraint or variable.
mosek.Task.readsolution
Reads a solution from a file.
mosek.Task.solutiondef
Checks whether a solution is defined.
mosek.Task.solutionsummary
Prints a short summary of the current solutions.
mosek.Task.undefsolution
Undefines a solution.
Memory allocation and deallocation.
mosek.Task.checkmem
Checks the memory allocated by the task.
mosek.Task.getmemusage
Obtains information about the amount of memory used by a task.
Input or change problem specification.
mosek.Task.append
Appends a number of variables or constraints to the optimization task.
mosek.Task.appendcone
Appends a new cone constraint to the problem.
mosek.Env.checkoutlicense
Check out a license feature from the license server ahead of time.
mosek.Task.chgbound
Changes the bounds for one constraint or variable.
mosek.Task.commitchanges
Commits all cached problem changes.
mosek.Task.inputdata
Input the linear part of an optimization task in one function call.
mosek.Task.putaij
Changes a single value in the linear coefficient matrix.
mosek.Task.putaijlist
Changes one or more coefficients in the linear constraint matrix.
mosek.Task.putavec
Replaces all elements in one row or column of the linear coefficient matrix.
mosek.Task.putaveclist
Replaces all elements in one or more rows or columns in the linear constraint matrix by new values.
mosek.Task.putbound
Changes the bound for either one constraint or one variable.
mosek.Task.putboundlist
Changes the bounds of constraints or variables.
mosek.Task.putboundslice
Modifies bounds.
mosek.Task.putcfix
Replaces the fixed term in the objective.
mosek.Task.putcj
Modifies one linear coefficient in the objective.
mosek.Task.putclist
Modifies a part of the linear objective coefficients.
mosek.Task.putcone
Replaces a conic constraint.
mosek.Task.putobjsense
Sets the objective sense.
mosek.Task.putqcon
Replaces all quadratic terms in constraints.
mosek.Task.putqconk
Replaces all quadratic terms in a single constraint.
mosek.Task.putqobj
Replaces all quadratic terms in the objective.
mosek.Task.putqobjij
Replaces one coefficient in the quadratic term in the objective.
mosek.Task.putvartype
Sets the variable type of one variable.
mosek.Task.putvartypelist
Sets the variable type for one or more variables.
Functionality for deleting problem elements such as variables, constraints or cones.
mosek.Task.remove
The function removes a number of constraints or variables.
mosek.Task.removecone
Removes a conic constraint from the problem.
Functionality for adding problem elements such as variables, constraints or cones.
mosek.Task.append
Appends a number of variables or constraints to the optimization task.
mosek.Task.appendcone
Appends a new cone constraint to the problem.
Functionality for inspecting the problem specification (A,Q, bounds, objective e.t.c).
mosek.Task.getaij
Obtains a single coefficient in linear constraint matrix.
mosek.Task.getaslice
Obtains a sequence of rows or columns from the coefficient matrix.
mosek.Task.getaslicetrip
Obtains a sequence of rows or columns from the coefficient matrix in triplet format.
mosek.Task.getavec
Obtains one row or column of the linear constraint matrix.
mosek.Task.getavecnumnz
Obtains the number of non-zero elements in one row or column of the linear constraint matrix
mosek.Task.getbound
Obtains bound information for one constraint or variable.
mosek.Task.getboundslice
Obtains bounds information for a sequence of variables or constraints.
mosek.Task.getc
Obtains all objective coefficients.
mosek.Task.getcfix
Obtains the fixed term in the objective.
mosek.Task.getcone
Obtains a conic constraint.
mosek.Task.getconeinfo
Obtains information about a conic constraint.
mosek.Task.getcslice
Obtains a sequence of coefficients from the objective.
mosek.Task.getintpntnumthreads
Obtains the number of threads used by the interior-point optimizer.
mosek.Task.getnumanz
Obtains the number of non-zeros in the coefficient matrix.
mosek.Task.getnumanz64
Obtains the number of non-zeros in the coefficient matrix.
mosek.Task.getnumcon
Obtains the number of constraints.
mosek.Task.getnumcone
Obtains the number of cones.
mosek.Task.getnumconemem
Obtains the number of members in a cone.
mosek.Task.getnumintvar
Obtains the number of integer-constrained variables.
mosek.Task.getnumqconknz
Obtains the number of non-zero quadratic terms in a constraint.
mosek.Task.getnumqconknz64
Obtains the number of non-zero quadratic terms in a constraint.
mosek.Task.getnumqobjnz
Obtains the number of non-zero quadratic terms in the objective.
mosek.Task.getnumqobjnz64
Obtains the number of non-zero quadratic terms in the objective.
mosek.Task.getnumvar
Obtains the number of variables.
mosek.Task.getobjsense
Gets the objective sense.
mosek.Task.getprobtype
Obtains the problem type.
mosek.Task.getqconk
Obtains all the quadratic terms in a constraint.
mosek.Task.getqconk64
Obtains all the quadratic terms in a constraint.
mosek.Task.getqobj
Obtains all the quadratic terms in the objective.
mosek.Task.getqobj64
Obtains all the quadratic terms in the objective.
mosek.Task.getqobjij
Obtains one coefficient from the quadratic term of the objective
mosek.Task.getvartype
Gets the variable type of one variable.
mosek.Task.getvartypelist
Obtains the variable type for one or more variables.
Functionality related to conic terms in the problem.
mosek.Task.appendcone
Appends a new cone constraint to the problem.
mosek.Task.getcone
Obtains a conic constraint.
mosek.Task.getconeinfo
Obtains information about a conic constraint.
mosek.Task.getnumcone
Obtains the number of cones.
mosek.Task.putcone
Replaces a conic constraint.
mosek.Task.removecone
Removes a conic constraint from the problem.
Functionality related to changing or inspecting bounds on variables or constraints.
mosek.Task.chgbound
Changes the bounds for one constraint or variable.
mosek.Task.getbound
Obtains bound information for one constraint or variable.
mosek.Task.getboundslice
Obtains bounds information for a sequence of variables or constraints.
mosek.Task.putbound
Changes the bound for either one constraint or one variable.
mosek.Task.putboundlist
Changes the bounds of constraints or variables.
mosek.Task.putboundslice
Modifies bounds.
Output stream functions.
mosek.Env.echointro
Prints an intro to message stream.
mosek.Env.linkfiletostream
Directs all output from a stream to a file.
mosek.Task.linkfiletostream
Directs all output from a task stream to a file.
mosek.Task.optimizersummary
Prints a short summary with optimizer statistics for last optimization.
mosek.Task.printdata
Prints a part of the problem data to a stream.
mosek.Task.printparam
Prints the current parameter settings.
mosek.Task.readsummary
Prints information about last file read.
mosek.Task.solutionsummary
Prints a short summary of the current solutions.
Change or inspect objective function.
mosek.Task.getc
Obtains all objective coefficients.
mosek.Task.getcfix
Obtains the fixed term in the objective.
mosek.Task.getcslice
Obtains a sequence of coefficients from the objective.
mosek.Task.getdualobj
Obtains the dual objective value.
mosek.Task.getnumqobjnz
Obtains the number of non-zero quadratic terms in the objective.
mosek.Task.getnumqobjnz64
Obtains the number of non-zero quadratic terms in the objective.
mosek.Task.getobjname
Obtains the name assigned to the objective function.
mosek.Task.getobjsense
Gets the objective sense.
mosek.Task.getprimalobj
Obtains the primal objective value.
mosek.Task.getqobj
Obtains all the quadratic terms in the objective.
mosek.Task.getqobj64
Obtains all the quadratic terms in the objective.
mosek.Task.getqobjij
Obtains one coefficient from the quadratic term of the objective
mosek.Task.putcfix
Replaces the fixed term in the objective.
mosek.Task.putcj
Modifies one linear coefficient in the objective.
mosek.Task.putclist
Modifies a part of the linear objective coefficients.
mosek.Task.putobjsense
Sets the objective sense.
mosek.Task.putqobj
Replaces all quadratic terms in the objective.
mosek.Task.putqobjij
Replaces one coefficient in the quadratic term in the objective.
Inspect statistics from the optimizer.
mosek.Task.getdouinf
Obtains a double information item.
mosek.Task.getintinf
Obtains an integer information item.
mosek.Task.getlintinf
Obtains an integer information item.
Setting and inspecting solver parameters.
mosek.Task.getdouparam
Obtains a double parameter.
mosek.Task.getintparam
Obtains an integer parameter.
mosek.Task.getnumparam
Obtains the number of parameters of a given type.
mosek.Task.isdouparname
Checks a double parameter name.
mosek.Task.isintparname
Checks an integer parameter name.
mosek.Task.isstrparname
Checks a string parameter name.
mosek.Task.putdouparam
Sets a double parameter.
mosek.Task.putintparam
Sets an integer parameter.
mosek.Task.putnadouparam
Sets a double parameter.
mosek.Task.putnaintparam
Sets an integer parameter.
mosek.Task.putnastrparam
Sets a string parameter.
mosek.Task.putparam
Modifies the value of parameter.
mosek.Task.putstrparam
Sets a string parameter.
mosek.Task.setdefaults
Resets all parameters values.
Functionality related to naming.
mosek.Task.getconname
Obtains a name of a constraint.
mosek.Task.getname
Obtains the name of a cone, a variable or a constraint.
mosek.Task.getname
Obtains the name of a cone, a variable or a constraint.
mosek.Task.getnameindex
Checks whether a name has been assigned and returns the index corresponding to the name.
mosek.Task.getnamelen
Obtains the length of a problem item name.
mosek.Task.getobjname
Obtains the name assigned to the objective function.
mosek.Task.gettaskname64
Obtains the task name.
mosek.Task.getvarname
Obtains a name of a variable.
mosek.Task.putname
Assigns a name to a problem item.
mosek.Task.putobjname
Assigns a new name to the objective.
mosek.Task.puttaskname
Assigns a new name to the task.
Functionality related to preallocating space for problem data.
mosek.Task.getmaxnumanz
Obtains number of preallocated non-zeros in the linear constraint matrix.
mosek.Task.getmaxnumcon
Obtains the number of preallocated constraints in the optimization task.
mosek.Task.getmaxnumcone
Obtains the number of preallocated cones in the optimization task.
mosek.Task.getmaxnumqnz
Obtains the number of preallocated non-zeros for all quadratic terms in objective and constraints.
mosek.Task.getmaxnumvar
Obtains the maximum number variables allowed.
mosek.Task.putmaxnumanz
The function changes the size of the preallocated storage for linear coefficients.
mosek.Task.putmaxnumcon
Sets the number of preallocated constraints in the optimization task.
mosek.Task.putmaxnumcone
Sets the number of preallocated conic constraints in the optimization task.
mosek.Task.putmaxnumqnz
Changes the size of the preallocated storage for quadratic terms.
mosek.Task.putmaxnumvar
Sets the number of preallocated variables in the optimization task.
Functionality related to integer variables.
mosek.Task.getnumintvar
Obtains the number of integer-constrained variables.
mosek.Task.getvarbranchdir
Obtains the branching direction for a variable.
mosek.Task.getvarbranchpri
Obtains the branching priority for a variable.
mosek.Task.getvartype
Gets the variable type of one variable.
mosek.Task.getvartypelist
Obtains the variable type for one or more variables.
mosek.Task.putvarbranchorder
Assigns a branching priority and direction to a variable.
mosek.Task.putvartype
Sets the variable type of one variable.
mosek.Task.putvartypelist
Sets the variable type for one or more variables.
Functionality related to quadratic terms.
mosek.Task.getqconk
Obtains all the quadratic terms in a constraint.
mosek.Task.getqconk64
Obtains all the quadratic terms in a constraint.
mosek.Task.getqobj
Obtains all the quadratic terms in the objective.
mosek.Task.getqobj64
Obtains all the quadratic terms in the objective.
mosek.Task.getqobjij
Obtains one coefficient from the quadratic term of the objective
mosek.Task.putqcon
Replaces all quadratic terms in constraints.
mosek.Task.putqconk
Replaces all quadratic terms in a single constraint.
mosek.Task.putqobj
Replaces all quadratic terms in the objective.
mosek.Task.putqobjij
Replaces one coefficient in the quadratic term in the objective.
Functions for diagnosing infeasibility.
mosek.Task.getinfeasiblesubproblem
Obtains an infeasible sub problem.
mosek.Task.relaxprimal
Creates a problem that finds the minimal change to the bounds that makes an infeasible problem feasible.
Functions for optimization.
mosek.Task.checkdata
Checks data of the task.
mosek.Task.netoptimize
Optimizes a pure network flow problem.
mosek.Task.optimizeconcurrent
Optimize a given task with several optimizers concurrently.
mosek.Task.optimize
Optimizes the problem.
Functions for network optimization.
mosek.Task.netextraction
Finds embedded network structure.
mosek.Task.netoptimize
Optimizes a pure network flow problem.
Functions for sensitivity analysis.
mosek.Task.dualsensitivity
Performs sensitivity analysis on objective coefficients.
mosek.Task.primalsensitivity
Perform sensitivity analysis on bounds.
mosek.Task.sensitivityreport
Creates a sensitivity report.
Functions for testing data validity.
mosek.Task.checkconvexity
Checks if a quadratic optimization problem is convex.
Functions for solving linear systems with the basis matrix.
mosek.Task.basiscond
Computes conditioning information for the basis matrix.
mosek.Task.initbasissolve
Prepare a task for basis solver.
mosek.Task.solvewithbasis
Solve a linear equation system involving a basis matrix.
Creation and initialization of environment.
mosek.Env.checkinlicense
Check in a license feature from the license server ahead of time.
mosek.Env.init
Initialize a MOSEK environment.
mosek.Env.putlicensedefaults
Set defaults used by the license manager.
Change elements in the coefficient (A) matrix.
mosek.Env.checkoutlicense
Check out a license feature from the license server ahead of time.
mosek.Task.commitchanges
Commits all cached problem changes.
mosek.Task.putaij
Changes a single value in the linear coefficient matrix.
mosek.Task.putaijlist
Changes one or more coefficients in the linear constraint matrix.
mosek.Task.putavec
Replaces all elements in one row or column of the linear coefficient matrix.
mosek.Task.putaveclist
Replaces all elements in one or more rows or columns in the linear constraint matrix by new values.
__builtin__.Exception
This exception is raised is an input or output array was shorter than required.
A Mosek Environment
Env ()
Env (str dbgfile)
checkinlicense (mosek.feature feature)
Check in a license feature to the license server. By default all licenses consumed by functions using a single environment is kept checked out for the lifetime of the MOSEK environment. This function checks in a given license feature to the license server immidiatly.
If the given license feature is not checked out or is in use by a call to Task.optimizetrm calling this function has no effect.
Please note that returning a license to the license server incurs a small overhead, so frequent calls to this function should be avoided.
checkoutlicense (mosek.feature feature)
Check out a license feature from the license server. Normally the required license features will be automatically checked out the first time it is needed by the function Task.optimizetrm. This function can be used to check out one or more features ahead of time.
The license will remain checked out for the lifetime of the MOSEK environment or until the function Env.checkinlicense is called.
If a given feature is already checked out when this function is called, only one feature will be checked out from the license server.
echointro (int longver)
major,minor,build,revision = getversion ()
init ()
linkfiletostream ( mosek.streamtype whichstream, str filename, int append)
putcpudefaults ( mosek.cputype cputype, int sizel1, int sizel2)
putdllpath (str dllpath)
putkeepdlls (int keepdlls)
putlicensedefaults ( str licensefile, array(int) licensebuf, int licwait, int licdebug)
set_Stream (mosek.streamtype whichstream)
mosek.Exception
This is an exception class representing MOSEK errors.
Error (mosek.rescode code)
Error ( mosek.rescode code, str msg)
__builtin__.Exception
This is the base class for exceptions based on MOSEK response codes.
Exception (mosek.rescode code)
A Mosek Optimization task
Task ( int maxnumcon, int maxnumvar)
analyzeproblem (mosek.streamtype whichstream)
analyzesolution ( mosek.streamtype whichstream, mosek.soltype whichsol)
Print information related to the quality of the solution and other solution statistics.
By default this function prints information about the largest infeasibilites in the solution, the primal (and possibly dual) objective value and the solution status.
Following parameters can be used to configure the printed statistics:
Obtains the primal equation infeasibility.
Optains the dual equation infeasibility.
Obtains the primal bound infeasibility.
Obtains the dual bound infeasibility.
Obtains the dual cone infeasibility.
Obtains the primal cone infeasibility.
Obtains information about a solution.
Obtains information about the problem and solution statuses.
append ( mosek.accmode accmode, int num)
The function removes a number of constraints or variables.
appendcone ( mosek.conetype conetype, double conepar, array(int) submem)
Appends a new conic constraint to the problem. Hence, add a constraint
![]() |
to the problem where is a convex cone.
is a subset of the variables which will be specified by the argument submem.
Depending on the value of conetype this function appends a normal (mosek.conetype.quad) or rotated quadratic cone (mosek.conetype.rquad). Define
![]() |
. Depending on the value of conetype this function appends one of the constraints:
Quadratic cone (mosek.conetype.quad) :
![]() |
Rotated quadratic cone (mosek.conetype.rquad) :
![]() |
Please note that the sets of variables appearing in different conic constraints must be disjoint.
For an explained code example see Section 5.4.
nrmbasis,nrminvbasis = basiscond ()
If a basic solution is available and it defines a nonsingular basis, then this function computes the 1-norm estimate of the basis matrix and an 1-norm estimate for the inverse of the basis matrix. The 1-norm estimates are computed using the method outlined in [9, pp. 388-391].
By defintion the 1-norm condition number of a matrix B is defined as
![]() |
Moreover, the larger the condition number is the harder it is to solve linear equation systems involving B. Given estimates for and
it is also possible to estimate
.
checkconvexity ()
This function checks if a quadratic optimization problem is convex. The amount of checking is controlled by mosek.iparam.check_convexity.
The function throws an exception if the problem is not convex.
checkdata ()
checkmem ( str file, int line)
chgbound ( mosek.accmode accmode, int i, int lower, int finite, double value)
Changes a bound for one constraint or variable. If accmode equals mosek.accmode.con, a constraint bound is changed, otherwise a variable bound is changed.
If lower is non-zero, then the lower bound is changed as follows:
![]() |
Otherwise if lower is zero, then
![]() |
Please note that this function automatically updates the bound key for bound, in particular, if the lower and upper bounds are identical, the bound key is changed to fixed.
Changes the bound for either one constraint or one variable.
commitchanges ()
deletesolution (mosek.soltype whichsol)
dualsensitivity ( array(int) subj, array(double) leftpricej, array(double) rightpricej, array(double) leftrangej, array(double) rightrangej)
Calculates sensitivity information for objective coefficients. The indexes of the coefficients to analyze are
![]() |
The results are returned so that e.g is the left shadow price of the objective coefficient with index
.
The type of sensitivity analysis to perform (basis or optimal partition) is controlled by the parameter mosek.iparam.sensitivity_type.
For an example, please see Section 12.5.
Perform sensitivity analysis on bounds.
Creates a sensitivity report.
aij = getaij ( int i, int j)
numnz = getapiecenumnz ( int firsti, int lasti, int firstj, int lastj)
Obtains the number non-zeros in a rectangular piece of A, i.e. the number
![]() |
where means the number of elements in the set
.
This function is not an efficient way to obtain the number of non-zeros in one row or column. In that case use the function Task.getavecnumnz.
Obtains the number of non-zero elements in one row or column of the linear constraint matrix
surp = getaslice ( mosek.accmode accmode, int first, int last, long surp, array(long) ptrb, array(long) ptre, array(int) sub, array(double) val)
Obtains the number of non-zeros in a slice of rows or columns of the coefficient matrix.
numnz = getaslicenumnz ( mosek.accmode accmode, int first, int last)
surp = getaslicetrip ( mosek.accmode accmode, int first, int last, int surp, array(int) subi, array(int) subj, array(double) val)
nzi = getavec ( mosek.accmode accmode, int i, array(int) subi, array(double) vali)
Obtains one row or column of A in a sparse format. If accmode equals mosek.accmode.con a row is returned and hence:
![]() |
If accmode equals mosek.accmode.var a column is returned, that is:
![]() |
nzj = getavecnumnz ( mosek.accmode accmode, int i)
bk,bl,bu = getbound ( mosek.accmode accmode, int i)
getboundslice ( mosek.accmode accmode, int first, int last, array(boundkey) bk, array(double) bl, array(double) bu)
getc (array(double) c)
cfix = getcfix ()
conetype,conepar,nummem = getcone ( int k, array(int) submem)
conetype,conepar,nummem = getconeinfo (int k)
name = getconname (int i)
getcslice ( int first, int last, array(double) c)
getdbi ( mosek.soltype whichsol, mosek.accmode accmode, array(int) sub, array(double) dbi)
Dual bound infeasibility. If acmode is mosek.accmode.con then
![]() |
(14.6.1) |
else
![]() |
(14.6.2) |
Obtains information about a solution.
getdcni ( mosek.soltype whichsol, array(int) sub, array(double) dcni)
Obtains information about a solution.
getdeqi ( mosek.soltype whichsol, mosek.accmode accmode, array(int) sub, array(double) deqi, int normalize)
Optains the dual equation infeasibility. If acmode is mosek.accmode.con then
![]() |
(14.6.3) |
If acmode is mosek.accmode.var then
![]() |
(14.6.4) |
Obtains information about a solution.
parvalue = getdouparam (mosek.dparam param)
dualobj = getdualobj (mosek.soltype whichsol)
inftask = getinfeasiblesubproblem (mosek.soltype whichsol)
Creates a problem that finds the minimal change to the bounds that makes an infeasible problem feasible.
getinti ( mosek.soltype whichsol, array(int) sub, array(double) inti)
Obtains the primal equation infeasibility.
![]() |
(14.6.5) |
Obtains information about a solution.
ivalue = getintinf (mosek.iinfitem whichiinf)
parvalue = getintparam (mosek.iparam param)
numthreads = getintpntnumthreads ()
ivalue = getlintinf (mosek.liinfitem whichliinf)
maxnumanz = getmaxnumanz ()
maxnumcon = getmaxnumcon ()
maxnumcone = getmaxnumcone ()
maxnumqnz = getmaxnumqnz ()
maxnumvar = getmaxnumvar ()
meminuse,maxmemuse = getmemusage ()
len,name = getname ( mosek.problemitem whichitem, int i)
name = getname ( mosek.problemitem whichitem, int i)
asgn,index = getnameindex ( mosek.problemitem whichitem, str name)
len = getnamelen ( mosek.problemitem whichitem, int i)
Obtains the name of a cone, a variable or a constraint.
numanz = getnumanz ()
numanz = getnumanz64 ()
numcon = getnumcon ()
numcone = getnumcone ()
nummem = getnumconemem (int k)
numintvar = getnumintvar ()
numparam = getnumparam (mosek.parametertype partype)
numqcnz = getnumqconknz (int k)
numqcnz = getnumqconknz64 (int k)
numqonz = getnumqobjnz ()
numqonz = getnumqobjnz64 ()
numvar = getnumvar ()
len,objname = getobjname ()
sense = getobjsense ()
Sets the objective sense.
getpbi ( mosek.soltype whichsol, mosek.accmode accmode, array(int) sub, array(double) pbi, int normalize)
Obtains the primal bound infeasibility. If acmode is mosek.accmode.con then
![]() |
(14.6.6) |
If acmode is mosek.accmode.var then
![]() |
(14.6.7) |
Obtains information about a solution.
getpcni ( mosek.soltype whichsol, array(int) sub, array(double) pcni)
Obtains information about a solution.
getpeqi ( mosek.soltype whichsol, array(int) sub, array(double) peqi, int normalize)
Obtains the primal equation infeasibility.
![]() |
(14.6.8) |
Obtains information about a solution.
primalobj = getprimalobj (mosek.soltype whichsol)
probtype = getprobtype ()
qcsurp,numqcnz = getqconk ( int k, int qcsurp, array(int) qcsubi, array(int) qcsubj, array(double) qcval)
qcsurp,numqcnz = getqconk64 ( int k, long qcsurp, array(int) qcsubi, array(int) qcsubj, array(double) qcval)
qosurp,numqonz = getqobj ( int qosurp, array(int) qosubi, array(int) qosubj, array(double) qoval)
qosurp,numqonz = getqobj64 ( long qosurp, array(int) qosubi, array(int) qosubj, array(double) qoval)
qoij = getqobjij ( int i, int j)
prosta,solsta = getsolution ( mosek.soltype whichsol, array(stakey) skc, array(stakey) skx, array(stakey) skn, array(double) xc, array(double) xx, array(double) y, array(double) slc, array(double) suc, array(double) slx, array(double) sux, array(double) snx)
Obtains the complete solution.
Consider the case of linear programming. The primal problem is given by
![]() |
(14.6.10) |
and the corresponding dual problem is
![]() |
(14.6.11) |
In this case the mapping between variables and arguments to the function is as follows:
xx: Corresponds to variable x.
y: Corresponds to variable y.
slc: Corresponds to variable .
suc: Corresponds to variable .
slx: Corresponds to variable .
sux: Corresponds to variable .
xc: Corresponds to Ax.
The meaning of the values returned by this function depend on the solution status returned in the argument solsta. The most important possible values of solsta are:
mosek.solsta.optimal An optimal solution satisfying the optimality criteria for continuous problems is returned.
mosek.solsta.integer_optimal An optimal solution satisfying the optimality criteria for integer problems is returned.
mosek.solsta.prim_feas A solution satisfying the feasibility criteria.
mosek.solsta.prim_infeas_cer A primal certificate of infeasibility is returned.
mosek.solsta.dual_infeas_cer A dual certificate of infeasibility is returned.
Obtains the solution for a single constraint or variable.
Obtains a slice of the solution.
sk,x,sl,su,sn = getsolutioni ( mosek.accmode accmode, int i, mosek.soltype whichsol)
Obtains the complete solution.
Obtains a slice of the solution.
prosta,solsta,primalobj,maxpbi,maxpcni,maxpeqi,maxinti,dualobj,maxdbi,maxdcni,maxdeqi = getsolutioninf (mosek.soltype whichsol)
Value of the primal objective.
![]() |
(14.6.12) |
Maximum infeasibility in primal bounds on variables.
![]() |
(14.6.13) |
Maximum infeasibility in primal equality constraints.
![]() |
(14.6.14) |
Maximum infeasibility in integer constraints.
![]() |
(14.6.15) |
Value of the dual objective.
![]() |
(14.6.16) |
Maximum infeasibility in bounds on dual variables.
![]() |
(14.6.17) |
Maximum infeasibility in the dual equality constraints.
![]() |
(14.6.18) |
Obtains information about the quality of a solution. Part of the following documentation is restricted to the linear case, it should be clear how to extend to other problem classes.
When optimizing MOSEK solves a reformulated problem with only equality constraints.
![]() |
(14.6.19) |
where
![]() |
and the corresponding dual problem is
![]() |
(14.6.20) |
The values returned by this function refers to these problems.
Please note that this function computes the objective value and other values every time it is called. Hence, for efficiency reasons this function should not be used too frequently.
If only the problem status or the solution status is required then use Task.getsolutionstatus instead.
Obtains the primal equation infeasibility.
Optains the dual equation infeasibility.
Obtains the primal bound infeasibility.
Obtains the dual bound infeasibility.
Obtains the dual cone infeasibility.
Obtains the primal cone infeasibility.
Print information related to the quality of the solution.
Obtains information about the problem and solution statuses.
getsolutionslice ( mosek.soltype whichsol, mosek.solitem solitem, int first, int last, array(double) values)
Obtains a slice of the solution.
Consider the case of linear programming. The primal problem is given by
![]() |
(14.6.21) |
and the corresponding dual problem is
![]() |
(14.6.22) |
The solitem argument determines which part of the solution is returned:
mosek.solitem.xx: The variable values return x.
mosek.solitem.y: The variable values return y.
mosek.solitem.slc: The variable values return .
mosek.solitem.suc: The variable values return .
mosek.solitem.slx: The variable values return .
mosek.solitem.sux: The variable values return .
A conic optimization problem has the same primal variables as in the linear case. Recall that the dual of a conic optimization problem is given by:
![]() |
(14.6.23) |
This introduces one additional dual variable . This variable can be acceded by selecting solitem as mosek.solitem.snx.
The meaning of the values returned by this function also depends on the solution status which can be obtained with Task.getsolutionstatus. Depending on the solution status value will be:
mosek.solsta.optimal A part of the optimal solution satisfying the optimality criteria for continuous problems.
mosek.solsta.integer_optimal A part of the optimal solution satisfying the optimality criteria for integer problems.
mosek.solsta.prim_feas A part of the solution satisfying the feasibility criteria.
mosek.solsta.prim_infeas_cer A part of the primal certificate of infeasibility.
mosek.solsta.dual_infeas_cer A part of the dual certificate of infeasibility.
Obtains the complete solution.
Obtains the solution for a single constraint or variable.
getsolutionstatuskeyslice ( mosek.accmode accmode, mosek.soltype whichsol, int first, int last, array(stakey) sk)
Obtains the complete solution.
Obtains the solution for a single constraint or variable.
len,taskname = gettaskname64 ()
direction = getvarbranchdir (int j)
priority = getvarbranchpri (int j)
name = getvarname (int i)
vartype = getvartype (int j)
getvartypelist ( array(int) subj, array(variabletype) vartype)
Obtains the variable type of one or more variables.
Upon return vartype[k] is the variable type of variable subj[k].
initbasissolve (array(int) basis)
The array of basis indexes to use.
The array is interpreted as follows: If , then
is in the basis at position i, otherwise
is in the basis at position i.
Prepare a task for use with the Task.solvewithbasis function.
This function should be called
If the basis is singular i.e. not invertible, then
the exception mosek.rescode.err_basis_singular is generated.
inputdata ( int maxnumcon, int maxnumvar, array(double) c, double cfix, array(long) aptrb, array(long) aptre, array(int) asub, array(double) aval, array(boundkey) bkc, array(double) blc, array(double) buc, array(boundkey) bkx, array(double) blx, array(double) bux)
Input the linear part of an optimization problem.
The non-zeros of A are inputted column-wise in the format described in Section 5.8.3.2.
For an explained code example see Section 5.2 and Section 5.8.3.
param = isdouparname (str parname)
param = isintparname (str parname)
param = isstrparname (str parname)
linkfiletostream ( mosek.streamtype whichstream, str filename, int append)
makesolutionstatusunknown (mosek.soltype whichsol)
numcon,numvar = netextraction ( array(int) netcon, array(int) netvar, array(double) scalcon, array(double) scalvar, array(double) cx, array(boundkey) bkc, array(double) blc, array(double) buc, array(boundkey) bkx, array(double) blx, array(double) bux, array(int) from, array(int) to)
Uses a heuristic to find an embedded network in the problem specified in task. The returned network is a pure network flow problem and can be solved with a direct call to the network optimizer Task.netoptimize.
Each arc a in the network corresponds to a scaled subset of elements in column from the constraint matrix A stored in task. Each node n in the network corresponds to a scaled subset of elements in constraint i=netcon[n] from A. Data structures for network problems is explained in 5.2 and 6.2. The relation between A and the extracted embedded network can be explained as follows:
Please note if a column j=netvar[a] is only represented by one non-zero in the embedded network, then either from[a]=netcon or to[a]=netcon.
Optimizes a pure network flow problem.
prosta,solsta = netoptimize ( array(double) cc, array(double) cx, array(boundkey) bkc, array(double) blc, array(double) buc, array(boundkey) bkx, array(double) blx, array(double) bux, array(int) from, array(int) to, int hotstart, array(stakey) skc, array(stakey) skx, array(double) xc, array(double) xx, array(double) y, array(double) slc, array(double) suc, array(double) slx, array(double) sux)
Finds embedded network structure.
optimizeconcurrent (array(Task) taskarray)
Solves several instances of the same problem in parallel, with unique parameter settings for each task. The argument task contains the problem to be solved. taskarray is a pointer to an array of num empty tasks. The task task and the num tasks pointed to by taskarray are solved in parallel. That is threads are started with one optimizer in each. Each of the tasks can be initialized with different parameters, e.g different selection of solver.
All the concurrently running tasks are stopped when the optimizer successfully terminates for one of the tasks. After the function returns task contains the solution found by the task that finished first.
After Task.optimizeconcurrent returns task holds the optimal solution of the task which finished first. If all the concurrent optimizations finished without providing an optimal solution the error code from the solution of the task task is returned.
In summary a call to Task.optimizeconcurrent does the following:
For an explained code example see Section 8.6.4.
optimizersummary (mosek.streamtype whichstream)
trmcode = optimize ()
Optimize a given task with several optimizers concurrently.
Obtains the complete solution.
Obtains the solution for a single constraint or variable.
Obtains information about a solution.
primalsensitivity ( array(int) subi, array(mark) marki, array(int) subj, array(mark) markj, array(double) leftpricei, array(double) rightpricei, array(double) leftrangei, array(double) rightrangei, array(double) leftpricej, array(double) rightpricej, array(double) leftrangej, array(double) rightrangej)
Calculates sensitivity information for bounds on variables and constraints.
For details on sensitivity analysis and the definitions of shadow price and linearity interval see chapter 12.
The constraints for which sensitivity analysis is performed are given by the data structures:
Consider the problem:
![]() |
(14.6.24) |
Suppose that
numi = 1; subi = [0]; marki = [mosek.mark.up]
then
leftpricei[0], rightpricei[0], leftrangei[0] and rightrangei[0] will contain the sensitivity information for the upper bound on constraint 0 given by the expression:
![]() |
(14.6.25) |
Similarly, the variables for which to perform sensitivity analysis are given by the structures:
For an example, please see Section 12.5.
The type of sensitivity analysis to be performed (basis or optimal partition) is controlled by the parameter mosek.iparam.sensitivity_type.
Performs sensitivity analysis on objective coefficients.
Creates a sensitivity report.
printdata ( mosek.streamtype whichstream, int firsti, int lasti, int firstj, int lastj, int firstk, int lastk, int c, int qo, int a, int qc, int bc, int bx, int vartype, int cones)
printparam ()
putaij ( int i, int j, double aij)
Changes a coefficient in A using the method
![]() |
Replaces all elements in one row or column of the linear coefficient matrix.
Changes a single value in the linear coefficient matrix.
putaijlist ( array(int) subi, array(int) subj, array(double) valij)
Changes one or more coefficients in A using the method
![]() |
If the same entry appears multiple times only the last one will be used.
Replaces all elements in one row or column of the linear coefficient matrix.
Changes a single value in the linear coefficient matrix.
putavec ( mosek.accmode accmode, int i, array(int) asub, array(double) aval)
Replaces all elements in one row or column of A.
Assuming that there are no duplicate subscripts in asub, assignment is performed as follows:
If accmode is mosek.accmode.con, then
![]() |
and all other .
If accmode is mosek.accmode.var, then
![]() |
and all other .
If asub contains duplicates, the corresponding coefficients will be added together.
For an explanation of the meaning of ptrb and ptre see Section 5.8.3.2.
Replaces all elements in one row or column of the linear coefficient matrix.
Changes a single value in the linear coefficient matrix.
putaveclist ( mosek.accmode accmode, array(int) sub, array(long) ptrb, array(long) ptre, array(int) asub, array(double) aval)
Replaces all elements in a set of rows or columns of A.
The elements are replaced as follows.
If accmode is mosek.accmode.con, then for
![]() |
If accmode is mosek.accmode.var, then for
![]() |
If the same row or column appears multiple times only the last one will be used.
Replaces all elements in one row or column of the linear coefficient matrix.
putbound ( mosek.accmode accmode, int i, mosek.boundkey bk, double bl, double bu)
Changes the bounds for either one constraint or one variable.
If the a bound value specified is numerically larger than mosek.dparam.data_tol_bound_inf it is considered infinite and the bound key is changed accordingly. If a bound value is numerically larger than mosek.dparam.data_tol_bound_wrn, a warning will be displayed, but the bound is inputted as specified.
Changes the bounds of constraints or variables.
putboundlist ( mosek.accmode accmode, array(int) sub, array(boundkey) bk, array(double) bl, array(double) bu)
Changes the bound for either one constraint or one variable.
putboundslice ( mosek.accmode con, int first, int last, array(boundkey) bk, array(double) bl, array(double) bu)
Changes the bound for either one constraint or one variable.
putcfix (double cfix)
putcj ( int j, double cj)
Modifies one coefficient in the linear objective vector c, i.e.
![]() |
putclist ( array(int) subj, array(double) val)
Modifies elements in the linear term c in the objective using the principle
![]() |
If a variable index is specified multiple times in subj only the last entry is used.
putcone ( int k, mosek.conetype conetype, double conepar, array(int) submem)
putdouparam ( mosek.dparam param, double parvalue)
putintparam ( mosek.iparam param, int parvalue)
putmaxnumanz (long maxnumanz)
putmaxnumcon (int maxnumcon)
Sets the number of preallocated constraints in the optimization task. When this number of constraints is reached MOSEK will automatically allocate more space for constraints.
It is never mandatory to call this function, since MOSEK will reallocate any internal structures whenever it is required.
Please note that maxnumcon must be larger than the current number of constraints in the task.
putmaxnumcone (int maxnumcone)
Sets the number of preallocated conic constraints in the optimization task. When this number of conic constraints is reached MOSEK will automatically allocate more space for conic constraints.
It is never mandatory to call this function, since MOSEK will reallocate any internal structures whenever it is required.
Please note that maxnumcon must be larger than the current number of constraints in the task.
putmaxnumqnz (long maxnumqnz)
MOSEK stores only the non-zero elements in Q. Therefore, MOSEK cannot predict how much storage is required to store Q. Using this function it is possible to specify the number non-zeros to preallocate for storing Q (both objective and constraints).
It may be advantageous to reserve more non-zeros for Q than actually needed since it may improve the internal efficiency of MOSEK, however, it is never worthwhile to specify more than the double of the anticipated number of non-zeros in Q.
It is never mandatory to call this function, since its only function is to give a hint of the amount of data to preallocate for efficiency reasons.
putmaxnumvar (int maxnumvar)
Sets the number of preallocated variables in the optimization task. When this number of variables is reached MOSEK will automatically allocate more space for variables.
It is never mandatory to call this function, since its only function is to give a hint of the amount of data to preallocate for efficiency reasons.
Please note that maxnumvar must be larger than the current number of variables in the task.
putnadouparam ( str paramname, double parvalue)
putnaintparam ( str paramname, int parvalue)
putname ( mosek.problemitem whichitem, int i, str name)
putnastrparam ( str paramname, str parvalue)
putobjname (str objname)
putobjsense (mosek.objsense sense)
Gets the objective sense.
putparam ( str parname, str parvalue)
putqcon ( array(int) qcsubk, array(int) qcsubi, array(int) qcsubj, array(double) qcval)
Replaces all quadratic entries in the constraints. Consider constraints on the form:
![]() |
(14.6.26) |
The function assigns values to q such that:
![]() |
(14.6.27) |
and
![]() |
(14.6.28) |
Values not assigned are set to zero.
Please note that duplicate entries are added together.
Replaces all quadratic terms in a single constraint.
putqconk ( int k, array(int) qcsubi, array(int) qcsubj, array(double) qcval)
Replaces all the quadratic entries in one constraint k of the form:
![]() |
(14.6.29) |
It is assumed that is symmetric, i.e.
, and therefore, only the values of
for which i≥j should be inputted to MOSEK. To be precise, MOSEK uses the following procedure
![]() |
Please note that:
For a code example see Section 5.3.2.
Replaces all quadratic terms in constraints.
putqobj ( array(int) qosubi, array(int) qosubj, array(double) qoval)
Replaces all the quadratic terms in the objective
![]() |
(14.6.30) |
It is assumed that is symmetric, i.e.
, and therefore, only the values of
for which i≥j should be specified. To be precise, MOSEK uses the following procedure
![]() |
Please note that:
For a code example see Section 5.3.1.
putqobjij ( int i, int j, double qoij)
Replaces one coefficient in the quadratic term in the objective. The function performs the assignment
![]() |
Only the elements in the lower triangular part are accepted. Setting with j>i will cause an error.
Please note that replacing all quadratic element, one at a time, is more computationally expensive than replacing all elements at once. Use Task.putqobj instead whenever possible.
putsolution ( mosek.soltype whichsol, array(stakey) skc, array(stakey) skx, array(stakey) skn, array(double) xc, array(double) xx, array(double) y, array(double) slc, array(double) suc, array(double) slx, array(double) sux, array(double) snx)
putsolutioni ( mosek.accmode accmode, int i, mosek.soltype whichsol, mosek.stakey sk, double x, double sl, double su, double sn)
Sets the primal and dual solution information for a single constraint or variable.
To define a solution or a significant part of a solution, first call the Task.makesolutionstatusunknown function, then for each relevant constraint and variable call Task.putsolutioni to set the solution information.
Sets the solution status to unknown.
putsolutionyi ( int i, mosek.soltype whichsol, double y)
Sets the solution status to unknown.
Sets the primal and dual solution information for a single constraint or variable.
putstrparam ( mosek.sparam param, str parvalue)
puttaskname (str taskname)
putvarbranchorder ( int j, int priority, mosek.branchdir direction)
putvartype ( int j, mosek.variabletype vartype)
Sets the variable type for one or more variables.
putvartypelist ( array(int) subj, array(variabletype) vartype)
Sets the variable type for one or more variables, i.e. variable number is assigned the variable type
.
If the same index is specified multiple times in subj only the last entry takes effect.
Sets the variable type of one variable.
readbranchpriorities (str filename)
Writes branching priority data to a file.
readdata (str filename)
Reads an optimization data and associated data from a file.
The data file format is determined by the mosek.iparam.read_data_format parameter. By default the parameter has the value mosek.dataformat.extension indicating that the extension of the input file should determine the file type, where the extension is interpreted as follows:
Writes problem data to a file.
readparamfile ()
readsolution ( mosek.soltype whichsol, str filename)
readsummary (mosek.streamtype whichstream)
relaxedtask = relaxprimal ( array(double) wlc, array(double) wuc, array(double) wlx, array(double) wux)
Creates a problem that computes the minimal (weighted) relaxation of the bounds that will make an infeasible problem feasible.
Given an existing task describing the problem
![]() |
(14.6.31) |
the function forms a new task relaxedtask having the form
![]() |
(14.6.32) |
Hence, the function adds so-called elasticity variables to all the constraints which relax the constraints, for instance and
relax
and
respectively. It should be obvious that (14.6.32) is feasible. Moreover, the function adds the constraint
![]() |
to the problem which makes the variable p bigger than the total weighted sum of the relaxation to the bounds. ,
,
and
are user-defined weights which normally should be nonnegative. If a weight is negative, then the corresponding elasticity variable is fixed to zero.
Hence, when the problem (14.6.32) is optimized, the weighted minimal change to the bounds such that the problem is feasible is computed.
One can specify that a bound should be strictly enforced by assigning a negative value to the corresponding weight, i.e if then
is fixed to zero.
Now let be the optimal objective value to (14.6.32), then a natural thing to do is to solve the optimization problem
![]() |
(14.6.33) |
where the original objective function is minimized subject to the constraint that the total weighted relaxation is minimal.
The parameter mosek.iparam.feasrepair_optimize controls whether the function returns the problem (14.6.32) or the problem (14.6.33).The parameter can take one of the following values.
: The returned task relaxedtask contains problem (14.6.32) and is not optimized.
: The returned task relaxedtask contains problem (14.6.32) and is optimized.
: The returned task relaxedtask contains problem (14.6.33) and is optimized.
Please note that the v variables are appended to the x variables ordered as
![]() |
in the returned task.
If NAME_CON (NAME_VAR) is the name of the ith constraint (variable) then the new variables are named as follows:
where “*” can be replaced by a user-defined string by setting the mosek.sparam.feasrepair_name_separator parameter.
Please note that if or
then the feasibility repair problem becomes infeasible. Such trivial conflicts must therefore be removed manually before using Task.relaxprimal.
The above discussion shows how the function works for a linear optimization problem. However, the function also works for quadratic and conic optimization problems but it cannot be used for general nonlinear optimization problems.
remove ( mosek.accmode accmode, array(int) sub)
Appends a number of variables or constraints to the optimization task.
removecone (int k)
Removes a conic constraint from the problem. This implies that all the conic constraints appearing after cone number k are renumbered, decresing their indexes by one.
In general, it is much more efficient to remove a cone with a high index than a low index.
resizetask ( int maxnumcon, int maxnumvar, int maxnumcone, int maxnumanz, int maxnumqnz)
Sets the amount of preallocated space assigned for each type of data in an optimization task.
It is never mandatory to call this function, since its only function is to give a hint of the amount of data to preallocate for efficiency reasons.
Please note that the procedure is destructive in the sense that all existing data stored in the task is destroyed.
Sets the number of preallocated variables in the optimization task.
Sets the number of preallocated constraints in the optimization task.
Sets the number of preallocated conic constraints in the optimization task.
sensitivityreport (mosek.streamtype whichstream)
Performs sensitivity analysis on objective coefficients.
Perform sensitivity analysis on bounds.
set_Stream (mosek.streamtype whichstream)
setdefaults ()
isdef = solutiondef (mosek.soltype whichsol)
solutionsummary (mosek.streamtype whichstream)
numnz = solvewithbasis ( int transp, int numnz, array(int) sub, array(double) val)
As input it contains the positions of the non-zeros in b, i.e.
![]() |
As output it contains the positions of the non-zeros in . It is important that sub has room for numcon elements.
As input it is the vector b. Although the positions of the non-zero elements are specified in sub it is required that if b[i]=0. As output val is the vector
.
Please note that val is a dense vector — not a packed sparse vector. This implies that val has room for numcon elements.
If a basic solution is available, then exactly basis variables are defined. These
basis variables are denoted the basis. Associated with the basis is a basis matrix denoted B. This function solves either the linear equation system
![]() |
(14.6.34) |
or the system
![]() |
(14.6.35) |
for the unknowns , with b being a user-defined vector.
In order to make sense of the solution it is important to know the ordering of the variables in the basis because the ordering specifies how B is constructed. When calling Task.initbasissolve an ordering of the basis variables is obtained, whicd can be used to deduce how MOSEK has constructed B. Indeed if the kth basis variable is variable
it implies that
![]() |
Otherwise if the kth basis variable is variable it implies that`
![]() |
Given the knowledge of how B is constructed it is possible to interpret the solution correctly.
Please note that this function exploits the sparsity in the vector b to speed up the computations.
Prepare a task for basis solver.
conetype = strtoconetype (str str)
sk = strtosk (str str)
undefsolution (mosek.soltype whichsol)
writebranchpriorities (str filename)
Reads branching priority data from a file.
writedata (str filename)
Writes problem data associated with the optimization task to a file in one of four formats:
LP : A text based row oriented format. File extension .lp. See Appendix C.
MPS : A text based column oriented format. File extension .mps. See Appendix B.
OPF : A text based row oriented format. File extension .opf. Supports more problem types than MPS and LP. See Appendix D.
MBT : A binary format for fast reading and writing. File extension .mbt.
By default the data file format is determined by the file name extension. This behaviour can be overridden by setting the mosek.iparam.write_data_format parameter.
MOSEK is able to read and write files in a compressed format (gzip). To write in the compressed format append the extension ".gz". E.g to write a gzip compressed MPS file use the extension mps.gz.
Please note that MPS, LP and OPF files require all variables to have unique names. If a task contains no names, it is possible to write the file with automaticly generated anonymous names by setting the mosek.iparam.write_generic_names parameter to mosek.onoffkey.on.
Reads problem data from a file.
writeparamfile (str filename)
writesolution ( mosek.soltype whichsol, str filename)
mosek.Exception
This is an exception class representing MOSEK warnings.
Warning (mosek.rescode code)