15. API reference


This chapter lists all functionality in the MOSEK .NET API.

15.1. API Functionality

Functions in the interface grouped by functionality.

15.1.1. Analyzing the problem and associated data

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.

15.1.2. Reading and writing data files

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.

15.1.3. Solutions

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.solstatostr
Obtains a solution status string.

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.

15.1.4. Memory allocation and deallocation

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.

15.1.5. Changing problem specification

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.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.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.

15.1.6. Delete problem elements (variables,constraints,cones)

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.

15.1.7. Add problem elements (variables,constraints,cones)

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.

15.1.8. Problem inspection

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.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.

15.1.9. Conic constraints

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.

15.1.10. Bounds

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.

15.1.11. Error handling

Error handling.

mosek.Env.getcodedesc
Obtains a short description of a response code.

mosek.Env.getcodedisc
Obtains a short description of a response code.

15.1.12. Output stream functions

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.readsummary
Prints information about last file read.

mosek.Task.solutionsummary
Prints a short summary of the current solutions.

15.1.13. Objective function

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.

15.1.14. Optimizer statistics

Inspect statistics from the optimizer.

mosek.Task.getdouinf
Obtains a double information item.

mosek.Task.getinfindex
Obtains the index of a named information item.

mosek.Task.getintinf
Obtains an integer information item.

mosek.Task.getlintinf
Obtains an integer information item.

15.1.15. Parameters (set/get)

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.Env.iparvaltosymnam
Obtains the symbolic name corresponding to a value that can be assigned to an integer parameter.

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.

15.1.16. Naming

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.

15.1.17. Preallocating space for problem data

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.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.putmaxnumqnz
Changes the size of the preallocated storage for quadratic terms.

mosek.Task.putmaxnumvar
Sets the number of preallocated variables in the optimization task.

15.1.18. Integer variables

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.getvarbranchorder
Obtains the branching priority 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.

15.1.19. Quadratic terms

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.

15.1.20. Diagnosing infeasibility

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.

15.1.21. Optimization

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.

15.1.22. Network optimization

Functions for network optimization.

mosek.Task.netextraction
Finds embedded network structure.

mosek.Task.netoptimize
Optimizes a pure network flow problem.

15.1.23. Sensitivity analysis

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.

15.1.24. Testing data validity

Functions for testing data validity.

mosek.Task.checkconvexity
Checks if a quadratic optimization problem is convex.

15.1.25. Solving with the basis

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.

15.1.26. Initialization of environment

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.

15.1.27. Change A

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.

mosek.Task.putaveclist
Replaces all elements in one or more rows or columns in the linear constraint matrix by new values.

15.2. Class mosek.ArrayLengthException

Derived from:

System.Exception

Description:

This exception is raised is an input or output array was shorter than required.

15.3. Class mosek.Callback

Description:

Base class for all call-back objects used in MOSEK

15.4. Class mosek.Env

Description:

A Mosek Environment

15.4.1. Constructors

  • mosek.Env
    Syntax:

     

    public Env ()
    
    Description:
    Create a MOSEK environment object.
  • mosek.Env
    Syntax:

     

    public Env (string dbgfile)
    
    Description:
    Create a MOSEK environment object.
    Arguments:

     

    dbgfile
    A file which will be used to log memory debugging information from MOSEK

15.4.2. Methods

  • mosek.Env.checkinlicense

    Syntax:

     

    public void checkinlicense (feature feature)
    
    feature (input)
    Feature to check in to the license system.
    Description:

    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 mosek.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.

  • mosek.Env.checkoutlicense

    Syntax:

     

    public void checkoutlicense (feature feature)
    
    feature (input)
    Feature to check out from the license system.
    Description:

    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 mosek.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 mosek.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.

  • mosek.Env.echointro

    Syntax:

     

    public void echointro (int longver)
    
    longver (input)
    If non-zero, then the intro is slightly longer.
    Description:
    Prints an intro to message stream.
  • mosek.Env.getbuildinfo

    Syntax:

     

    public void getbuildinfo (
        StringBuilder buildstate,
        StringBuilder builddate,
        StringBuilder buildtool);
    
    buildstate (output)
    State of binaries, i.e. a debug, release candidate or final release.
    builddate (output)
    Date when the binaries were build.
    buildtool (output)
    Tool(s) used to build the binaries.
    Description:
    Obtains build information.
  • mosek.Env.getcodedesc

    Syntax:

     

    public void getcodedesc (
        rescode code,
        StringBuilder symname,
        StringBuilder str);
    
    code (input)
    A valid MOSEK response code.
    symname (output)
    Symbolic name corresponding to code.
    str (output)
    Obtains a short description of a response code.
    Description:
    Obtains a short description of the meaning of the response code given by code.
  • mosek.Env.getcodedisc

    Syntax:

     

    public void getcodedisc (
        rescode code,
        StringBuilder symname,
        StringBuilder str);
    
    code (input)
    A valid MOSEK response code.
    symname (output)
    Symbolic name corresponding to code.
    str (output)
    Obtains a short description of a response code.
    Description:
    Obtains a short description of the meaning of the response code given by code.
  • mosek.Env.getversion

    Syntax:

     

    public void getversion (
        out int major,
        out int minor,
        out int build,
        out int revision);
    
    major (output)
    Major version number.
    minor (output)
    Minor version number.
    build (output)
    Build number.
    revision (output)
    Revision number.
    Description:
    Obtains MOSEK version information.
  • mosek.Env.init

    Syntax:

     

    public void init ()
    
    Description:
    This function initializes the MOSEK environment. Among other things the license server will be contacted. Error messages from the license manager can be captured by linking to the environment message stream before calling this function.
  • mosek.Env.iparvaltosymnam

    Syntax:

     

    public void iparvaltosymnam (
        iparam whichparam,
        int whichvalue,
        StringBuilder symbolicname);
    
    whichparam (input)
    Which parameter.
    whichvalue (input)
    Which value.
    symbolicname (output)
    The symbolic name corresponding to whichvalue.
    Description:
    Obtains the symbolic name corresponding to a value that can be assigned to an integer parameter.
  • mosek.Env.linkfiletostream

    Syntax:

     

    public void linkfiletostream (
        streamtype whichstream,
        string filename,
        int append);
    
    whichstream (input)
    Index of the stream.
    filename (input)
    Sends all output from the stream defined by whichstream to the file given by filename.
    append (input)
    If this argument is non-zero, the output is appended to the file.
    Description:
    Directs all output from a stream to a file.
  • mosek.Env.putcpudefaults

    Syntax:

     

    public void putcpudefaults (
        int cputype,
        int sizel1,
        int sizel2);
    
    cputype (input)
    The CPU ID.
    sizel1 (input)
    Size of the L1 cache.
    sizel2 (input)
    Size of the L2 cache.
    Description:
    Sets default CPU type and cache sizes. This function should be called before mosek.Env.initenv.
  • mosek.Env.putdllpath

    Syntax:

     

    public void putdllpath (string dllpath)
    
    dllpath (input)
    A path to where the MOSEK dynamic link/shared libraries are located. If dllpath is NULL, then MOSEK assumes that the operating system can locate the libraries.
    Description:
    Sets the path to the DLL/shared libraries that MOSEK are loading. If needed, then it should normally be called before mosek.Env.initenv.
  • mosek.Env.putkeepdlls

    Syntax:

     

    public void putkeepdlls (int keepdlls)
    
    keepdlls (input)
    Controls whether explicitly loaded DLLs should be kept.
    Description:
    Controls whether explicitly loaded DLLs should be kept when they no longer are in use.
  • mosek.Env.putlicensedefaults

    Syntax:

     

    public void putlicensedefaults (
        string licensefile,
        int[] licensebuf,
        int licwait,
        int licdebug);
    
    licensefile (input)
    Either NULL or the path to a valid MOSEK license file.
    licensebuf (input)
    This is the license string authorizing the use of MOSEK in the runtime version of MOSEK. Therefore, most frequently this string is a NULL pointer.
    licwait (input)
    If this argument is non-zero, then MOSEK will wait for a license if no license is available. Moreover, licwait-1 is the number of milliseconds to wait between each check for an available license.
    licdebug (input)
    If this argument is non-zero, then MOSEK will print debug info regarding the license checkout.
    Description:
    Sets default values for the license manager. This function should be called before mosek.Env.initenv.
  • mosek.Env.set_Stream

    Syntax:

     

    public void set_Stream (
        streamtype whichstream,
        Stream stream);
    
    whichstream
    Index of the stream.
    stream
    The stream object to attach. To detach all objects, let this be null.
    Description:
    Attach a stream call-back handler.

15.5. Class mosek.Error

Derived from:

mosek.Exception

Description:

This is an exception class representing MOSEK errors.

15.5.1. Constructors

  • mosek.Error
    Syntax:

     

    public Error (rescode code)
    
    Description:
    Construct an error from a MOSEK error code.
    Arguments:

     

    code
    The MOSEK response code to create the exception from.
  • mosek.Error
    Syntax:

     

    public Error (
        rescode code,
        string msg);
    
    Description:
    Construct an error from a MOSEK error code and a message.
    Arguments:

     

    code
    The MOSEK response code to create the exception from.
    msg
    A message describing the error situation.

15.6. Class mosek.Exception

Derived from:

System.Exception

Description:

This is the base class for exceptions based on MOSEK response codes.

15.6.1. Constructors

  • mosek.Exception
    Syntax:

     

    public Exception (rescode code)
    
    Description:
    Construct an exception from a MOSEK error code.
    Arguments:

     

    code
    The MOSEK response code to create the exception from.

15.7. Class mosek.Progress

Derived from:

mosek.Callback

Description:

This is the base class for user-defined progress call-back objects. An object of this type can be attached to a MOSEK task in order to receive frequent calls with a progress indicator during long optimizations. The calls are received by overriding a certain member of this class.

The call-back method is called at the beginning of each iteration in the interior-point optimizer. For the simplex optimizers the parameter mosek.iparam.log_sim_freq controls how frequent the call-backs are.

Typically, the user-defined call-back method displays information about the solution process. The call-back function can also be used to terminate the optimization process: If the method returns a non-zero value when called, MOSEK will abort optimization and perform proper cleanup of the task.

It is important that the user-defined call-back function does not modify the optimization task, this will lead to undefined behavior and incorrect results. The only MOSEK functions that can be called safely from within the user-defined call-back function are mosek.Task.getdouinf and mosek.Task.getintinf which access the task information database. The items in task information database are updated during the optimization process.

15.7.1. Constructors

  • mosek.Progress
    Syntax:

     

    public Progress ()
    
    Description:
    Construct a Progress object.

15.7.2. Methods

  • mosek.Progress.progress

    Syntax:

     

    public CType(int) progress (callbackcode caller)
    
    caller
    A value indicating the point from where the function was called.
    Description:
    The method called during optimization. Override this function to receive the progress indicators.

15.8. Class mosek.Stream

Derived from:

mosek.Callback

Description:

Base class for stream printer classes which can be attached to MOSEK tasks and environments to intercept output.

15.8.1. Constructors

  • mosek.Stream
    Syntax:

     

    public Stream ()
    
    Description:
    Construct a MOSEK Stream printer object.

15.8.2. Methods

  • mosek.Stream.stream

    Syntax:

     

    public void stream (string str)
    
    str
    A string to be outputted.
    Description:
    The method which receives output strings from MOSEK.

15.9. Class mosek.Task

Description:

A Mosek Optimization task

15.9.1. Constructors

  • mosek.Task
    Syntax:

     

    public Task (
        Env env,
        int maxnumcon,
        int maxnumvar);
    
    Description:
    Create a new MOSEK task and reserve space for constraints and variables. Please note that it is perfectly legal to specify 0 constraint or 0 variables: The values may be specified later with mosek.Task.putmaxnumcon and mosek.Task.putmaxnumvar. Even without doing so, the task will automatically resize when exceeding the maximum, but if this happens often, there will be some overhead when resizing.
    Arguments:

     

    env
    The environment the task should belong to.
    maxnumcon
    Initially reserve space for this many constraints.
    maxnumvar
    Initially reserve space for this many variables.

15.9.2. Attributes

  • mosek.Progress ProgressCB (write only) Progress call-back object

15.9.3. Methods

  • mosek.Task.analyzeproblem

    Syntax:

     

    public void analyzeproblem (streamtype whichstream)
    
    whichstream (input)
    Index of the stream.
    Description:
    The function analyze the data of task and writes out a report.
  • mosek.Task.analyzesolution

    Syntax:

     

    public void analyzesolution (
        streamtype whichstream,
        soltype whichsol);
    
    whichstream (input)
    Index of the stream.
    whichsol (input)
    Selects a solution.
    Description:

    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:

    • mosek.iparam.ana_sol_basis. Enables or disables printing of statistics specific to the basis solution (condition number, number of basic variables etc.). Default is on.
    • mosek.iparam.ana_sol_print_violated. Enables or disables listing names of all constraints (both primal and dual) which are violated by the solution. Default is off.
    • mosek.dparam.ana_sol_infeas_tol. The tolerance defining when a constraint is considered violated. If a constraint is violated more than this, it will be listed in the summary.
    See also:

     

    mosek.Task.getpeqi

    Obtains the primal equation infeasibility.

    mosek.Task.getdeqi

    Optains the dual equation infeasibility.

    mosek.Task.getpbi

    Obtains the primal bound infeasibility.

    mosek.Task.getdbi

    Obtains the dual bound infeasibility.

    mosek.Task.getdcni

    Obtains the dual cone infeasibility.

    mosek.Task.getpcni

    Obtains the primal cone infeasibility.

    mosek.Task.getsolutioninf

    Obtains information about a solution.

    mosek.Task.getsolutionstatus

    Obtains information about the problem and solution statuses.

  • mosek.Task.append

    Syntax:

     

    public void append (
        accmode accmode,
        int num);
    
    accmode (input)
    Defines if operations are performed row-wise (constraint-oriented) or column-wise (variable-oriented).
    num (input)
    Number of constraints or variables which should be appended.
    Description:
    Appends a number of constraints or variables to the model. Appended constraints will be declared free and appended variables will be fixed at the level zero. Please note that MOSEK will automatically expand the problem dimension to accommodate the additional constraints and variables.
    See also:

     

    mosek.Task.remove

    The function removes a number of constraints or variables.

  • mosek.Task.appendcone

    Syntax:

     

    public void appendcone (
        conetype conetype,
        double conepar,
        int[] submem);
    
    conetype (input)
    Specifies the type of the cone.
    conepar (input)
    This argument is currently not used. Can be set to 0.0.
    submem (input)
    Variable subscripts of the members in the cone.
    Syntax:

     

    public void appendcone (
        conetype conetype,
        double conepar,
        int nummem,
        int[] submem);
    
    conetype (input)
    Specifies the type of the cone.
    conepar (input)
    This argument is currently not used. Can be set to 0.0.
    nummem (input)
    Number of member variables in the cone.
    submem (input)
    Variable subscripts of the members in the cone.
    Description:

    Appends a new conic constraint to the problem. Hence, add a constraint

    \begin{displaymath}\nonumber{}\bar{x}\in{}\mathcal{C}\end{displaymath}

    to the problem where [[MathCmd 57]] is a convex cone. [[MathCmd 420]] 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

    \begin{displaymath}\nonumber{}\bar{x}=x_{{\mathtt{submem}[0]}},\ldots ,x_{{\mathtt{submem}[\mathtt{nummem}-1]}}\end{displaymath}

    . Depending on the value of conetype this function appends one of the constraints:

    Please note that the sets of variables appearing in different conic constraints must be disjoint.

    For an explained code example see Section 5.4.

  • mosek.Task.basiscond

    Syntax:

     

    public void basiscond (
        out double nrmbasis,
        out double nrminvbasis);
    
    nrmbasis (output)
    An estimate for the 1 norm of the basis.
    nrminvbasis (output)
    An estimate for the 1 norm of the inverse of the basis.
    Description:

    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

    \begin{displaymath}\nonumber{}\kappa _{1}(B):=\left\|B\right\|_{1}\left\|B^{{-1}}\right\|.\end{displaymath}

    Moreover, the larger the condition number is the harder it is to solve linear equation systems involving B. Given estimates for [[MathCmd 702]] and [[MathCmd 703]] it is also possible to estimate [[MathCmd 704]].

  • mosek.Task.checkconvexity

    Syntax:

     

    public void checkconvexity ()
    
    Description:

    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.

    See also:

     

    mosek.iparam.check_convexity
  • mosek.Task.checkdata

    Syntax:

     

    public void checkdata ()
    
    Description:
    Checks the data of the optimization task.
  • mosek.Task.checkmem

    Syntax:

     

    public void checkmem (
        string file,
        int line);
    
    file (input)
    File from which the function is called.
    line (input)
    Line in the file from which the function is called.
    Description:
    Checks the memory allocated by the task.
  • mosek.Task.chgbound

    Syntax:

     

    public void chgbound (
        accmode accmode,
        int i,
        int lower,
        int finite,
        double value);
    
    accmode (input)
    Defines if operations are performed row-wise (constraint-oriented) or column-wise (variable-oriented).
    i (input)
    Index of the constraint or variable for which the bounds should be changed.
    lower (input)
    If non-zero, then the lower bound is changed, otherwise the upper bound is changed.
    finite (input)
    If non-zero, then value is assumed to be finite.
    value (input)
    New value for the bound.
    Description:

    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:

    \begin{displaymath}\nonumber{}\mbox{new lower bound}=\left\lbrace{}\begin{array}{ll}\nonumber{}-\infty , & \mathtt{finite}=0,\\\nonumber{}\mathtt{value} & \mbox{otherwise}.\end{array}\right.\end{displaymath}

    Otherwise if lower is zero, then

    \begin{displaymath}\nonumber{}\mbox{new upper bound}=\left\lbrace{}\begin{array}{ll}\nonumber{}\infty , & \mathtt{finite}=0,\\\nonumber{}\mathtt{value} & \mbox{otherwise}.\end{array}\right.\end{displaymath}

    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.

    See also:

     

    mosek.Task.putbound

    Changes the bound for either one constraint or one variable.

    mosek.dparam.data_tol_bound_inf
    mosek.dparam.data_tol_bound_wrn
  • mosek.Task.commitchanges

    Syntax:

     

    public void commitchanges ()
    
    Description:
    Commits all cached problem changes to the task. It is usually not necessary explicitly to call this function since changes will be committed automatically when required.
  • mosek.Task.deletesolution

    Syntax:

     

    public void deletesolution (soltype whichsol)
    
    whichsol (input)
    Selects a solution.
    Description:
    Undefines a solution and frees the memory it uses.
  • mosek.Task.dualsensitivity

    Syntax:

     

    public void dualsensitivity (
        int[] subj,
        double[] leftpricej,
        double[] rightpricej,
        double[] leftrangej,
        double[] rightrangej);
    
    subj (input)
    Index of objective coefficients to analyze.
    leftpricej (output)
    [[MathCmd 707]] is the left shadow price for the coefficients with index [[MathCmd 708]].
    rightpricej (output)
    [[MathCmd 709]] is the right shadow price for the coefficients with index [[MathCmd 708]].
    leftrangej (output)
    [[MathCmd 711]] is the left range [[MathCmd 633]] for the coefficient with index [[MathCmd 708]].
    rightrangej (output)
    [[MathCmd 714]] is the right range [[MathCmd 634]] for the coefficient with index [[MathCmd 708]].
    Description:

    Calculates sensitivity information for objective coefficients. The indexes of the coefficients to analyze are

    \begin{displaymath}\nonumber{}\lbrace{}\mathtt{subj}[i]|i\in{}0,\ldots ,\mathtt{numj}-1\rbrace{}\end{displaymath}

    The results are returned so that e.g [[MathCmd 718]] is the left shadow price of the objective coefficient with index [[MathCmd 719]].

    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.

    See also:

     

    mosek.Task.primalsensitivity

    Perform sensitivity analysis on bounds.

    mosek.Task.sensitivityreport

    Creates a sensitivity report.

    mosek.iparam.sensitivity_type
    mosek.iparam.log_sensitivity
    mosek.iparam.log_sensitivity_opt
  • mosek.Task.getaij

    Syntax:

     

    public double getaij (
        int i,
        int j);
    
    i (input)
    Row index of the coefficient to be returned.
    j (input)
    Column index of the coefficient to be returned.
    Syntax:

     

    public void getaij (
        int i,
        int j,
        out double aij);
    
    i (input)
    Row index of the coefficient to be returned.
    j (input)
    Column index of the coefficient to be returned.
    aij (output)
    The required coefficient [[MathCmd 720]].
    Description:
    Obtains a single coefficient in A.
  • mosek.Task.getapiecenumnz

    Syntax:

     

    public int getapiecenumnz (
        int firsti,
        int lasti,
        int firstj,
        int lastj);
    
    firsti (input)
    Index of the first row in the rectangular piece.
    lasti (input)
    Index of the last row plus one in the rectangular piece.
    firstj (input)
    Index of the first column in the rectangular piece.
    lastj (input)
    Index of the last column plus one in the rectangular piece.
    Syntax:

     

    public void getapiecenumnz (
        int firsti,
        int lasti,
        int firstj,
        int lastj,
        out int numnz);
    
    firsti (input)
    Index of the first row in the rectangular piece.
    lasti (input)
    Index of the last row plus one in the rectangular piece.
    firstj (input)
    Index of the first column in the rectangular piece.
    lastj (input)
    Index of the last column plus one in the rectangular piece.
    numnz (output)
    Number of non-zero A elements in the rectangular piece.
    Description:

    Obtains the number non-zeros in a rectangular piece of A, i.e. the number

    \begin{displaymath}\nonumber{}\left|\lbrace{}(i,j):~a_{{i,j}}\not=0,~\mathtt{firsti}\leq{}i\leq{}\mathtt{lasti}-1,~\mathtt{firstj}\leq{}j\leq{}\mathtt{lastj}-1\rbrace{}\right|\end{displaymath}

    where [[MathCmd 722]] means the number of elements in the set [[MathCmd 723]].

    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 mosek.Task.getavecnumnz.

    See also:

     

    mosek.Task.getavecnumnz

    Obtains the number of non-zero elements in one row or column of the linear constraint matrix

    mosek.Task.getaslicenumnz

    Obtains the number of non-zeros in a row or column slice of the coefficient matrix.

  • mosek.Task.getaslice

    Syntax:

     

    public void getaslice (
        accmode accmode,
        int first,
        int last,
        ref int surp,
        int[] ptrb,
        int[] ptre,
        int[] sub,
        double[] val);
    
    accmode (input)
    Defines whether a column-slice or a row-slice is requested.
    first (input)
    Index of the first row or column in the sequence.
    last (input)
    Index of the last row or column in the sequence plus one.
    surp (input/output)
    The required rows and columns are stored sequentially in sub and val starting from position maxnumnz-surp[0]. Upon return surp has been decremented by the total number of non-zero elements in the rows and columns obtained.
    ptrb (output)
    ptrb[t] is an index pointing to the first element in the tth row or column obtained.
    ptre (output)
    ptre[t] is an index pointing to the last element plus one in the tth row or column obtained.
    sub (output)
    Contains the row or column subscripts.
    val (output)
    Contains the coefficient values.
    Description:
    Obtains a sequence of rows or columns from A in sparse format.
    See also:

     

    mosek.Task.getaslicenumnz

    Obtains the number of non-zeros in a row or column slice of the coefficient matrix.

  • mosek.Task.getaslice

    Syntax:

     

    public void getaslice (
        accmode accmode,
        int first,
        int last,
        ref long surp,
        long[] ptrb,
        long[] ptre,
        int[] sub,
        double[] val);
    
    accmode (input)
    Defines whether a column slice or a row slice is requested.
    first (input)
    Index of the first row or column in the sequence.
    last (input)
    Index of the last row or column in the sequence plus one.
    surp (input/output)
    The required rows and columns are stored sequentially in sub and val starting from position maxnumnz-surp[0]. Upon return surp has been decremented by the total number of non-zero elements in the rows and columns obtained.
    ptrb (output)
    ptrb[t] is an index pointing to the first element in the tth row or column obtained.
    ptre (output)
    ptre[t] is an index pointing to the last element plus one in the tth row or column obtained.
    sub (output)
    Contains the row or column subscripts.
    val (output)
    Contains the coefficient values.
    Description:
    Obtains a sequence of rows or columns from A in sparse format.
    See also:

     

    mosek.Task.getaslicenumnz64

    Obtains the number of non-zeros in a slice of rows or columns of the coefficient matrix.

  • mosek.Task.getaslicenumnz

    Syntax:

     

    public void getaslicenumnz (
        accmode accmode,
        int first,
        int last,
        out int numnz);
    
    accmode (input)
    Defines whether non-zeros are counted in a column-slice or a row-slice.
    first (input)
    Index of the first row or column in the sequence.
    last (input)
    Index of the last row or column plus one in the sequence.
    numnz (output)
    Number of non-zeros in the slice.
    Description:
    Obtains the number of non-zeros in a row or column slice of A.
  • mosek.Task.getaslicenumnz

    Syntax:

     

    public long getaslicenumnz (
        accmode accmode,
        int first,
        int last);
    
    accmode (input)
    Defines whether non-zeros are counted in a column slice or a row slice.
    first (input)
    Index of the first row or column in the sequence.
    last (input)
    Index of the last row or column plus one in the sequence.
    Syntax:

     

    public void getaslicenumnz (
        accmode accmode,
        int first,
        int last,
        out long numnz);
    
    accmode (input)
    Defines whether non-zeros are counted in a column slice or a row slice.
    first (input)
    Index of the first row or column in the sequence.
    last (input)
    Index of the last row or column plus one in the sequence.
    numnz (output)
    Number of non-zeros in the slice.
    Description:
    Obtains the number of non-zeros in a slice of rows or columns of A.
  • mosek.Task.getaslicetrip

    Syntax:

     

    public void getaslicetrip (
        accmode accmode,
        int first,
        int last,
        ref int surp,
        int[] subi,
        int[] subj,
        double[] val);
    
    accmode (input)
    Defines whether a column-slice or a row-slice is requested.
    first (input)
    Index of the first row or column in the sequence.
    last (input)
    Index of the last row or column in the sequence plus one.
    surp (input/output)
    The required rows and columns are stored sequentially in subi and val starting from position maxnumnz-surp[0]. On return surp has been decremented by the total number of non-zero elements in the rows and columns obtained.
    subi (output)
    Constraint subscripts.
    subj (output)
    Variable subscripts.
    val (output)
    Values.
    Description:
    Obtains a sequence of rows or columns from A in a sparse triplet format.
    See also:

     

    mosek.Task.getaslicenumnz

    Obtains the number of non-zeros in a row or column slice of the coefficient matrix.

  • mosek.Task.getavec

    Syntax:

     

    public void getavec (
        accmode accmode,
        int i,
        out int nzi,
        int[] subi,
        double[] vali);
    
    accmode (input)
    Defines if operations are performed row-wise (constraint-oriented) or column-wise (variable-oriented).
    i (input)
    Index of the row or column.
    nzi (output)
    Number of non-zeros in the vector obtained.
    subi (output)
    Index of the non-zeros in the vector obtained.
    vali (output)
    Numerical values of the vector to be obtained.
    Description:

    Obtains one row or column of A in a sparse format. If accmode equals mosek.accmode.con a row is returned and hence:

    \begin{displaymath}\nonumber{}\mathtt{vali}[k]=a_{{i,\mathtt{subi}[k]}},\quad{}k=0,\ldots ,\mathtt{nzi[0]}-1\end{displaymath}

    If accmode equals mosek.accmode.var a column is returned, that is:

    \begin{displaymath}\nonumber{}\mathtt{vali}[k]=a_{{\mathtt{subi}[k],i}},\quad{}k=0,\ldots ,\mathtt{nzi[0]}-1.\end{displaymath}
  • mosek.Task.getavecnumnz

    Syntax:

     

    public int getavecnumnz (
        accmode accmode,
        int i);
    
    accmode (input)
    Defines whether non-zeros are counted by columns or by rows.
    i (input)
    Index of the row or column.
    Syntax:

     

    public void getavecnumnz (
        accmode accmode,
        int i,
        out int nzj);
    
    accmode (input)
    Defines whether non-zeros are counted by columns or by rows.
    i (input)
    Index of the row or column.
    nzj (output)
    Number of non-zeros in the ith row or column of A.
    Description:
    Obtains the number of non-zero elements in one row or column of A.
  • mosek.Task.getbound

    Syntax:

     

    public void getbound (
        accmode accmode,
        int i,
        out boundkey bk,
        out double bl,
        out double bu);
    
    accmode (input)
    Defines if operations are performed row-wise (constraint-oriented) or column-wise (variable-oriented).
    i (input)
    Index of the constraint or variable for which the bound information should be obtained.
    bk (output)
    Bound keys.
    bl (output)
    Values for lower bounds.
    bu (output)
    Values for upper bounds.
    Description:
    Obtains bound information for one constraint or variable.
  • mosek.Task.getboundslice

    Syntax:

     

    public void getboundslice (
        accmode accmode,
        int first,
        int last,
        boundkey[] bk,
        double[] bl,
        double[] bu);
    
    accmode (input)
    Defines if operations are performed row-wise (constraint-oriented) or column-wise (variable-oriented).
    first (input)
    First index in the sequence.
    last (input)
    Last index plus 1 in the sequence.
    bk (output)
    Bound keys.
    bl (output)
    Values for lower bounds.
    bu (output)
    Values for upper bounds.
    Description:
    Obtains bounds information for a sequence of variables or constraints.
  • mosek.Task.getc

    Syntax:

     

    public void getc (double[] c)
    
    c (output)
    Linear terms of the objective as a dense vector. The lengths is the number of variables.
    Description:
    Obtains all objective coefficients c.
  • mosek.Task.getcfix

    Syntax:

     

    public double getcfix ()
    
    Syntax:

     

    public void getcfix (out double cfix)
    
    cfix (output)
    Fixed term in the objective.
    Description:
    Obtains the fixed term in the objective.
  • mosek.Task.getcone

    Syntax:

     

    public void getcone (
        int k,
        out conetype conetype,
        out double conepar,
        out int nummem,
        int[] submem);
    
    k (input)
    Index of the cone constraint.
    conetype (output)
    Specifies the type of the cone.
    conepar (output)
    This argument is currently not used. Can be set to 0.0.
    nummem (output)
    Number of member variables in the cone.
    submem (output)
    Variable subscripts of the members in the cone.
    Description:
    Obtains a conic constraint.
  • mosek.Task.getconeinfo

    Syntax:

     

    public void getconeinfo (
        int k,
        out conetype conetype,
        out double conepar,
        out int nummem);
    
    k (input)
    Index of the conic constraint.
    conetype (output)
    Specifies the type of the cone.
    conepar (output)
    This argument is currently not used. Can be set to 0.0.
    nummem (output)
    Number of member variables in the cone.
    Description:
    Obtains information about a conic constraint.
  • mosek.Task.getconname

    Syntax:

     

    public string getconname (int i)
    
    i (input)
    Index.
    Syntax:

     

    public void getconname (
        int i,
        StringBuilder name);
    
    i (input)
    Index.
    name (output)
    Is assigned the required name.
    Description:
    Obtains a name of a constraint.
  • mosek.Task.getcslice

    Syntax:

     

    public void getcslice (
        int first,
        int last,
        double[] c);
    
    first (input)
    First index in the sequence.
    last (input)
    Last index plus 1 in the sequence.
    c (output)
    Linear terms of the objective as a dense vector. The lengths is the number of variables.
    Description:
    Obtains a sequence of elements in c.
  • mosek.Task.getdbi

    Syntax:

     

    public void getdbi (
        soltype whichsol,
        accmode accmode,
        int[] sub,
        double[] dbi);
    
    whichsol (input)
    Selects a solution.
    accmode (input)
    If set to mosek.accmode.con then sub contains constraint indexes, otherwise variable indexes.
    sub (input)
    Indexes of constraints or variables.
    dbi (output)

    Dual bound infeasibility. If acmode is mosek.accmode.con then

    \begin{math}\nonumber{}{dbi}[i]=\max (-(s_{l}^{c})_{{{sub}[i]}},-(s_{u}^{c})_{{{sub}[i]}},0)\quad{}\mathtt{for}\quad{}i=0,\ldots ,{len-1}\end{math} (15.9.1)

    else

    \begin{math}\nonumber{}{dbi}[i]=\max (-(s_{l}^{x})_{{{sub}[i]}},-(s_{u}^{x})_{{{sub}[i]}},0)\quad{}\mathtt{for}\quad{}i=0,\ldots ,{len-1}.\end{math} (15.9.2)
    Description:
    Obtains the dual bound infeasibility.
    See also:

     

    mosek.Task.getsolutioninf

    Obtains information about a solution.

  • mosek.Task.getdcni

    Syntax:

     

    public void getdcni (
        soltype whichsol,
        int[] sub,
        double[] dcni);
    
    whichsol (input)
    Selects a solution.
    sub (input)
    Constraint indexes to calculate equation infeasibility for.
    dcni (output)
    dcni[i] contains dual cone infeasibility for the cone with index sub[i].
    Description:
    Obtains the dual cone infeasibility.
    See also:

     

    mosek.Task.getsolutioninf

    Obtains information about a solution.

  • mosek.Task.getdeqi

    Syntax:

     

    public void getdeqi (
        soltype whichsol,
        accmode accmode,
        int[] sub,
        double[] deqi,
        int normalize);
    
    whichsol (input)
    Selects a solution.
    accmode (input)
    If set to mosek.accmode.con the dual equation infeasibilitys corresponding to constraints are retrieved. Otherwise for a variables.
    sub (input)
    Indexes of constraints or variables.
    deqi (output)
    Dual equation infeasibilitys corresponding to constraints or variables.
    normalize (input)
    If non-zero, normalize with largest absolute value of the input data used to compute the individual infeasibility.
    Description:

    Optains the dual equation infeasibility. If acmode is mosek.accmode.con then

    \begin{math}\nonumber{}{pbi}[i]=\left|(-y+s_{l}^{c}-s_{u}^{c})_{{{sub}[i]}}\right|\quad{}\mathtt{for}\quad{}i=0,\ldots ,{len-1}\end{math} (15.9.3)

    If acmode is mosek.accmode.var then

    \begin{math}\nonumber{}{pbi}[i]=\left|(A^{T}y+s_{l}^{x}-s_{u}^{x}-c)_{{{sub}[i]}}\right|\quad{}\mathtt{for}\quad{}i=0,\ldots ,{len-1}\end{math} (15.9.4)
    See also:

     

    mosek.Task.getsolutioninf

    Obtains information about a solution.

  • mosek.Task.getdouinf

    Syntax:

     

    public double getdouinf (dinfitem whichdinf)
    
    whichdinf (input)
    A double information item. See section 18.13 for the possible values.
    Syntax:

     

    public void getdouinf (
        dinfitem whichdinf,
        out double dvalue);
    
    whichdinf (input)
    A double information item. See section 18.13 for the possible values.
    dvalue (output)
    The value of the required double information item.
    Description:
    Obtains a double information item from the task information database.
  • mosek.Task.getdouparam

    Syntax:

     

    public double getdouparam (dparam param)
    
    param (input)
    Which parameter.
    Syntax:

     

    public void getdouparam (
        dparam param,
        out double parvalue);
    
    param (input)
    Which parameter.
    parvalue (output)
    Parameter value.
    Description:
    Obtains the value of a double parameter.
  • mosek.Task.getdualobj

    Syntax:

     

    public void getdualobj (
        soltype whichsol,
        out double dualobj);
    
    whichsol (input)
    Selects a solution.
    dualobj (output)
    Objective value corresponding to the dual solution.
    Description:
    Obtains the current objective value of the dual problem for whichsol.
  • mosek.Task.getinfeasiblesubproblem

    Syntax:

     

    public Task getinfeasiblesubproblem (soltype whichsol)
    
    whichsol (input)
    Which solution to use when determining the infeasible subproblem.
    Syntax:

     

    public void getinfeasiblesubproblem (
        soltype whichsol,
        out Task inftask);
    
    whichsol (input)
    Which solution to use when determining the infeasible subproblem.
    inftask (output)
    A new task containing the infeasible subproblem.
    Description:
    Obtains an infeasible subproblem. The infeasible subproblem is a problem consisting of a subset of the original constraints such that the problem is still infeasible. For more information see Section 10.2.
    See also:

     

    mosek.iparam.infeas_prefer_primal
    mosek.Task.relaxprimal

    Creates a problem that finds the minimal change to the bounds that makes an infeasible problem feasible.

  • mosek.Task.getinfindex

    Syntax:

     

    public void getinfindex (
        inftype inftype,
        string infname,
        out int infindex);
    
    inftype (input)
    Type of the information item.
    infname (input)
    Name of the information item.
    infindex (output)
    The item index.
    Description:
    Obtains the index of a named information item.
  • mosek.Task.getinti

    Syntax:

     

    public void getinti (
        soltype whichsol,
        int[] sub,
        double[] inti);
    
    whichsol (input)
    Selects a solution.
    sub (input)
    Variable indexes for which to calculate the integer infeasibility.
    inti (output)
    inti[i] contains integer infeasibility of variable sub[i].
    Description:

    Obtains the primal equation infeasibility.

    \begin{math}\nonumber{}{peqi}[i]=\left|(\right|(Ax-x^{c})_{{{sub}[i]}})\quad{}\mathtt{for}\quad{}i=0,\ldots ,{len}-1.\end{math} (15.9.5)
    See also:

     

    mosek.Task.getsolutioninf

    Obtains information about a solution.

  • mosek.Task.getintinf

    Syntax:

     

    public int getintinf (iinfitem whichiinf)
    
    whichiinf (input)
    Specifies an information item.
    Syntax:

     

    public void getintinf (
        iinfitem whichiinf,
        out int ivalue);
    
    whichiinf (input)
    Specifies an information item.
    ivalue (output)
    The value of the required integer information item.
    Description:
    Obtains an integer information item from the task information database.
  • mosek.Task.getintparam

    Syntax:

     

    public int getintparam (iparam param)
    
    param (input)
    Which parameter.
    Syntax:

     

    public void getintparam (
        iparam param,
        out int parvalue);
    
    param (input)
    Which parameter.
    parvalue (output)
    Parameter value.
    Description:
    Obtains the value of an integer parameter.
  • mosek.Task.getintpntnumthreads

    Syntax:

     

    public int getintpntnumthreads ()
    
    Syntax:

     

    public void getintpntnumthreads (out int numthreads)
    
    numthreads (output)
    The number of threads.
    Description:
    Obtains the number of threads used by the interior-point optimizer. If mosek.iparam.intpnt_num_threads is set to zero this function will return the number of cores on the system. Otherwise it return the value of mosek.iparam.intpnt_num_threads.
  • mosek.Task.getlintinf

    Syntax:

     

    public long getlintinf (liinfitem whichliinf)
    
    whichliinf (input)
    Specifies an information item.
    Syntax:

     

    public void getlintinf (
        liinfitem whichliinf,
        out long ivalue);
    
    whichliinf (input)
    Specifies an information item.
    ivalue (output)
    The value of the required integer information item.
    Description:
    Obtains an integer information item from the task information database.
  • mosek.Task.getmaxnumanz

    Syntax:

     

    public long getmaxnumanz ()
    
    Syntax:

     

    public void getmaxnumanz (out long maxnumanz)
    
    maxnumanz (output)
    Number of preallocated non-zero elements in A.
    Description:
    Obtains number of preallocated non-zeros in A. When this number of non-zeros is reached MOSEK will automatically allocate more space for A.
  • mosek.Task.getmaxnumcon

    Syntax:

     

    public void getmaxnumcon (out int maxnumcon)
    
    maxnumcon (output)
    Number of preallocated constraints in the optimization task.
    Description:
    Obtains the number of preallocated constraints in the optimization task. When this number of constraints is reached MOSEK will automatically allocate more space for constraints.
  • mosek.Task.getmaxnumcone

    Syntax:

     

    public void getmaxnumcone (out int maxnumcone)
    
    maxnumcone (output)
    Number of preallocated conic constraints in the optimization task.
    Description:
    Obtains the number of preallocated cones in the optimization task. When this number of cones is reached MOSEK will automatically allocate space for more cones.
  • mosek.Task.getmaxnumqnz

    Syntax:

     

    public void getmaxnumqnz (out long maxnumqnz)
    
    maxnumqnz (output)
    Number of non-zero elements preallocated in quadratic coefficient matrices.
    Description:
    Obtains the number of preallocated non-zeros for Q (both objective and constraints). When this number of non-zeros is reached MOSEK will automatically allocate more space for Q.
  • mosek.Task.getmaxnumvar

    Syntax:

     

    public void getmaxnumvar (out int maxnumvar)
    
    maxnumvar (output)
    Number of preallocated variables in the optimization task.
    Description:
    Obtains the number of preallocated variables in the optimization task. When this number of variables is reached MOSEK will automatically allocate more space for constraints.
  • mosek.Task.getmemusage

    Syntax:

     

    public void getmemusage (
        out long meminuse,
        out long maxmemuse);
    
    meminuse (output)
    Amount of memory currently used by the task.
    maxmemuse (output)
    Maximum amount of memory used by the task until now.
    Description:
    Obtains information about the amount of memory used by a task.
  • mosek.Task.getname

    Syntax:

     

    public string getname (
        problemitem whichitem,
        int i,
        out long len);
    
    whichitem (input)
    Problem item, i.e. a cone, a variable or a constraint name..
    i (input)
    Index.
    len (output)
    Is assigned the length of the required name.
    Syntax:

     

    public void getname (
        problemitem whichitem,
        int i,
        out long len,
        StringBuilder name);
    
    whichitem (input)
    Problem item, i.e. a cone, a variable or a constraint name..
    i (input)
    Index.
    len (output)
    Is assigned the length of the required name.
    name (output)
    Is assigned the required name.
    Description:
    Obtains a name of a problem item, i.e. a cone, a variable or a constraint.
  • mosek.Task.getname

    Syntax:

     

    public string getname (
        problemitem whichitem,
        int i);
    
    whichitem (input)
    Problem item, i.e. a cone, a variable or a constraint name..
    i (input)
    Index.
    Syntax:

     

    public void getname (
        problemitem whichitem,
        int i,
        StringBuilder name);
    
    whichitem (input)
    Problem item, i.e. a cone, a variable or a constraint name..
    i (input)
    Index.
    name (output)
    Is assigned the required name.
    Description:
    Obtains a name of a problem item, i.e. a cone, a variable or a constraint.
  • mosek.Task.getnameindex

    Syntax:

     

    public int getnameindex (
        problemitem whichitem,
        string name,
        out int asgn);
    
    whichitem (input)
    Problem item, i.e. a cone, a variable or a constraint name..
    name (input)
    The name which should be checked.
    asgn (output)
    Is non-zero if name is assigned.
    Syntax:

     

    public void getnameindex (
        problemitem whichitem,
        string name,
        out int asgn,
        out int index);
    
    whichitem (input)
    Problem item, i.e. a cone, a variable or a constraint name..
    name (input)
    The name which should be checked.
    asgn (output)
    Is non-zero if name is assigned.
    index (output)
    If the name identifies an item in the task, then index is assigned the index of that item.
    Description:
    Checks if a given name identifies a cone, a constraint or a variable in the task. If it does, the index of that item is assigned to index, and a non-zero value is assigned to asgn. If the name does not identify a problem item, asgn is assigned a zero.
  • mosek.Task.getnamelen

    Syntax:

     

    public long getnamelen (
        problemitem whichitem,
        int i);
    
    whichitem (input)
    Problem item, i.e. a cone, a variable or a constraint name..
    i (input)
    Index.
    Syntax:

     

    public void getnamelen (
        problemitem whichitem,
        int i,
        out long len);
    
    whichitem (input)
    Problem item, i.e. a cone, a variable or a constraint name..
    i (input)
    Index.
    len (output)
    Is assigned the length of the required name.
    Description:
    Obtains the length of a problem item name.
    See also:

     

    mosek.Task.getname64

    Obtains the name of a cone, a variable or a constraint.

  • mosek.Task.getnumanz

    Syntax:

     

    public int getnumanz ()
    
    Syntax:

     

    public void getnumanz (out int numanz)
    
    numanz (output)
    Number of non-zero elements in A.
    Description:
    Obtains the number of non-zeros in A.
  • mosek.Task.getnumanz64

    Syntax:

     

    public long getnumanz64 ()
    
    Syntax:

     

    public void getnumanz64 (out long numanz)
    
    numanz (output)
    Number of non-zero elements in A.
    Description:
    Obtains the number of non-zeros in A.
  • mosek.Task.getnumcon

    Syntax:

     

    public int getnumcon ()
    
    Syntax:

     

    public void getnumcon (out int numcon)
    
    numcon (output)
    Number of constraints.
    Description:
    Obtains the number of constraints.
  • mosek.Task.getnumcone

    Syntax:

     

    public int getnumcone ()
    
    Syntax:

     

    public void getnumcone (out int numcone)
    
    numcone (output)
    Number conic constraints.
    Description:
    Obtains the number of cones.
  • mosek.Task.getnumconemem

    Syntax:

     

    public void getnumconemem (
        int k,
        out int nummem);
    
    k (input)
    Index of the cone.
    nummem (output)
    Number of member variables in the cone.
    Description:
    Obtains the number of members in a cone.
  • mosek.Task.getnumintvar

    Syntax:

     

    public void getnumintvar (out int numintvar)
    
    numintvar (output)
    Number of integer variables.
    Description:
    Obtains the number of integer-constrained variables.
  • mosek.Task.getnumparam

    Syntax:

     

    public void getnumparam (
        parametertype partype,
        out int numparam);
    
    partype (input)
    Parameter type.
    numparam (output)
    Identical to the number of parameters of the type partype.
    Description:
    Obtains the number of parameters of a given type.
  • mosek.Task.getnumqconknz

    Syntax:

     

    public int getnumqconknz (int k)
    
    k (input)
    Index of the constraint for which the number of non-zero quadratic terms should be obtained.
    Syntax:

     

    public void getnumqconknz (
        int k,
        out int numqcnz);
    
    k (input)
    Index of the constraint for which the number of non-zero quadratic terms should be obtained.
    numqcnz (output)
    Number of quadratic terms. See (5.8.4).
    Description:
    Obtains the number of non-zero quadratic terms in a constraint.
  • mosek.Task.getnumqconknz64

    Syntax:

     

    public long getnumqconknz64 (int k)
    
    k (input)
    Index of the constraint for which the number quadratic terms should be obtained.
    Syntax:

     

    public void getnumqconknz64 (
        int k,
        out long numqcnz);
    
    k (input)
    Index of the constraint for which the number quadratic terms should be obtained.
    numqcnz (output)
    Number of quadratic terms. See (5.8.4).
    Description:
    Obtains the number of non-zero quadratic terms in a constraint.
  • mosek.Task.getnumqobjnz

    Syntax:

     

    public int getnumqobjnz ()
    
    Syntax:

     

    public void getnumqobjnz (out int numqonz)
    
    numqonz (output)
    Number of non-zero elements in [[MathCmd 31]].
    Description:
    Obtains the number of non-zero quadratic terms in the objective.
  • mosek.Task.getnumqobjnz64

    Syntax:

     

    public long getnumqobjnz64 ()
    
    Syntax:

     

    public void getnumqobjnz64 (out long numqonz)
    
    numqonz (output)
    Number of non-zero elements in [[MathCmd 31]].
    Description:
    Obtains the number of non-zero quadratic terms in the objective.
  • mosek.Task.getnumvar

    Syntax:

     

    public int getnumvar ()
    
    Syntax:

     

    public void getnumvar (out int numvar)
    
    numvar (output)
    Number of variables.
    Description:
    Obtains the number of variables.
  • mosek.Task.getobjname

    Syntax:

     

    public string getobjname (out long len)
    
    len (output)
    Assigned the length of the objective name.
    Syntax:

     

    public void getobjname (
        out long len,
        StringBuilder objname);
    
    len (output)
    Assigned the length of the objective name.
    objname (output)
    Assigned the objective name.
    Description:
    Obtains the name assigned to the objective function.
  • mosek.Task.getobjsense

    Syntax:

     

    public objsense getobjsense ()
    
    Syntax:

     

    public void getobjsense (out objsense sense)
    
    sense (output)
    The returned objective sense.
    Description:
    Gets the objective sense of the task.
    See also:

     

    mosek.Task.putobjsense

    Sets the objective sense.

  • mosek.Task.getpbi

    Syntax:

     

    public void getpbi (
        soltype whichsol,
        accmode accmode,
        int[] sub,
        double[] pbi,
        int normalize);
    
    whichsol (input)
    Selects a solution.
    accmode (input)
    If set to mosek.accmode.var return bound infeasibility for x otherwise for [[MathCmd 200]].
    sub (input)
    An array of constraint or variable indexes.
    pbi (output)
    Bound infeasibility for x or [[MathCmd 200]].
    normalize (input)
    If non-zero, normalize with largest absolute value of the input data used to compute the individual infeasibility.
    Description:

    Obtains the primal bound infeasibility. If acmode is mosek.accmode.con then

    \begin{math}\nonumber{}{pbi}[i]=\max (x^{c}_{{{sub[i]}}}-u^{c}_{{{sub[i]}}},l^{c}_{{{sub[i]}}}-x^{c}_{{{sub[i]}}},0)\quad{}\mathtt{for}\quad{}i=0,\ldots ,{len-1}\end{math} (15.9.6)

    If acmode is mosek.accmode.var then

    \begin{math}\nonumber{}{pbi}[i]=\max (x_{{{sub[i]}}}-u^{x}_{{{sub[i]}}},l^{x}_{{{sub[i]}}}-x_{{{sub[i]}}},0)\quad{}\mathtt{for}\quad{}i=0,\ldots ,{len-1}\end{math} (15.9.7)
    See also:

     

    mosek.Task.getsolutioninf

    Obtains information about a solution.

  • mosek.Task.getpcni

    Syntax:

     

    public void getpcni (
        soltype whichsol,
        int[] sub,
        double[] pcni);
    
    whichsol (input)
    Selects a solution.
    sub (input)
    Constraint indexes for which to calculate the equation infeasibility.
    pcni (output)
    pcni[i] contains primal cone infeasibility for the cone with index sub[i].
    Description:
    Obtains the primal cone infeasibility.
    See also:

     

    mosek.Task.getsolutioninf

    Obtains information about a solution.

  • mosek.Task.getpeqi

    Syntax:

     

    public void getpeqi (
        soltype whichsol,
        int[] sub,
        double[] peqi,
        int normalize);
    
    whichsol (input)
    Selects a solution.
    sub (input)
    Constraint indexes for which to calculate the equation infeasibility.
    peqi (output)
    peqi[i] contains equation infeasibility of constraint sub[i].
    normalize (input)
    If non-zero, normalize with largest absolute value of the input data used to compute the individual infeasibility.
    Description:

    Obtains the primal equation infeasibility.

    \begin{math}\nonumber{}{peqi}[i]=\left|(\right|(Ax-x^{c})_{{{sub}[i]}})\quad{}\mathtt{for}\quad{}i=0,\ldots ,{len}-1.\end{math} (15.9.8)
    See also:

     

    mosek.Task.getsolutioninf

    Obtains information about a solution.

  • mosek.Task.getprimalobj

    Syntax:

     

    public double getprimalobj (soltype whichsol)
    
    whichsol (input)
    Selects a solution.
    Syntax:

     

    public void getprimalobj (
        soltype whichsol,
        out double primalobj);
    
    whichsol (input)
    Selects a solution.
    primalobj (output)
    Objective value corresponding to the primal solution.
    Description:
    Obtains the primal objective value for a solution.
  • mosek.Task.getprobtype

    Syntax:

     

    public problemtype getprobtype ()
    
    Syntax:

     

    public void getprobtype (out problemtype probtype)
    
    probtype (output)
    The problem type.
    Description:
    Obtains the problem type.
  • mosek.Task.getqconk

    Syntax:

     

    public int getqconk (
        int k,
        ref int qcsurp,
        int[] qcsubi,
        int[] qcsubj,
        double[] qcval);
    
    k (input)
    Which constraint.
    qcsurp (input/output)
    When entering the function it is assumed that the last qcsurp[0] positions in qcsubi, qcsubj, and qcval are free. Hence, the quadratic terms are stored in this area, and upon return qcsurp is number of free positions left in qcsubi, qcsubj, and qcval.
    qcsubi (output)
    i subscripts for [[MathCmd 89]]. See (5.8.4).
    qcsubj (output)
    j subscripts for [[MathCmd 89]]. See (5.8.4).
    qcval (output)
    Numerical value for [[MathCmd 89]].
    Syntax:

     

    public void getqconk (
        int k,
        ref int qcsurp,
        out int numqcnz,
        int[] qcsubi,
        int[] qcsubj,
        double[] qcval);
    
    k (input)
    Which constraint.
    qcsurp (input/output)
    When entering the function it is assumed that the last qcsurp[0] positions in qcsubi, qcsubj, and qcval are free. Hence, the quadratic terms are stored in this area, and upon return qcsurp is number of free positions left in qcsubi, qcsubj, and qcval.
    numqcnz (output)
    Number of quadratic terms. See (5.8.4).
    qcsubi (output)
    i subscripts for [[MathCmd 89]]. See (5.8.4).
    qcsubj (output)
    j subscripts for [[MathCmd 89]]. See (5.8.4).
    qcval (output)
    Numerical value for [[MathCmd 89]].
    Description:
    Obtains all the quadratic terms in a constraint. The quadratic terms are stored sequentially qcsubi, qcsubj, and qcval.
  • mosek.Task.getqconk64

    Syntax:

     

    public long getqconk64 (
        int k,
        ref long qcsurp,
        int[] qcsubi,
        int[] qcsubj,
        double[] qcval);
    
    k (input)
    Which constraint.
    qcsurp (input/output)
    When entering the function it is assumed that the last qcsurp[0] positions in qcsubi, qcsubj, and qcval are free. Hence, the quadratic terms are stored in this area, and upon return qcsurp is number of free positions left in qcsubi, qcsubj, and qcval.
    qcsubi (output)
    i subscripts for [[MathCmd 89]]. See (5.8.4).
    qcsubj (output)
    j subscripts for [[MathCmd 89]]. See (5.8.4).
    qcval (output)
    Numerical value for [[MathCmd 89]].
    Syntax:

     

    public void getqconk64 (
        int k,
        ref long qcsurp,
        out long numqcnz,
        int[] qcsubi,
        int[] qcsubj,
        double[] qcval);
    
    k (input)
    Which constraint.
    qcsurp (input/output)
    When entering the function it is assumed that the last qcsurp[0] positions in qcsubi, qcsubj, and qcval are free. Hence, the quadratic terms are stored in this area, and upon return qcsurp is number of free positions left in qcsubi, qcsubj, and qcval.
    numqcnz (output)
    Number of quadratic terms. See (5.8.4).
    qcsubi (output)
    i subscripts for [[MathCmd 89]]. See (5.8.4).
    qcsubj (output)
    j subscripts for [[MathCmd 89]]. See (5.8.4).
    qcval (output)
    Numerical value for [[MathCmd 89]].
    Description:
    Obtains all the quadratic terms in a constraint. The quadratic terms are stored sequentially qcsubi, qcsubj, and qcval.
  • mosek.Task.getqobj

    Syntax:

     

    public void getqobj (
        ref int qosurp,
        out int numqonz,
        int[] qosubi,
        int[] qosubj,
        double[] qoval);
    
    qosurp (input/output)
    When entering the function qosurp[0] is the number of free positions at the end of the arrays qosubi, qosubj, and qoval, and upon return qosurp is the updated number of free positions left in those arrays.
    numqonz (output)
    Number of non-zero elements in [[MathCmd 31]].
    qosubi (output)
    i subscript for [[MathCmd 83]].
    qosubj (output)
    j subscript for [[MathCmd 83]].
    qoval (output)
    Numerical value for [[MathCmd 83]].
    Description:
    Obtains the quadratic terms in the objective. The required quadratic terms are stored sequentially in qosubi, qosubj, and qoval.
  • mosek.Task.getqobj64

    Syntax:

     

    public void getqobj64 (
        ref long qosurp,
        out long numqonz,
        int[] qosubi,
        int[] qosubj,
        double[] qoval);
    
    qosurp (input/output)
    When entering the function qosurp[0] is the number of free positions at the end of the arrays qosubi, qosubj, and qoval, and upon return qosurp is the updated number of free positions left in those arrays.
    numqonz (output)
    Number of non-zero elements in [[MathCmd 31]].
    qosubi (output)
    i subscript for [[MathCmd 83]].
    qosubj (output)
    j subscript for [[MathCmd 83]].
    qoval (output)
    Numerical value for [[MathCmd 83]].
    Description:
    Obtains the quadratic terms in the objective. The required quadratic terms are stored sequentially in qosubi, qosubj, and qoval.
  • mosek.Task.getqobjij

    Syntax:

     

    public void getqobjij (
        int i,
        int j,
        out double qoij);
    
    i (input)
    Row index of the coefficient.
    j (input)
    Column index of coefficient.
    qoij (output)
    The required coefficient.
    Description:
    Obtains one coefficient [[MathCmd 83]] in the quadratic term of the objective.
  • mosek.Task.getreducedcosts

    Syntax:

     

    public void getreducedcosts (
        soltype whichsol,
        int first,
        int last,
        double[] redcosts);
    
    whichsol (input)
    Selects a solution.
    first (input)
    See formula (15.9.9) for the definition.
    last (input)
    See formula (15.9.9) for the definition.
    redcosts (output)
    The reduced costs in the required sequence of variables are stored sequentially in redcosts starting at redcosts[0].
    Description:

    Computes the reduced costs for a sequence of variables and return them in the variable redcosts i.e.

    \begin{math}\nonumber{}\mathtt{redcosts}[j-\mathtt{first}]=(s_{l}^{x})_{j}-(s_{u}^{x})_{j},~j=\mathtt{first},\ldots ,\mathtt{last}-1.\end{math} (15.9.9)
  • mosek.Task.getsolution

    Syntax:

     

    public void getsolution (
        soltype whichsol,
        out prosta prosta,
        out solsta solsta,
        stakey[] skc,
        stakey[] skx,
        stakey[] skn,
        double[] xc,
        double[] xx,
        double[] y,
        double[] slc,
        double[] suc,
        double[] slx,
        double[] sux,
        double[] snx);
    
    whichsol (input)
    Selects a solution.
    prosta (output)
    Problem status.
    solsta (output)
    Solution status.
    skc (output)
    Status keys for the constraints.
    skx (output)
    Status keys for the variables.
    skn (output)
    Status keys for the conic constraints.
    xc (output)
    Primal constraint solution.
    xx (output)
    Primal variable solution (x).
    y (output)
    Vector of dual variables corresponding to the constraints.
    slc (output)
    Dual variables corresponding to the lower bounds on the constraints ([[MathCmd 760]]).
    suc (output)
    Dual variables corresponding to the upper bounds on the constraints ([[MathCmd 761]]).
    slx (output)
    Dual variables corresponding to the lower bounds on the variables ([[MathCmd 762]]).
    sux (output)
    Dual variables corresponding to the upper bounds on the variables (appears as [[MathCmd 763]]).
    snx (output)
    Dual variables corresponding to the conic constraints on the variables ([[MathCmd 764]]).
    Description:

    Obtains the complete solution.

    Consider the case of linear programming. The primal problem is given by

    \begin{math}\nonumber{}\begin{array}{lccccl}\nonumber{}\mbox{minimize} &  &  & c^{T}x+c^{f} &  & \\\nonumber{}\mbox{subject to} & l^{c} & \leq{} & Ax & \leq{} & u^{c},\\\nonumber{} & l^{x} & \leq{} & x & \leq{} & u^{x}.\end{array}\end{math} (15.9.10)

    and the corresponding dual problem is

    \begin{math}\nonumber{}\begin{array}{lccl}\nonumber{}\mbox{maximize} & (l^{c})^{T}s_{l}^{c}-(u^{c})^{T}s_{u}^{c} &  & \\\nonumber{} & +(l^{x})^{T}s_{l}^{x}-(u^{x})^{T}s_{u}^{x}+c^{f} &  & \\\nonumber{}\mbox{subject to} & A^{T}y+s_{l}^{x}-s_{u}^{x} & = & c,\\\nonumber{} & -y+s_{l}^{c}-s_{u}^{c} & = & 0,\\\nonumber{} & s_{l}^{c},s_{u}^{c},s_{l}^{x},s_{u}^{x}\geq{}0. &  &\end{array}\end{math} (15.9.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 [[MathCmd 760]].

    suc: Corresponds to variable [[MathCmd 761]].

    slx: Corresponds to variable [[MathCmd 762]].

    sux: Corresponds to variable [[MathCmd 763]].

    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.

    See also:

     

    mosek.Task.getsolutioni

    Obtains the solution for a single constraint or variable.

    mosek.Task.getsolutionslice

    Obtains a slice of the solution.

  • mosek.Task.getsolutioni

    Syntax:

     

    public void getsolutioni (
        accmode accmode,
        int i,
        soltype whichsol,
        out stakey sk,
        out double x,
        out double sl,
        out double su,
        out double sn);
    
    accmode (input)
    If set to mosek.accmode.con the solution information for a constraint is retrieved. Otherwise for a variable.
    i (input)
    Index of the constraint or variable.
    whichsol (input)
    Selects a solution.
    sk (output)
    Status key of the constraint of variable.
    x (output)
    Solution value of the primal variable.
    sl (output)
    Solution value of the dual variable associated with the lower bound.
    su (output)
    Solution value of the dual variable associated with the upper bound.
    sn (output)
    Solution value of the dual variable associated with the cone constraint.
    Description:
    Obtains the primal and dual solution information for a single constraint or variable.
    See also:

     

    mosek.Task.getsolution

    Obtains the complete solution.

    mosek.Task.getsolutionslice

    Obtains a slice of the solution.

  • mosek.Task.getsolutioninf

    Syntax:

     

    public void getsolutioninf (
        soltype whichsol,
        out prosta prosta,
        out solsta solsta,
        out double primalobj,
        out double maxpbi,
        out double maxpcni,
        out double maxpeqi,
        out double maxinti,
        out double dualobj,
        out double maxdbi,
        out double maxdcni,
        out double maxdeqi);
    
    whichsol (input)
    Selects a solution.
    prosta (output)
    Problem status.
    solsta (output)
    Solution status.
    primalobj (output)

    Value of the primal objective.

    \begin{math}\nonumber{}c^{T}x+c^{f}\end{math} (15.9.12)
    maxpbi (output)

    Maximum infeasibility in primal bounds on variables.

    \begin{math}\nonumber{}\max \left\lbrace{}0,\max _{{i\in{}{1,\ldots ,n-1}}}(x_{i}-u^{x}_{i}),\max _{{i\in{}{1,\ldots ,n-1}}}(l^{x}_{i}-x_{i}),\max _{{i\in{}{1,\ldots ,n-1}}}(x^{c}_{i}-u^{c}_{i}),\max _{{i\in{}{1,\ldots ,n-1}}}(l^{c}_{i}-x^{c}_{i})\right\rbrace{}\end{math} (15.9.13)
    maxpcni (output)
    Maximum infeasibility in the primal conic constraints.
    maxpeqi (output)

    Maximum infeasibility in primal equality constraints.

    \begin{math}\nonumber{}\left\|Ax-x^{c}\right\|_{\infty }\end{math} (15.9.14)
    maxinti (output)

    Maximum infeasibility in integer constraints.

    \begin{math}\nonumber{}\max _{{i\in{}\lbrace{}0,\ldots ,n-1\rbrace{}}}(\min (x_{i}-\lfloor x_{i}\rfloor ,\lceil x_{i}\rceil -x_{i})).\end{math} (15.9.15)
    dualobj (output)

    Value of the dual objective.

    \begin{math}\nonumber{}(l^{c})^{T}s_{l}^{c}-(u^{c})^{T}s_{u}^{c}+c^{f}\end{math} (15.9.16)
    maxdbi (output)

    Maximum infeasibility in bounds on dual variables.

    \begin{math}\nonumber{}\max \lbrace{}0,\max _{{i\in{}\lbrace{}0,\ldots ,n-1\rbrace{}}}-(s_{l}^{x})_{i},\max _{{i\in{}\lbrace{}0,\ldots ,n-1\rbrace{}}}-(s_{u}^{x})_{i},\max _{{i\in{}\lbrace{}0,\ldots ,m-1\rbrace{}}}-(s_{l}^{c})_{i},\max _{{i\in{}\lbrace{}0,\ldots ,m-1\rbrace{}}}-(s_{u}^{c})_{i}\rbrace{}\end{math} (15.9.17)
    maxdcni (output)
    Maximum infeasibility in the dual conic constraints.
    maxdeqi (output)

    Maximum infeasibility in the dual equality constraints.

    \begin{math}\nonumber{}\max \left\lbrace{}\left\|A^{T}y+s_{l}^{x}-s_{u}^{x}-c\right\|_{\infty },\left\|-y+s_{l}^{c}-s_{u}^{c}\right\|_{\infty }\right\rbrace{}\end{math} (15.9.18)
    Description:

    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.

    \begin{math}\nonumber{}\begin{array}{lccccl}\nonumber{}\mbox{minimize} &  &  & c^{T}x+c^{f} &  & \\\nonumber{}\mbox{subject to} &  &  & Ax-x^{c} & = & 0\\\nonumber{} & l^{x} & \leq{} & x & \leq{} & u^{x},\\\nonumber{} & l^{c} & \leq{} & x^{c} & \leq{} & u^{c}.\end{array}\end{math} (15.9.19)

    where

    \begin{displaymath}\nonumber{}x^{c}\in{}\mathbb{R}^{{m}}\mbox{ and }x\in{}\mathbb{R}^{n}.\end{displaymath}

    and the corresponding dual problem is

    \begin{math}\nonumber{}\begin{array}{lccl}\nonumber{}\mbox{maximize} & (l^{c})^{T}s_{l}^{c}-(u^{c})^{T}s_{u}^{c}+c^{f} &  & \\\nonumber{} & +(l^{x})^{T}s_{l}^{x}-(u^{x})^{T}s_{u}^{x}+c^{f} &  & \\\nonumber{}\mbox{subject to} & A^{T}y+s_{l}^{x}-s_{u}^{x} & = & c,\\\nonumber{} & -y+s_{l}^{c}-s_{u}^{c} & = & 0,\\\nonumber{} & s_{l}^{c},s_{u}^{c},s_{l}^{x},s_{u}^{x}\geq{}0. &  &\end{array}\end{math} (15.9.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 mosek.Task.getsolutionstatus instead.

    See also:

     

    mosek.Task.getpeqi

    Obtains the primal equation infeasibility.

    mosek.Task.getdeqi

    Optains the dual equation infeasibility.

    mosek.Task.getpbi

    Obtains the primal bound infeasibility.

    mosek.Task.getdbi

    Obtains the dual bound infeasibility.

    mosek.Task.getdcni

    Obtains the dual cone infeasibility.

    mosek.Task.getpcni

    Obtains the primal cone infeasibility.

    mosek.Task.analyzesolution

    Print information related to the quality of the solution.

    mosek.Task.getsolutionstatus

    Obtains information about the problem and solution statuses.

  • mosek.Task.getsolutionslice

    Syntax:

     

    public void getsolutionslice (
        soltype whichsol,
        solitem solitem,
        int first,
        int last,
        double[] values);
    
    whichsol (input)
    Selects a solution.
    solitem (input)
    Which part of the solution is required.
    first (input)
    Index of the first value in the slice.
    last (input)
    Value of the last index+1 in the slice, e.g. if [[MathCmd 781]] is required last should be 10.
    values (output)
    The values in the required sequence are stored sequentially in values starting at values[0].
    Description:

    Obtains a slice of the solution.

    Consider the case of linear programming. The primal problem is given by

    \begin{math}\nonumber{}\begin{array}{lccccl}\nonumber{}\mbox{minimize} &  &  & c^{T}x+c^{f} &  & \\\nonumber{}\mbox{subject to} & l^{c} & \leq{} & Ax & \leq{} & u^{c},\\\nonumber{} & l^{x} & \leq{} & x & \leq{} & u^{x}.\end{array}\end{math} (15.9.21)

    and the corresponding dual problem is

    \begin{math}\nonumber{}\begin{array}{lccl}\nonumber{}\mbox{maximize} & (l^{c})^{T}s_{l}^{c}-(u^{c})^{T}s_{u}^{c} &  & \\\nonumber{} & +(l^{x})^{T}s_{l}^{x}-(u^{x})^{T}s_{u}^{x}+c^{f} &  & \\\nonumber{}\mbox{subject to} & A^{T}y+s_{l}^{x}-s_{u}^{x} & = & c,\\\nonumber{} & -y+s_{l}^{c}-s_{u}^{c} & = & 0,\\\nonumber{} & s_{l}^{c},s_{u}^{c},s_{l}^{x},s_{u}^{x}\geq{}0. &  &\end{array}\end{math} (15.9.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 [[MathCmd 760]].

    mosek.solitem.suc: The variable values return [[MathCmd 761]].

    mosek.solitem.slx: The variable values return [[MathCmd 762]].

    mosek.solitem.sux: The variable values return [[MathCmd 763]].

    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:

    \begin{math}\nonumber{}\begin{array}{lccccc}\nonumber{}\mbox{maximize} & (l^{c})^{T}s_{l}^{c}-(u^{c})^{T}s_{u}^{c} &  & \\\nonumber{} & +(l^{x})^{T}s_{l}^{x}-(u^{x})^{T}s_{u}^{x}+c^{f} &  & \\\nonumber{}\mbox{subject to} & A^{T}y+s_{l}^{x}-s_{u}^{x}+s_{n}^{x} & = & c,\\\nonumber{} & -y+s_{l}^{c}-s_{u}^{c} & = & 0,\\\nonumber{} & s_{l}^{c},s_{u}^{c},s_{l}^{x},s_{u}^{x} & \geq{} & 0,\\\nonumber{} & s_{n}^{x}\in{}\mathcal{C}^{*} &  &\end{array}\end{math} (15.9.23)

    This introduces one additional dual variable [[MathCmd 764]]. 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 mosek.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.

    See also:

     

    mosek.Task.getsolution

    Obtains the complete solution.

    mosek.Task.getsolutioni

    Obtains the solution for a single constraint or variable.

  • mosek.Task.getsolutionstatus

    Syntax:

     

    public void getsolutionstatus (
        soltype whichsol,
        out prosta prosta,
        out solsta solsta);
    
    whichsol (input)
    Selects a solution.
    prosta (output)
    Problem status.
    solsta (output)
    Solution status.
    Description:
    Obtains information about the problem and solution statuses.
  • mosek.Task.getsolutionstatuskeyslice

    Syntax:

     

    public void getsolutionstatuskeyslice (
        accmode accmode,
        soltype whichsol,
        int first,
        int last,
        stakey[] sk);
    
    accmode (input)
    Defines if operations are performed row-wise (constraint-oriented) or column-wise (variable-oriented).
    whichsol (input)
    Selects a solution.
    first (input)
    Index of the first value in the slice.
    last (input)
    Value of the last index+1 in the slice, e.g. if [[MathCmd 781]] is required last should be 10.
    sk (output)
    The status keys in the required sequence are stored sequentially in sk starting at sk[0].
    Description:
    Obtains a slice of the solution status keys.
    See also:

     

    mosek.Task.getsolution

    Obtains the complete solution.

    mosek.Task.getsolutioni

    Obtains the solution for a single constraint or variable.

  • mosek.Task.gettaskname64

    Syntax:

     

    public string gettaskname64 (out long len)
    
    len (output)
    Is assigned the length of the task name.
    Syntax:

     

    public void gettaskname64 (
        out long len,
        StringBuilder taskname);
    
    len (output)
    Is assigned the length of the task name.
    taskname (output)
    Is assigned the task name.
    Description:
    Obtains the name assigned to the task.
  • mosek.Task.getvarbranchdir

    Syntax:

     

    public int getvarbranchdir (int j)
    
    j (input)
    Index of the variable.
    Syntax:

     

    public void getvarbranchdir (
        int j,
        out int direction);
    
    j (input)
    Index of the variable.
    direction (output)
    The branching direction assigned to variable j.
    Description:
    Obtains the branching direction for a given variable j.
  • mosek.Task.getvarbranchorder

    Syntax:

     

    public void getvarbranchorder (
        int j,
        out int priority,
        out int direction);
    
    j (input)
    Index of the variable.
    priority (output)
    The branching priority assigned to variable j.
    direction (output)
    The preferred branching direction for the j'th variable.
    Description:
    Obtains the branching priority and direction for a given variable j.
  • mosek.Task.getvarbranchpri

    Syntax:

     

    public int getvarbranchpri (int j)
    
    j (input)
    Index of the variable.
    Syntax:

     

    public void getvarbranchpri (
        int j,
        out int priority);
    
    j (input)
    Index of the variable.
    priority (output)
    The branching priority assigned to variable j.
    Description:
    Obtains the branching priority for a given variable j.
  • mosek.Task.getvarname

    Syntax:

     

    public string getvarname (int i)
    
    i (input)
    Index.
    Syntax:

     

    public void getvarname (
        int i,
        StringBuilder name);
    
    i (input)
    Index.
    name (output)
    Is assigned the required name.
    Description:
    Obtains a name of a variable.
  • mosek.Task.getvartype

    Syntax:

     

    public variabletype getvartype (int j)
    
    j (input)
    Index of the variable.
    Syntax:

     

    public void getvartype (
        int j,
        out variabletype vartype);
    
    j (input)
    Index of the variable.
    vartype (output)
    Variable type of variable j.
    Description:
    Gets the variable type of one variable.
  • mosek.Task.getvartypelist

    Syntax:

     

    public void getvartypelist (
        int[] subj,
        variabletype[] vartype);
    
    subj (input)
    A list of variable indexes.
    vartype (output)
    The variables types corresponding to the variables specified by subj.
    Description:

    Obtains the variable type of one or more variables.

    Upon return vartype[k] is the variable type of variable subj[k].

  • mosek.Task.initbasissolve

    Syntax:

     

    public void initbasissolve (int[] basis)
    
    basis (output)

    The array of basis indexes to use.

    The array is interpreted as follows: If [[MathCmd 791]], then [[MathCmd 792]] is in the basis at position i, otherwise [[MathCmd 793]] is in the basis at position i.

    Description:

    Prepare a task for use with the mosek.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.

  • mosek.Task.inputdata

    Syntax:

     

    public void inputdata (
        int maxnumcon,
        int maxnumvar,
        double[] c,
        double cfix,
        int[] aptrb,
        int[] aptre,
        int[] asub,
        double[] aval,
        boundkey[] bkc,
        double[] blc,
        double[] buc,
        boundkey[] bkx,
        double[] blx,
        double[] bux);
    
    maxnumcon (input)
    Number of preallocated constraints in the optimization task.
    maxnumvar (input)
    Number of preallocated variables in the optimization task.
    c (input)
    Linear terms of the objective as a dense vector. The lengths is the number of variables.
    cfix (input)
    Fixed term in the objective.
    aptrb (input)
    Pointer to the first element in the rows or the columns of A. See (5.8.5) and Section 5.8.3.
    aptre (input)
    Pointers to the last element + 1 in the rows or the columns of A. See (5.8.5) and Section 5.8.3
    asub (input)
    Coefficient subscripts. See (5.8.5) and Section 5.8.3.
    aval (input)
    Coefficient values. See (5.8.5) and Section 5.8.3.
    bkc (input)
    Bound keys for the constraints.
    blc (input)
    Lower bounds for the constraints.
    buc (input)
    Upper bounds for the constraints.
    bkx (input)
    Bound keys for the variables.
    blx (input)
    Lower bounds for the variables.
    bux (input)
    Upper bounds for the variables.
    Description:

    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.

  • mosek.Task.inputdata

    Syntax:

     

    public void inputdata (
        int maxnumcon,
        int maxnumvar,
        double[] c,
        double cfix,
        long[] aptrb,
        long[] aptre,
        int[] asub,
        double[] aval,
        boundkey[] bkc,
        double[] blc,
        double[] buc,
        boundkey[] bkx,
        double[] blx,
        double[] bux);
    
    maxnumcon (input)
    Number of preallocated constraints in the optimization task.
    maxnumvar (input)
    Number of preallocated variables in the optimization task.
    c (input)
    Linear terms of the objective as a dense vector. The lengths is the number of variables.
    cfix (input)
    Fixed term in the objective.
    aptrb (input)
    Pointer to the first element in the rows or the columns of A. See (5.8.5) and Section 5.8.3.
    aptre (input)
    Pointers to the last element + 1 in the rows or the columns of A. See (5.8.5) and Section 5.8.3
    asub (input)
    Coefficient subscripts. See (5.8.5) and Section 5.8.3.
    aval (input)
    Coefficient values. See (5.8.5) and Section 5.8.3.
    bkc (input)
    Bound keys for the constraints.
    blc (input)
    Lower bounds for the constraints.
    buc (input)
    Upper bounds for the constraints.
    bkx (input)
    Bound keys for the variables.
    blx (input)
    Lower bounds for the variables.
    bux (input)
    Upper bounds for the variables.
    Syntax:

     

    public void inputdata (
        int maxnumcon,
        int maxnumvar,
        int numcon,
        int numvar,
        double[] c,
        double cfix,
        long[] aptrb,
        long[] aptre,
        int[] asub,
        double[] aval,
        boundkey[] bkc,
        double[] blc,
        double[] buc,
        boundkey[] bkx,
        double[] blx,
        double[] bux);
    
    maxnumcon (input)
    Number of preallocated constraints in the optimization task.
    maxnumvar (input)
    Number of preallocated variables in the optimization task.
    numcon (input)
    Number of constraints.
    numvar (input)
    Number of variables.
    c (input)
    Linear terms of the objective as a dense vector. The lengths is the number of variables.
    cfix (input)
    Fixed term in the objective.
    aptrb (input)
    Pointer to the first element in the rows or the columns of A. See (5.8.5) and Section 5.8.3.
    aptre (input)
    Pointers to the last element + 1 in the rows or the columns of A. See (5.8.5) and Section 5.8.3
    asub (input)
    Coefficient subscripts. See (5.8.5) and Section 5.8.3.
    aval (input)
    Coefficient values. See (5.8.5) and Section 5.8.3.
    bkc (input)
    Bound keys for the constraints.
    blc (input)
    Lower bounds for the constraints.
    buc (input)
    Upper bounds for the constraints.
    bkx (input)
    Bound keys for the variables.
    blx (input)
    Lower bounds for the variables.
    bux (input)
    Upper bounds for the variables.
    Description:

    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.

  • mosek.Task.isdouparname

    Syntax:

     

    public void isdouparname (
        string parname,
        out dparam param);
    
    parname (input)
    Parameter name.
    param (output)
    Which parameter.
    Description:
    Checks whether parname is a valid double parameter name.
  • mosek.Task.isintparname

    Syntax:

     

    public void isintparname (
        string parname,
        out iparam param);
    
    parname (input)
    Parameter name.
    param (output)
    Which parameter.
    Description:
    Checks whether parname is a valid integer parameter name.
  • mosek.Task.isstrparname

    Syntax:

     

    public void isstrparname (
        string parname,
        out sparam param);
    
    parname (input)
    Parameter name.
    param (output)
    Which parameter.
    Description:
    Checks whether parname is a valid string parameter name.
  • mosek.Task.linkfiletostream

    Syntax:

     

    public void linkfiletostream (
        streamtype whichstream,
        string filename,
        int append);
    
    whichstream (input)
    Index of the stream.
    filename (input)
    The name of the file where text from the stream defined by whichstream is written.
    append (input)
    If this argument is 0 the output file will be overwritten, otherwise text is append to the output file.
    Description:
    Directs all output from a task stream to a file.
  • mosek.Task.makesolutionstatusunknown

    Syntax:

     

    public void makesolutionstatusunknown (soltype whichsol)
    
    whichsol (input)
    Selects a solution.
    Description:
    Sets the solution status to unknown. Also all the status keys for the constraints and the variables are set to unknown.
  • mosek.Task.netextraction

    Syntax:

     

    public void netextraction (
        out int numcon,
        out int numvar,
        int[] netcon,
        int[] netvar,
        double[] scalcon,
        double[] scalvar,
        double[] cx,
        boundkey[] bkc,
        double[] blc,
        double[] buc,
        boundkey[] bkx,
        double[] blx,
        double[] bux,
        int[] from,
        int[] to);
    
    numcon (output)
    Number of network constraints (nodes) in the embedded network.
    numvar (output)
    Number of network variables (arcs) in the embedded network.
    netcon (output)
    Indexes of network constraints (nodes) in the embedded network.
    netvar (output)
    Indexes of network variables (arcs) in the embedded network.
    scalcon (output)
    Scaling values on constraints, used to convert the original part of the problem into network form.
    scalvar (output)
    Scaling values on variables, used to convert the original part of the problem into network form.
    cx (output)
    Linear terms of the objective for variables (arcs) in the embedded network as a dense vector.
    bkc (output)
    Bound keys for the constraints (nodes) in the embedded network.
    blc (output)
    Lower bounds for the constraints (nodes) in the embedded network.
    buc (output)
    Upper bounds for the constraints (nodes) in the embedded network.
    bkx (output)
    Bound keys for the variables (arcs) in the embedded network.
    blx (output)
    Lower bounds for the variables (arcs) in the embedded network.
    bux (output)
    Upper bounds for the variables (arcs) in the embedded network.
    from (output)
    Defines the origins of the arcs in the embedded network.
    to (output)
    Defines the destinations of the arcs in the embedded network.
    Description:

    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 mosek.Task.netoptimize.
    Each arc a in the network corresponds to a scaled subset of elements in column [[MathCmd 794]] 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:

    • [[MathCmd 795]]
    • [[MathCmd 796]]
    • The scaled matrix has at most two non-zeroes in each column in netvar over the indexes in netcon (i.e defines a pure network flow matrix).

    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.

    See also:

     

    mosek.Task.netoptimize

    Optimizes a pure network flow problem.

  • mosek.Task.netoptimize

    Syntax:

     

    public void netoptimize (
        double[] cc,
        double[] cx,
        boundkey[] bkc,
        double[] blc,
        double[] buc,
        boundkey[] bkx,
        double[] blx,
        double[] bux,
        int[] from,
        int[] to,
        out prosta prosta,
        out solsta solsta,
        int hotstart,
        stakey[] skc,
        stakey[] skx,
        double[] xc,
        double[] xx,
        double[] y,
        double[] slc,
        double[] suc,
        double[] slx,
        double[] sux);
    
    cc (input)
    Linear terms of the objective for constraints (nodes) as a dense vector.
    cx (input)
    Linear terms of the objective for variables (arcs) as a dense vector.
    bkc (input)
    Bound keys for the constraints (nodes).
    blc (input)
    Lower bounds for the constraints (nodes).
    buc (input)
    Upper bounds for the constraints (nodes).
    bkx (input)
    Bound keys for the variables (arcs).
    blx (input)
    Lower bounds for the variables (arcs).
    bux (input)
    Upper bounds for the variables (arcs).
    from (input)
    Defines the origins of the arcs in the network.
    to (input)
    Defines the destinations of the arcs in the network.
    prosta (output)
    Problem status.
    solsta (output)
    Solution status.
    hotstart (input)
    If zero the network optimizer will not use hot-starts, if non-zero a solution must be defined in the solution variables below, which will be used to hot-start the network optimizer.
    skc (input/output)
    Status keys for the constraints (nodes).
    skx (input/output)
    Status keys for the variables (arcs).
    xc (input/output)
    Primal constraint solution (nodes).
    xx (input/output)
    Primal variable solution (arcs).
    y (input/output)
    Vector of dual variables corresponding to the constraints (nodes).
    slc (input/output)
    Dual variables corresponding to the lower bounds on the constraints (nodes).
    suc (input/output)
    Dual variables corresponding to the upper bounds on the constraints (nodes).
    slx (input/output)
    Dual variables corresponding to the lower bounds on the constraints (arcs).
    sux (input/output)
    Dual variables corresponding to the upper bounds on the constraints (arcs).
    Syntax:

     

    public void netoptimize (
        int numcon,
        int numvar,
        double[] cc,
        double[] cx,
        boundkey[] bkc,
        double[] blc,
        double[] buc,
        boundkey[] bkx,
        double[] blx,
        double[] bux,
        int[] from,
        int[] to,
        out prosta prosta,
        out solsta solsta,
        int hotstart,
        stakey[] skc,
        stakey[] skx,
        double[] xc,
        double[] xx,
        double[] y,
        double[] slc,
        double[] suc,
        double[] slx,
        double[] sux);
    
    numcon (input)
    Number of network constraints (nodes) in the network.
    numvar (input)
    Number of network variables (arcs) in the network.
    cc (input)
    Linear terms of the objective for constraints (nodes) as a dense vector.
    cx (input)
    Linear terms of the objective for variables (arcs) as a dense vector.
    bkc (input)
    Bound keys for the constraints (nodes).
    blc (input)
    Lower bounds for the constraints (nodes).
    buc (input)
    Upper bounds for the constraints (nodes).
    bkx (input)
    Bound keys for the variables (arcs).
    blx (input)
    Lower bounds for the variables (arcs).
    bux (input)
    Upper bounds for the variables (arcs).
    from (input)
    Defines the origins of the arcs in the network.
    to (input)
    Defines the destinations of the arcs in the network.
    prosta (output)
    Problem status.
    solsta (output)
    Solution status.
    hotstart (input)
    If zero the network optimizer will not use hot-starts, if non-zero a solution must be defined in the solution variables below, which will be used to hot-start the network optimizer.
    skc (input/output)
    Status keys for the constraints (nodes).
    skx (input/output)
    Status keys for the variables (arcs).
    xc (input/output)
    Primal constraint solution (nodes).
    xx (input/output)
    Primal variable solution (arcs).
    y (input/output)
    Vector of dual variables corresponding to the constraints (nodes).
    slc (input/output)
    Dual variables corresponding to the lower bounds on the constraints (nodes).
    suc (input/output)
    Dual variables corresponding to the upper bounds on the constraints (nodes).
    slx (input/output)
    Dual variables corresponding to the lower bounds on the constraints (arcs).
    sux (input/output)
    Dual variables corresponding to the upper bounds on the constraints (arcs).
    Description:
    Uses the network optimizer to solve the given network problem. The problem must be a pure network flow problem. If hotstart is zero the network optimizer will not use hot-starts, if non-zero a solution must be defined in the solution variables skc,skx,xc,xx,y,slc,suc,slx and sux, which will be used to hot-start the network optimizer. Please note task only acts as a dummy task, where parameters and streams can be set for the network optimizer. No other data in task is used.
    See also:

     

    mosek.Task.netextraction

    Finds embedded network structure.

  • mosek.Task.optimizeconcurrent

    Syntax:

     

    public void optimizeconcurrent (Task[] taskarray)
    
    taskarray (input)
    An array of num tasks.
    Description:

    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 [[MathCmd 797]] 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 mosek.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 mosek.Task.optimizeconcurrent does the following:

    1. All data except task parameters (mosek.iparam, mosek.dparam and mosek.sparam) in task is copied to each of the tasks in taskarray. In particular this means that any solution in task is copied to the other tasks. Call-back functions are not copied.
    2. The tasks task and the num tasks in taskarray are started in parallel.
    3. When a task finishes providing an optimal solution (or a certificate of infeasibility) its solution is copied to task and all other tasks are stopped.

    For an explained code example see Section 8.6.4.

  • mosek.Task.optimizersummary

    Syntax:

     

    public void optimizersummary (streamtype whichstream)
    
    whichstream (input)
    Index of the stream.
    Description:
    Prints a short summary with optimizer statistics for last optimization.
  • mosek.Task.optimize

    Syntax:

     

    public rescode optimize ()
    
    Syntax:

     

    public void optimize (out rescode trmcode)
    
    trmcode (output)
    Is either mosek.rescode.ok or a termination response code.
    Description:
    Calls the optimizer. Depending on the problem type and the selected optimizer this will call one of the optimizers in MOSEK. By default the interior point optimizer will be selected for continuous problems. The optimizer may be selected manually by setting the parameter mosek.iparam.optimizer.
    See also:

     

    mosek.Task.optimizeconcurrent

    Optimize a given task with several optimizers concurrently.

    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.iparam.optimizer
  • mosek.Task.primalsensitivity

    Syntax:

     

    public void primalsensitivity (
        int[] subi,
        mark[] marki,
        int[] subj,
        mark[] markj,
        double[] leftpricei,
        double[] rightpricei,
        double[] leftrangei,
        double[] rightrangei,
        double[] leftpricej,
        double[] rightpricej,
        double[] leftrangej,
        double[] rightrangej);
    
    subi (input)
    Indexes of bounds on constraints to analyze.
    marki (input)
    The value of marki[i] specifies for which bound (upper or lower) on constraint subi[i] sensitivity analysis should be performed.
    subj (input)
    Indexes of bounds on variables to analyze.
    markj (input)
    The value of markj[j] specifies for which bound (upper or lower) on variable subj[j] sensitivity analysis should be performed.
    leftpricei (output)
    leftpricei[i] is the left shadow price for the upper/lower bound (indicated by marki[i]) of the constraint with index subi[i].
    rightpricei (output)
    rightpricei[i] is the right shadow price for the upper/lower bound (indicated by marki[i]) of the constraint with index subi[i].
    leftrangei (output)
    leftrangei[i] is the left range for the upper/lower bound (indicated by marki[i]) of the constraint with index subi[i].
    rightrangei (output)
    rightrangei[i] is the right range for the upper/lower bound (indicated by marki[i]) of the constraint with index subi[i].
    leftpricej (output)
    leftpricej[j] is the left shadow price for the upper/lower bound (indicated by marki[j]) on variable subj[j].
    rightpricej (output)
    rightpricej[j] is the right shadow price for the upper/lower bound (indicated by marki[j]) on variable subj[j] .
    leftrangej (output)
    leftrangej[j] is the left range for the upper/lower bound (indicated by marki[j]) on variable subj[j].
    rightrangej (output)
    rightrangej[j] is the right range for the upper/lower bound (indicated by marki[j]) on variable subj[j].
    Syntax:

     

    public void primalsensitivity (
        int numi,
        int[] subi,
        mark[] marki,
        int numj,
        int[] subj,
        mark[] markj,
        double[] leftpricei,
        double[] rightpricei,
        double[] leftrangei,
        double[] rightrangei,
        double[] leftpricej,
        double[] rightpricej,
        double[] leftrangej,
        double[] rightrangej);
    
    numi (input)
    Number of bounds on constraints to be analyzed. Length of subi and marki.
    subi (input)
    Indexes of bounds on constraints to analyze.
    marki (input)
    The value of marki[i] specifies for which bound (upper or lower) on constraint subi[i] sensitivity analysis should be performed.
    numj (input)
    Number of bounds on variables to be analyzed. Length of subj and markj.
    subj (input)
    Indexes of bounds on variables to analyze.
    markj (input)
    The value of markj[j] specifies for which bound (upper or lower) on variable subj[j] sensitivity analysis should be performed.
    leftpricei (output)
    leftpricei[i] is the left shadow price for the upper/lower bound (indicated by marki[i]) of the constraint with index subi[i].
    rightpricei (output)
    rightpricei[i] is the right shadow price for the upper/lower bound (indicated by marki[i]) of the constraint with index subi[i].
    leftrangei (output)
    leftrangei[i] is the left range for the upper/lower bound (indicated by marki[i]) of the constraint with index subi[i].
    rightrangei (output)
    rightrangei[i] is the right range for the upper/lower bound (indicated by marki[i]) of the constraint with index subi[i].
    leftpricej (output)
    leftpricej[j] is the left shadow price for the upper/lower bound (indicated by marki[j]) on variable subj[j].
    rightpricej (output)
    rightpricej[j] is the right shadow price for the upper/lower bound (indicated by marki[j]) on variable subj[j] .
    leftrangej (output)
    leftrangej[j] is the left range for the upper/lower bound (indicated by marki[j]) on variable subj[j].
    rightrangej (output)
    rightrangej[j] is the right range for the upper/lower bound (indicated by marki[j]) on variable subj[j].
    Description:

    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:

    1. subi Index of constraint to analyze.
    2. marki Indicate for which bound of constraint subi[i] sensitivity analysis is performed. If marki[i] = mosek.mark.up the upper bound of constraint subi[i] is analyzed, and if marki[i] = mosek.mark.lo the lower bound is analyzed. If subi[i] is an equality constraint, either mosek.mark.lo or mosek.mark.up can be used to select the constraint for sensitivity analysis.

    Consider the problem:

    \begin{math}\nonumber{}\begin{array}{lccl}\nonumber{}\mbox{minimize} & x_{1}+x_{2} &  & \\\nonumber{}\mbox{subject to}-1\leq{} & x_{1}-x_{2} & \leq{} & 1,\\\nonumber{} & x_{1} & = & 0,\\\nonumber{} & x_{1}\geq{}0,x_{2}\geq{}0 &  &\end{array}\end{math} (15.9.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:

    \begin{math}\nonumber{}x_{1}-x_{2}\leq{}1\end{math} (15.9.25)

    Similarly, the variables for which to perform sensitivity analysis are given by the structures:

    1. subj Index of variables to analyze.
    2. markj Indicate for which bound of variable subi[j] sensitivity analysis is performed. If markj[j] = mosek.mark.up the upper bound of constraint subi[j] is analyzed, and if markj[j] = mosek.mark.lo the lower bound is analyzed. If subi[j] is an equality constraint, either mosek.mark.lo or mosek.mark.up can be used to select the constraint for sensitivity analysis.

    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.

    See also:

     

    mosek.Task.dualsensitivity

    Performs sensitivity analysis on objective coefficients.

    mosek.Task.sensitivityreport

    Creates a sensitivity report.

    mosek.iparam.sensitivity_type
    mosek.iparam.log_sensitivity
    mosek.iparam.log_sensitivity_opt
  • mosek.Task.printdata

    Syntax:

     

    public void printdata (
        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);
    
    whichstream (input)
    Index of the stream.
    firsti (input)
    Index of first constraint for which data should be printed.
    lasti (input)
    Index of last constraint plus 1 for which data should be printed.
    firstj (input)
    Index of first variable for which data should be printed.
    lastj (input)
    Index of last variable plus 1 for which data should be printed.
    firstk (input)
    Index of first cone for which data should be printed.
    lastk (input)
    Index of last cone plus 1 for which data should be printed.
    c (input)
    If non-zero c is printed.
    qo (input)
    If non-zero [[MathCmd 31]] is printed.
    a (input)
    If non-zero A is printed.
    qc (input)
    If non-zero [[MathCmd 32]] is printed for the relevant constraints.
    bc (input)
    If non-zero the constraints bounds are printed.
    bx (input)
    If non-zero the variable bounds are printed.
    vartype (input)
    If non-zero the variable types are printed.
    cones (input)
    If non-zero the conic data is printed.
    Description:
    Prints a part of the problem data to a stream. This function is normally used for debugging purposes only, e.g. to verify that the correct data has been inputted.
  • mosek.Task.probtypetostr

    Syntax:

     

    public void probtypetostr (
        problemtype probtype,
        StringBuilder str);
    
    probtype (input)
    Problem type.
    str (output)
    String corresponding to the problem type key probtype.
    Description:
    Obtains a string containing the name of a problem type given.
  • mosek.Task.prostatostr

    Syntax:

     

    public void prostatostr (
        prosta prosta,
        StringBuilder str);
    
    prosta (input)
    Problem status.
    str (output)
    String corresponding to the status key prosta.
    Description:
    Obtains a string containing the name of a problem status given.
  • mosek.Task.putaij

    Syntax:

     

    public void putaij (
        int i,
        int j,
        double aij);
    
    i (input)
    Index of the constraint in which the change should occur.
    j (input)
    Index of the variable in which the change should occur.
    aij (input)
    New coefficient for [[MathCmd 720]].
    Description:

    Changes a coefficient in A using the method

    \begin{displaymath}\nonumber{}a_{{\mathtt{i}\mathtt{j}}}=\mathtt{aij}.\end{displaymath}
    See also:

     

    mosek.Task.putavec

    Replaces all elements in one row or column of the linear coefficient matrix.

    mosek.Task.putaij

    Changes a single value in the linear coefficient matrix.

    mosek.Task.putmaxnumanz

    The function changes the size of the preallocated storage for linear coefficients.

  • mosek.Task.putaijlist

    Syntax:

     

    public void putaijlist (
        int[] subi,
        int[] subj,
        double[] valij);
    
    subi (input)
    Constraint indexes in which the change should occur.
    subj (input)
    Variable indexes in which the change should occur.
    valij (input)
    New coefficient values for [[MathCmd 720]].
    Syntax:

     

    public void putaijlist (
        int num,
        int[] subi,
        int[] subj,
        double[] valij);
    
    num (input)
    Number of coefficients that should be changed.
    subi (input)
    Constraint indexes in which the change should occur.
    subj (input)
    Variable indexes in which the change should occur.
    valij (input)
    New coefficient values for [[MathCmd 720]].
    Description:

    Changes one or more coefficients in A using the method

    \begin{displaymath}\nonumber{}a_{{\mathtt{subi[k]},\mathtt{subj[k]}}}=\mathtt{valij[k]},\quad{}k=0,\ldots ,\mathtt{num}-1.\end{displaymath}

    If the same [[MathCmd 720]] entry appears multiple times only the last one will be used.

    See also:

     

    mosek.Task.putavec

    Replaces all elements in one row or column of the linear coefficient matrix.

    mosek.Task.putaij

    Changes a single value in the linear coefficient matrix.

    mosek.Task.putmaxnumanz

    The function changes the size of the preallocated storage for linear coefficients.

  • mosek.Task.putavec

    Syntax:

     

    public void putavec (
        accmode accmode,
        int i,
        int[] asub,
        double[] aval);
    
    accmode (input)
    Defines whether to replace a column or a row.
    i (input)
    If accmode equals mosek.accmode.con, then i is a constraint index. Otherwise it is a column index.
    asub (input)
    Index of the [[MathCmd 720]] values that should be changed.
    aval (input)
    New [[MathCmd 720]] values.
    Syntax:

     

    public void putavec (
        accmode accmode,
        int i,
        int nzi,
        int[] asub,
        double[] aval);
    
    accmode (input)
    Defines whether to replace a column or a row.
    i (input)
    If accmode equals mosek.accmode.con, then i is a constraint index. Otherwise it is a column index.
    nzi (input)
    Number of non-zeros in the vector.
    asub (input)
    Index of the [[MathCmd 720]] values that should be changed.
    aval (input)
    New [[MathCmd 720]] values.
    Description:

    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 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.

    See also:

     

    mosek.Task.putavec

    Replaces all elements in one row or column of the linear coefficient matrix.

    mosek.Task.putaij

    Changes a single value in the linear coefficient matrix.

    mosek.Task.putmaxnumanz

    The function changes the size of the preallocated storage for linear coefficients.

  • mosek.Task.putaveclist

    Syntax:

     

    public void putaveclist (
        accmode accmode,
        int[] sub,
        int[] ptrb,
        int[] ptre,
        int[] asub,
        double[] aval);
    
    accmode (input)
    Defines if operations are performed row-wise (constraint-oriented) or column-wise (variable-oriented).
    sub (input)
    Indexes of rows or columns that should be replaced. sub should not contain duplicate values.
    ptrb (input)
    Array of pointers to the first element in the rows or columns stored in asub and aval. For an explanation of the meaning of ptrb see Section 5.8.3.2.
    ptre (input)
    Array of pointers to the last element plus one in the rows or columns stored in asub and aval. For an explanation of the meaning of ptre see Section 5.8.3.2.
    asub (input)
    If accmode is mosek.accmode.con, then asub contains the new variable indexes, otherwise it contains the new constraint indexes.
    aval (input)
    Coefficient values. See (5.8.5) and Section 5.8.3.
    Syntax:

     

    public void putaveclist (
        accmode accmode,
        int num,
        int[] sub,
        int[] ptrb,
        int[] ptre,
        int[] asub,
        double[] aval);
    
    accmode (input)
    Defines if operations are performed row-wise (constraint-oriented) or column-wise (variable-oriented).
    num (input)
    Number of rows or columns of A to replace.
    sub (input)
    Indexes of rows or columns that should be replaced. sub should not contain duplicate values.
    ptrb (input)
    Array of pointers to the first element in the rows or columns stored in asub and aval. For an explanation of the meaning of ptrb see Section 5.8.3.2.
    ptre (input)
    Array of pointers to the last element plus one in the rows or columns stored in asub and aval. For an explanation of the meaning of ptre see Section 5.8.3.2.
    asub (input)
    If accmode is mosek.accmode.con, then asub contains the new variable indexes, otherwise it contains the new constraint indexes.
    aval (input)
    Coefficient values. See (5.8.5) and Section 5.8.3.
    Description:

    Replaces all elements in a set of rows or columns of A.

    The elements are replaced as follows.

    If the same row or column appears multiple times only the last one will be used.

    See also:

     

    mosek.Task.putavec

    Replaces all elements in one row or column of the linear coefficient matrix.

    mosek.Task.putmaxnumanz

    The function changes the size of the preallocated storage for linear coefficients.

  • mosek.Task.putaveclist

    Syntax:

     

    public void putaveclist (
        accmode accmode,
        int[] sub,
        long[] ptrb,
        long[] ptre,
        int[] asub,
        double[] aval);
    
    accmode (input)
    Defines if operations are performed row-wise (constraint-oriented) or column-wise (variable-oriented).
    sub (input)
    Indexes of rows or columns that should be replaced. sub should not contain duplicate values.
    ptrb (input)
    Array of pointers to the first element in the rows or columns stored in asub and aval. For an explanation of the meaning of ptrb see Section 5.8.3.2.
    ptre (input)
    Array of pointers to the last element plus one in the rows or columns stored in asub and aval. For an explanation of the meaning of ptre see Section 5.8.3.2.
    asub (input)
    If accmode is mosek.accmode.con, then asub contains the new variable indexes, otherwise it contains the new constraint indexes.
    aval (input)
    Coefficient values. See (5.8.5) and Section 5.8.3.
    Syntax:

     

    public void putaveclist (
        accmode accmode,
        int num,
        int[] sub,
        long[] ptrb,
        long[] ptre,
        int[] asub,
        double[] aval);
    
    accmode (input)
    Defines if operations are performed row-wise (constraint-oriented) or column-wise (variable-oriented).
    num (input)
    Number of rows or columns of A to replace.
    sub (input)
    Indexes of rows or columns that should be replaced. sub should not contain duplicate values.
    ptrb (input)
    Array of pointers to the first element in the rows or columns stored in asub and aval. For an explanation of the meaning of ptrb see Section 5.8.3.2.
    ptre (input)
    Array of pointers to the last element plus one in the rows or columns stored in asub and aval. For an explanation of the meaning of ptre see Section 5.8.3.2.
    asub (input)
    If accmode is mosek.accmode.con, then asub contains the new variable indexes, otherwise it contains the new constraint indexes.
    aval (input)
    Coefficient values. See (5.8.5) and Section 5.8.3.
    Description:

    Replaces all elements in a set of rows or columns of A.

    The elements are replaced as follows.

    If the same row or column appears multiple times only the last one will be used.

    See also:

     

    mosek.Task.putavec

    Replaces all elements in one row or column of the linear coefficient matrix.

    mosek.Task.putmaxnumanz

    The function changes the size of the preallocated storage for linear coefficients.

  • mosek.Task.putbound

    Syntax:

     

    public void putbound (
        accmode accmode,
        int i,
        boundkey bk,
        double bl,
        double bu);
    
    accmode (input)
    Defines whether the bound for a constraint or a variable is changed.
    i (input)
    Index of the constraint or variable.
    bk (input)
    New bound key.
    bl (input)
    New lower bound.
    bu (input)
    New upper bound.
    Description:

    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.

    See also:

     

    mosek.Task.putboundlist

    Changes the bounds of constraints or variables.

  • mosek.Task.putboundlist

    Syntax:

     

    public void putboundlist (
        accmode accmode,
        int[] sub,
        boundkey[] bk,
        double[] bl,
        double[] bu);
    
    accmode (input)
    Defines whether bounds for constraints (mosek.accmode.con) or variables (mosek.accmode.var) are changed.
    sub (input)
    Subscripts of the bounds that should be changed.
    bk (input)
    Constraint or variable index sub[t] is assigned the bound key bk[t].
    bl (input)
    Constraint or variable index sub[t] is assigned the lower bound bl[t].
    bu (input)
    Constraint or variable index sub[t] is assigned the upper bound bu[t].
    Syntax:

     

    public void putboundlist (
        accmode accmode,
        int num,
        int[] sub,
        boundkey[] bk,
        double[] bl,
        double[] bu);
    
    accmode (input)
    Defines whether bounds for constraints (mosek.accmode.con) or variables (mosek.accmode.var) are changed.
    num (input)
    Number of bounds that should be changed.
    sub (input)
    Subscripts of the bounds that should be changed.
    bk (input)
    Constraint or variable index sub[t] is assigned the bound key bk[t].
    bl (input)
    Constraint or variable index sub[t] is assigned the lower bound bl[t].
    bu (input)
    Constraint or variable index sub[t] is assigned the upper bound bu[t].
    Description:
    Changes the bounds for either some constraints or variables. If multiple bound changes are specified for a constraint or a variable, only the last change takes effect.
    See also:

     

    mosek.Task.putbound

    Changes the bound for either one constraint or one variable.

    mosek.dparam.data_tol_bound_inf
    mosek.dparam.data_tol_bound_wrn
  • mosek.Task.putboundslice

    Syntax:

     

    public void putboundslice (
        accmode con,
        int first,
        int last,
        boundkey[] bk,
        double[] bl,
        double[] bu);
    
    con (input)
    Defines whether bounds for constraints (mosek.accmode.con) or variables (mosek.accmode.var) are changed.
    first (input)
    First index in the sequence.
    last (input)
    Last index plus 1 in the sequence.
    bk (input)
    Bound keys.
    bl (input)
    Values for lower bounds.
    bu (input)
    Values for upper bounds.
    Description:
    Changes the bounds for a sequence of variables or constraints.
    See also:

     

    mosek.Task.putbound

    Changes the bound for either one constraint or one variable.

    mosek.dparam.data_tol_bound_inf
    mosek.dparam.data_tol_bound_wrn
  • mosek.Task.putcfix

    Syntax:

     

    public void putcfix (double cfix)
    
    cfix (input)
    Fixed term in the objective.
    Description:
    Replaces the fixed term in the objective by a new one.
  • mosek.Task.putcj

    Syntax:

     

    public void putcj (
        int j,
        double cj);
    
    j (input)
    Index of the variable for which c should be changed.
    cj (input)
    New value of [[MathCmd 87]].
    Description:

    Modifies one coefficient in the linear objective vector c, i.e.

    \begin{displaymath}\nonumber{}c_{{\mathtt{j}}}=\mathtt{cj}.\end{displaymath}
  • mosek.Task.putclist

    Syntax:

     

    public void putclist (
        int[] subj,
        double[] val);
    
    subj (input)
    Index of variables for which c should be changed.
    val (input)
    New numerical values for coefficients in c that should be modified.
    Syntax:

     

    public void putclist (
        int num,
        int[] subj,
        double[] val);
    
    num (input)
    Number of coefficients that should be changed.
    subj (input)
    Index of variables for which c should be changed.
    val (input)
    New numerical values for coefficients in c that should be modified.
    Description:

    Modifies elements in the linear term c in the objective using the principle

    \begin{displaymath}\nonumber{}c_{{\mathtt{subj[t]}}}=\mathtt{val[t]},\quad{}t=0,\ldots ,\mathtt{num}-1.\end{displaymath}

    If a variable index is specified multiple times in subj only the last entry is used.

  • mosek.Task.putcone

    Syntax:

     

    public void putcone (
        int k,
        conetype conetype,
        double conepar,
        int[] submem);
    
    k (input)
    Index of the cone.
    conetype (input)
    Specifies the type of the cone.
    conepar (input)
    This argument is currently not used. Can be set to 0.0.
    submem (input)
    Variable subscripts of the members in the cone.
    Syntax:

     

    public void putcone (
        int k,
        conetype conetype,
        double conepar,
        int nummem,
        int[] submem);
    
    k (input)
    Index of the cone.
    conetype (input)
    Specifies the type of the cone.
    conepar (input)
    This argument is currently not used. Can be set to 0.0.
    nummem (input)
    Number of member variables in the cone.
    submem (input)
    Variable subscripts of the members in the cone.
    Description:
    Replaces a conic constraint.
  • mosek.Task.putdouparam

    Syntax:

     

    public void putdouparam (
        dparam param,
        double parvalue);
    
    param (input)
    Which parameter.
    parvalue (input)
    Parameter value.
    Description:
    Sets the value of a double parameter.
  • mosek.Task.putintparam

    Syntax:

     

    public void putintparam (
        iparam param,
        int parvalue);
    
    param (input)
    Which parameter.
    parvalue (input)
    Parameter value.
    Description:
    Sets the value of an integer parameter.
  • mosek.Task.putmaxnumanz

    Syntax:

     

    public void putmaxnumanz (int maxnumanz)
    
    maxnumanz (input)
    New size of the storage reserved for storing A.
    Description:

    MOSEK stores only the non-zero elements in A. Therefore, MOSEK cannot predict how much storage is required to store A. Using this function it is possible to specify the number of non-zeros to preallocate for storing A.

    If the number of non-zeros in the problem is known, it is a good idea to set maxnumanz slightly larger than this number, otherwise a rough estimate can be used. In general, if A is inputted in many small chunks, setting this value may speed up the the data input phase.

    It is not mandatory to call this function, since MOSEK will reallocate internal structures whenever it is necessary.

    See also:

     

    mosek.iinfitem.sto_num_a_realloc
  • mosek.Task.putmaxnumanz

    Syntax:

     

    public void putmaxnumanz (long maxnumanz)
    
    maxnumanz (input)
    New size of the storage reserved for storing A.
    Description:
    The function changes the size of the preallocated storage for linear coefficients.
    See also:

     

    mosek.iinfitem.sto_num_a_realloc
  • mosek.Task.putmaxnumcon

    Syntax:

     

    public void putmaxnumcon (int maxnumcon)
    
    maxnumcon (input)
    Number of preallocated constraints in the optimization task.
    Description:

    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.

  • mosek.Task.putmaxnumcone

    Syntax:

     

    public void putmaxnumcone (int maxnumcone)
    
    maxnumcone (input)
    Number of preallocated conic constraints in the optimization task.
    Description:

    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.

  • mosek.Task.putmaxnumqnz

    Syntax:

     

    public void putmaxnumqnz (int maxnumqnz)
    
    maxnumqnz (input)
    Number of non-zero elements preallocated in quadratic coefficient matrices.
    Description:

    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.

  • mosek.Task.putmaxnumqnz

    Syntax:

     

    public void putmaxnumqnz (long maxnumqnz)
    
    maxnumqnz (input)
    Number of non-zero elements preallocated in quadratic coefficient matrices.
    Description:

    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.

  • mosek.Task.putmaxnumvar

    Syntax:

     

    public void putmaxnumvar (int maxnumvar)
    
    maxnumvar (input)
    Number of preallocated variables in the optimization task.
    Description:

    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.

  • mosek.Task.putnadouparam

    Syntax:

     

    public void putnadouparam (
        string paramname,
        double parvalue);
    
    paramname (input)
    Name of a parameter.
    parvalue (input)
    Parameter value.
    Description:
    Sets the value of a named double parameter.
  • mosek.Task.putnaintparam

    Syntax:

     

    public void putnaintparam (
        string paramname,
        int parvalue);
    
    paramname (input)
    Name of a parameter.
    parvalue (input)
    Parameter value.
    Description:
    Sets the value of a named integer parameter.
  • mosek.Task.putname

    Syntax:

     

    public void putname (
        problemitem whichitem,
        int i,
        string name);
    
    whichitem (input)
    Problem item, i.e. a cone, a variable or a constraint name..
    i (input)
    Index.
    name (input)
    New name to be assigned to the item.
    Description:
    Assigns the name defined by name to a problem item (a variable, a constraint or a cone).
  • mosek.Task.putnastrparam

    Syntax:

     

    public void putnastrparam (
        string paramname,
        string parvalue);
    
    paramname (input)
    Name of a parameter.
    parvalue (input)
    Parameter value.
    Description:
    Sets the value of a named string parameter.
  • mosek.Task.putobjname

    Syntax:

     

    public void putobjname (string objname)
    
    objname (input)
    Name of the objective.
    Description:
    Assigns the name given by objname to the objective function.
  • mosek.Task.putobjsense

    Syntax:

     

    public void putobjsense (objsense sense)
    
    sense (input)
    The objective sense of the task. The values mosek.objsense.maximize and mosek.objsense.minimize means that the the problem is maximized or minimized respectively. The value mosek.objsense.undefined means that the objective sense is taken from the parameter mosek.iparam.objective_sense.
    Description:
    Sets the objective sense of the task.
    See also:

     

    mosek.Task.getobjsense

    Gets the objective sense.

  • mosek.Task.putparam

    Syntax:

     

    public void putparam (
        string parname,
        string parvalue);
    
    parname (input)
    Parameter name.
    parvalue (input)
    Parameter value.
    Description:
    Checks if a parname is valid parameter name. If it is, the parameter is assigned the value specified by parvalue.
  • mosek.Task.putqcon

    Syntax:

     

    public void putqcon (
        int[] qcsubk,
        int[] qcsubi,
        int[] qcsubj,
        double[] qcval);
    
    qcsubk (input)
    k subscripts for [[MathCmd 89]]. See (5.8.4).
    qcsubi (input)
    i subscripts for [[MathCmd 89]]. See (5.8.4).
    qcsubj (input)
    j subscripts for [[MathCmd 89]]. See (5.8.4).
    qcval (input)
    Numerical value for [[MathCmd 89]].
    Syntax:

     

    public void putqcon (
        int numqcnz,
        int[] qcsubk,
        int[] qcsubi,
        int[] qcsubj,
        double[] qcval);
    
    numqcnz (input)
    Number of quadratic terms. See (5.8.4).
    qcsubk (input)
    k subscripts for [[MathCmd 89]]. See (5.8.4).
    qcsubi (input)
    i subscripts for [[MathCmd 89]]. See (5.8.4).
    qcsubj (input)
    j subscripts for [[MathCmd 89]]. See (5.8.4).
    qcval (input)
    Numerical value for [[MathCmd 89]].
    Description:

    Replaces all quadratic entries in the constraints. Consider constraints on the form:

    \begin{math}\nonumber{}l_{k}^{c}\leq{}\frac{1}{2}\sum _{{i=0}}^{{\mathtt{numvar}-1}}\sum _{{j=0}}^{{\mathtt{numvar}-1}}q_{{ij}}^{k}x_{i}x_{j}+\sum _{{j=0}}^{{\mathtt{numvar}-1}}a_{{kj}}x_{j}\leq{}u_{k}^{c},~k=0,\ldots ,m-1.\end{math} (15.9.26)

    The function assigns values to q such that:

    \begin{math}\nonumber{}q_{{\mathtt{qcsubi[t]},\mathtt{qcsubj[t]}}}^{{\mathtt{qcsubk[t]}}}=\mathtt{qcval[t]},~t=0,\ldots ,\mathtt{numqcnz}-1.\end{math} (15.9.27)

    and

    \begin{math}\nonumber{}q_{{\mathtt{\mathtt{qcsubj[t]},qcsubi[t]}}}^{{\mathtt{qcsubk[t]}}}=\mathtt{qcval[t]},~t=0,\ldots ,\mathtt{numqcnz}-1.\end{math} (15.9.28)

    Values not assigned are set to zero.

    Please note that duplicate entries are added together.

    See also:

     

    mosek.Task.putqconk

    Replaces all quadratic terms in a single constraint.

    mosek.Task.putmaxnumqnz

    Changes the size of the preallocated storage for quadratic terms.

  • mosek.Task.putqconk

    Syntax:

     

    public void putqconk (
        int k,
        int[] qcsubi,
        int[] qcsubj,
        double[] qcval);
    
    k (input)
    The constraint in which the new Q elements are inserted.
    qcsubi (input)
    i subscripts for [[MathCmd 89]]. See (5.8.4).
    qcsubj (input)
    j subscripts for [[MathCmd 89]]. See (5.8.4).
    qcval (input)
    Numerical value for [[MathCmd 89]].
    Syntax:

     

    public void putqconk (
        int k,
        int numqcnz,
        int[] qcsubi,
        int[] qcsubj,
        double[] qcval);
    
    k (input)
    The constraint in which the new Q elements are inserted.
    numqcnz (input)
    Number of quadratic terms. See (5.8.4).
    qcsubi (input)
    i subscripts for [[MathCmd 89]]. See (5.8.4).
    qcsubj (input)
    j subscripts for [[MathCmd 89]]. See (5.8.4).
    qcval (input)
    Numerical value for [[MathCmd 89]].
    Description:

    Replaces all the quadratic entries in one constraint k of the form:

    \begin{math}\nonumber{}l_{k}^{c}\leq{}\frac{1}{2}\sum _{{i=0}}^{{\mathtt{numvar}-1}}\sum _{{j=0}}^{{\mathtt{numvar}-1}}q_{{ij}}^{k}x_{i}x_{j}+\sum _{{j=0}}^{{\mathtt{numvar}-1}}a_{{kj}}x_{j}\leq{}u_{k}^{c}.\end{math} (15.9.29)

    It is assumed that [[MathCmd 32]] is symmetric, i.e. [[MathCmd 846]], and therefore, only the values of [[MathCmd 847]] for which ij should be inputted to MOSEK. To be precise, MOSEK uses the following procedure

    \begin{displaymath}\nonumber{}\begin{array}{ll}\nonumber{}1. & Q^{{k}}=0\\\nonumber{}2. & \mbox{for }t=0\mbox{ to }\mathtt{numqonz}-1\\\nonumber{}3. & \qquad{}q_{{\mathtt{qcsubi[t]},\mathtt{qcsubj[t]}}}^{{k}}=q_{{\mathtt{qcsubi[t]},\mathtt{qcsubj[t]}}}^{{k}}+\mathtt{qcval[t]}\\\nonumber{}3. & \qquad{}q_{{\mathtt{qcsubj[t]},\mathtt{qcsubi[t]}}}^{{k}}=q_{{\mathtt{qcsubj[t]},\mathtt{qcsubi[t]}}}^{{k}}+\mathtt{qcval[t]}\end{array}\end{displaymath}

    Please note that:

    • For large problems it is essential for the efficiency that the function mosek.Task.putmaxnumqnz64 is employed to specify an appropriate maxnumqnz.
    • Only the lower triangular part should be specified because [[MathCmd 32]] is symmetric. Specifying values for [[MathCmd 847]] where i<j will result in an error.
    • Only non-zero elements should be specified.
    • The order in which the non-zero elements are specified is insignificant.
    • Duplicate elements are added together. Hence, it is recommended not to specify the same element multiple times in qosubi, qosubj, and qoval.

    For a code example see Section 5.3.2.

    See also:

     

    mosek.Task.putqcon

    Replaces all quadratic terms in constraints.

    mosek.Task.putmaxnumqnz

    Changes the size of the preallocated storage for quadratic terms.

  • mosek.Task.putqobj

    Syntax:

     

    public void putqobj (
        int[] qosubi,
        int[] qosubj,
        double[] qoval);
    
    qosubi (input)
    i subscript for [[MathCmd 83]].
    qosubj (input)
    j subscript for [[MathCmd 83]].
    qoval (input)
    Numerical value for [[MathCmd 83]].
    Syntax:

     

    public void putqobj (
        int numqonz,
        int[] qosubi,
        int[] qosubj,
        double[] qoval);
    
    numqonz (input)
    Number of non-zero elements in [[MathCmd 31]].
    qosubi (input)
    i subscript for [[MathCmd 83]].
    qosubj (input)
    j subscript for [[MathCmd 83]].
    qoval (input)
    Numerical value for [[MathCmd 83]].
    Description:

    Replaces all the quadratic terms in the objective

    \begin{math}\nonumber{}\frac{1}{2}\sum \limits _{{i=0}}^{{\mathtt{numvar}-1}}\sum _{{j=0}}^{{\mathtt{numvar}-1}}q_{{ij}}^{o}x_{i}x_{j}+\sum _{{j=0}}^{{\mathtt{numvar}-1}}c_{j}x_{j}+c^{f}.\end{math} (15.9.30)

    It is assumed that [[MathCmd 31]] is symmetric, i.e. [[MathCmd 860]], and therefore, only the values of [[MathCmd 861]] for which ij should be specified. To be precise, MOSEK uses the following procedure

    \begin{displaymath}\nonumber{}\begin{array}{ll}\nonumber{}1. & Q^{o}=0\\\nonumber{}2. & \mbox{for }t=0\mbox{ to }\mathtt{numqonz}-1\\\nonumber{}3. & \qquad{}q_{{\mathtt{qosubi[t]},\mathtt{qosubj[t]}}}^{{o}}=q_{{\mathtt{qosubi[t]},\mathtt{qosubj[t]}}}^{{o}}+\mathtt{qoval[t]}\\\nonumber{}3. & \qquad{}q_{{\mathtt{qosubj[t]},\mathtt{qosubi[t]}}}^{{o}}=q_{{\mathtt{qosubj[t]},\mathtt{qosubi[t]}}}^{{o}}+\mathtt{qoval[t]}\end{array}\end{displaymath}

    Please note that:

    • Only the lower triangular part should be specified because [[MathCmd 31]] is symmetric. Specifying values for [[MathCmd 861]] where i<j will result in an error.
    • Only non-zero elements should be specified.
    • The order in which the non-zero elements are specified is insignificant.
    • Duplicate entries are added to together.

    For a code example see Section 5.3.1.

  • mosek.Task.putqobjij

    Syntax:

     

    public void putqobjij (
        int i,
        int j,
        double qoij);
    
    i (input)
    Row index for the coefficient to be replaced.
    j (input)
    Column index for the coefficient to be replaced.
    qoij (input)
    The new value for [[MathCmd 83]].
    Description:

    Replaces one coefficient in the quadratic term in the objective. The function performs the assignment

    \begin{displaymath}\nonumber{}q_{{\mathtt{i}\mathtt{j}}}^{o}=\mathtt{qoij}.\end{displaymath}

    Only the elements in the lower triangular part are accepted. Setting [[MathCmd 867]] 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 mosek.Task.putqobj instead whenever possible.

  • mosek.Task.putsolution

    Syntax:

     

    public void putsolution (
        soltype whichsol,
        stakey[] skc,
        stakey[] skx,
        stakey[] skn,
        double[] xc,
        double[] xx,
        double[] y,
        double[] slc,
        double[] suc,
        double[] slx,
        double[] sux,
        double[] snx);
    
    whichsol (input)
    Selects a solution.
    skc (input)
    Status keys for the constraints.
    skx (input)
    Status keys for the variables.
    skn (input)
    Status keys for the conic constraints.
    xc (input)
    Primal constraint solution.
    xx (input)
    Primal variable solution (x).
    y (input)
    Vector of dual variables corresponding to the constraints.
    slc (input)
    Dual variables corresponding to the lower bounds on the constraints ([[MathCmd 760]]).
    suc (input)
    Dual variables corresponding to the upper bounds on the constraints ([[MathCmd 761]]).
    slx (input)
    Dual variables corresponding to the lower bounds on the variables ([[MathCmd 762]]).
    sux (input)
    Dual variables corresponding to the upper bounds on the variables (appears as [[MathCmd 763]]).
    snx (input)
    Dual variables corresponding to the conic constraints on the variables ([[MathCmd 764]]).
    Description:
    Inserts a solution into the task.
  • mosek.Task.putsolutioni

    Syntax:

     

    public void putsolutioni (
        accmode accmode,
        int i,
        soltype whichsol,
        stakey sk,
        double x,
        double sl,
        double su,
        double sn);
    
    accmode (input)
    If set to mosek.accmode.con the solution information for a constraint is modified. Otherwise for a variable.
    i (input)
    Index of the constraint or variable.
    whichsol (input)
    Selects a solution.
    sk (input)
    Status key of the constraint or variable.
    x (input)
    Solution value of the primal constraint or variable.
    sl (input)
    Solution value of the dual variable associated with the lower bound.
    su (input)
    Solution value of the dual variable associated with the upper bound.
    sn (input)
    Solution value of the dual variable associated with the cone constraint.
    Description:

    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 mosek.Task.makesolutionstatusunknown function, then for each relevant constraint and variable call mosek.Task.putsolutioni to set the solution information.

    See also:

     

    mosek.Task.makesolutionstatusunknown

    Sets the solution status to unknown.

  • mosek.Task.putsolutionyi

    Syntax:

     

    public void putsolutionyi (
        int i,
        soltype whichsol,
        double y);
    
    i (input)
    Index of the dual variable.
    whichsol (input)
    Selects a solution.
    y (input)
    Solution value of the dual variable.
    Description:
    Inputs the dual variable of a solution.
    See also:

     

    mosek.Task.makesolutionstatusunknown

    Sets the solution status to unknown.

    mosek.Task.putsolutioni

    Sets the primal and dual solution information for a single constraint or variable.

  • mosek.Task.putstrparam

    Syntax:

     

    public void putstrparam (
        sparam param,
        string parvalue);
    
    param (input)
    Which parameter.
    parvalue (input)
    Parameter value.
    Description:
    Sets the value of a string parameter.
  • mosek.Task.puttaskname

    Syntax:

     

    public void puttaskname (string taskname)
    
    taskname (input)
    Name assigned to the task.
    Description:
    Assigns the name taskname to the task.
  • mosek.Task.putvarbranchorder

    Syntax:

     

    public void putvarbranchorder (
        int j,
        int priority,
        int direction);
    
    j (input)
    Index of the variable.
    priority (input)
    The branching priority that should be assigned to variable j.
    direction (input)
    Specifies the preferred branching direction for variable j.
    Description:
    The purpose of the function is to assign a branching priority and direction. The higher priority that is assigned to an integer variable the earlier the mixed integer optimizer will branch on the variable. The branching direction controls if the optimizer branches up or down on the variable.
  • mosek.Task.putvartype

    Syntax:

     

    public void putvartype (
        int j,
        variabletype vartype);
    
    j (input)
    Index of the variable.
    vartype (input)
    The new variable type.
    Description:
    Sets the variable type of one variable.
    See also:

     

    mosek.Task.putvartypelist

    Sets the variable type for one or more variables.

  • mosek.Task.putvartypelist

    Syntax:

     

    public void putvartypelist (
        int[] subj,
        variabletype[] vartype);
    
    subj (input)
    A list of variable indexes for which the variable type should be changed.
    vartype (input)
    A list of variable types that should be assigned to the variables specified by subj. See section 18.55 for the possible values of vartype.
    Syntax:

     

    public void putvartypelist (
        int num,
        int[] subj,
        variabletype[] vartype);
    
    num (input)
    Number of variables for which the variable type should be set.
    subj (input)
    A list of variable indexes for which the variable type should be changed.
    vartype (input)
    A list of variable types that should be assigned to the variables specified by subj. See section 18.55 for the possible values of vartype.
    Description:

    Sets the variable type for one or more variables, i.e. variable number [[MathCmd 873]] is assigned the variable type [[MathCmd 874]].

    If the same index is specified multiple times in subj only the last entry takes effect.

    See also:

     

    mosek.Task.putvartype

    Sets the variable type of one variable.

  • mosek.Task.readbranchpriorities

    Syntax:

     

    public void readbranchpriorities (string filename)
    
    filename (input)
    Data is read from the file filename.
    Description:
    Reads branching priority data from a file.
    See also:

     

    mosek.Task.writebranchpriorities

    Writes branching priority data to a file.

  • mosek.Task.readdata

    Syntax:

     

    public void readdata (string filename)
    
    filename (input)
    Data is read from the file filename if it is a nonempty string. Otherwise data is read from the file specified by mosek.sparam.data_file_name.
    Description:

    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:

    • ".lp" and ".lp.gz" are interpreted as an LP file and a compressed LP file respectively.
    • ".opf" and ".opf.gz" are interpreted as an OPF file and a compressed OPF file respectively.
    • ".mps" and ".mps.gz" are interpreted as an MPS file and a compressed MPS file respectively.
    • ".mbt" and ".mbt.gz" are interpreted as an MBT file and a compressed MBT file respectively.
    See also:

     

    mosek.Task.writedata

    Writes problem data to a file.

    mosek.iparam.read_data_format
  • mosek.Task.readparamfile

    Syntax:

     

    public void readparamfile ()
    
    Description:
    Reads a parameter file.
  • mosek.Task.readsolution

    Syntax:

     

    public void readsolution (
        soltype whichsol,
        string filename);
    
    whichsol (input)
    Selects a solution.
    filename (input)
    A valid file name.
    Description:
    Reads a solution file and inserts the solution into the solution whichsol.
  • mosek.Task.readsummary

    Syntax:

     

    public void readsummary (streamtype whichstream)
    
    whichstream (input)
    Index of the stream.
    Description:
    Prints a short summary of last file that was read.
  • mosek.Task.relaxprimal

    Syntax:

     

    public Task relaxprimal (
        double[] wlc,
        double[] wuc,
        double[] wlx,
        double[] wux);
    
    wlc (input/output)
    Weights associated with lower bounds on the activity of constraints. If negative, the bound is strictly enforced, i.e. if [[MathCmd 875]], then [[MathCmd 537]] is fixed to zero. On return wlc[i] contains the relaxed bound.
    wuc (input/output)
    Weights associated with upper bounds on the activity of constraints. If negative, the bound is strictly enforced, i.e. if [[MathCmd 877]], then [[MathCmd 538]] is fixed to zero. On return wuc[i] contains the relaxed bound.
    wlx (input/output)
    Weights associated with lower bounds on the activity of variables. If negative, the bound is strictly enforced, i.e. if [[MathCmd 879]] then [[MathCmd 880]] is fixed to zero. On return wlx[i] contains the relaxed bound.
    wux (input/output)
    Weights associated with upper bounds on the activity of variables. If negative, the bound is strictly enforced, i.e. if [[MathCmd 881]] then [[MathCmd 882]] is fixed to zero. On return wux[i] contains the relaxed bound.
    Syntax:

     

    public void relaxprimal (
        out Task relaxedtask,
        double[] wlc,
        double[] wuc,
        double[] wlx,
        double[] wux);
    
    relaxedtask (output)
    The returned task.
    wlc (input/output)
    Weights associated with lower bounds on the activity of constraints. If negative, the bound is strictly enforced, i.e. if [[MathCmd 875]], then [[MathCmd 537]] is fixed to zero. On return wlc[i] contains the relaxed bound.
    wuc (input/output)
    Weights associated with upper bounds on the activity of constraints. If negative, the bound is strictly enforced, i.e. if [[MathCmd 877]], then [[MathCmd 538]] is fixed to zero. On return wuc[i] contains the relaxed bound.
    wlx (input/output)
    Weights associated with lower bounds on the activity of variables. If negative, the bound is strictly enforced, i.e. if [[MathCmd 879]] then [[MathCmd 880]] is fixed to zero. On return wlx[i] contains the relaxed bound.
    wux (input/output)
    Weights associated with upper bounds on the activity of variables. If negative, the bound is strictly enforced, i.e. if [[MathCmd 881]] then [[MathCmd 882]] is fixed to zero. On return wux[i] contains the relaxed bound.
    Description:

    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

    \begin{math}\nonumber{}\begin{array}{lccccl}\nonumber{}\mbox{minimize} &  &  & c^{T}x &  & \\\nonumber{}\mbox{subject to} & l^{c} & \leq{} & Ax & \leq{} & u^{c},\\\nonumber{} & l^{x} & \leq{} & x & \leq{} & u^{x},\end{array}\end{math} (15.9.31)

    the function forms a new task relaxedtask having the form

    \begin{math}\nonumber{}\begin{array}{lccccl}\nonumber{}\mbox{minimize} &  &  & p &  & \\\nonumber{}\mbox{subject to} & l^{c} & \leq{} & Ax+v_{l}^{c}-v_{u}^{c} & \leq{} & u^{c},\\\nonumber{} & l^{x} & \leq{} & x+v_{l}^{x}-v_{u}^{x} & \leq{} & u^{x},\\\nonumber{} &  &  & (w_{l}^{c})^{T}v_{l}^{c}+(w_{u}^{c})^{T}v_{u}^{c}+(w_{l}^{x})^{T}v_{l}^{x}+(w_{u}^{x})^{T}v_{u}^{x}-p & \leq{} & 0,\\\nonumber{} &  &  & v_{l}^{c},v_{u}^{c},v_{l}^{x},v_{u}^{x}\geq{}0. &  &\end{array}\end{math} (15.9.32)

    Hence, the function adds so-called elasticity variables to all the constraints which relax the constraints, for instance [[MathCmd 537]] and [[MathCmd 538]] relax [[MathCmd 542]] and [[MathCmd 896]] respectively. It should be obvious that (15.9.32) is feasible. Moreover, the function adds the constraint

    \begin{displaymath}\nonumber{}(w_{l}^{c})^{T}v_{l}^{c}+(w_{u}^{c})^{T}v_{u}^{c}+(w_{l}^{x})^{T}v_{l}^{x}+(w_{u}^{x})^{T}v_{u}^{x}-p\leq{}0\end{displaymath}

    to the problem which makes the variable p bigger than the total weighted sum of the relaxation to the bounds. [[MathCmd 546]], [[MathCmd 547]], [[MathCmd 548]] and [[MathCmd 549]] 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 (15.9.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 [[MathCmd 875]] then [[MathCmd 537]] is fixed to zero.

    Now let [[MathCmd 552]] be the optimal objective value to (15.9.32), then a natural thing to do is to solve the optimization problem

    \begin{math}\nonumber{}\begin{array}{lccccl}\nonumber{}\mbox{minimize} &  &  & c^{T}x &  & \\\nonumber{}\mbox{subject to} & l^{c} & \leq{} & Ax+v_{l}^{c}-v_{u}^{c} & \leq{} & u^{c},\\\nonumber{} & l^{x} & \leq{} & x+v_{l}^{x}-v_{u}^{x} & \leq{} & u^{x},\\\nonumber{} &  &  & (w_{l}^{c})^{T}v_{l}^{c}+(w_{u}^{c})^{T}v_{u}^{c}+(w_{l}^{x})^{T}v_{l}^{x}+(w_{u}^{x})^{T}v_{u}^{x}-p & \leq{} & 0,\\\nonumber{} &  &  & p & = & p^{*},\\\nonumber{} &  &  & v_{l}^{c},v_{u}^{c},v_{l}^{x},v_{u}^{x}\geq{}0, &  &\end{array}\end{math} (15.9.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 (15.9.32) or the problem (15.9.33).The parameter can take one of the following values.

    mosek.feasrepairtype.optimize_none

    : The returned task relaxedtask contains problem (15.9.32) and is not optimized.

    mosek.feasrepairtype.optimize_penalty

    : The returned task relaxedtask contains problem (15.9.32) and is optimized.

    mosek.feasrepairtype.optimize_combined

    : The returned task relaxedtask contains problem (15.9.33) and is optimized.

    Please note that the v variables are appended to the x variables ordered as

    \begin{displaymath}\nonumber{}(v_{u}^{c})_{1},(v_{l}^{c})_{1},(v_{u}^{c})_{2},(v_{l}^{c})_{2},\ldots ,(v_{u}^{c})_{m},(v_{l}^{c})_{m},\quad{}(v_{u}^{x})_{1},(v_{l}^{x})_{1},(v_{u}^{x})_{2},(v_{l}^{x})_{2},\ldots ,(v_{u}^{x})_{n},(v_{l}^{x})_{n}\end{displaymath}

    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:

    • The variable corresponding to [[MathCmd 538]] ([[MathCmd 908]]) is named “NAME_CON*up” (“NAME_VAR*up”).
    • The variable corresponding to [[MathCmd 537]] ([[MathCmd 539]]) is named “NAME_CON*lo” (“NAME_VAR*lo”).

    where “*” can be replaced by a user-defined string by setting the mosek.sparam.feasrepair_name_separator parameter.

    Please note that if [[MathCmd 911]] or [[MathCmd 912]] then the feasibility repair problem becomes infeasible. Such trivial conflicts must therefore be removed manually before using mosek.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.

    See also:

     

    mosek.dparam.feasrepair_tol
    mosek.iparam.feasrepair_optimize
    mosek.sparam.feasrepair_name_separator
    mosek.sparam.feasrepair_name_prefix
  • mosek.Task.remove

    Syntax:

     

    public void remove (
        accmode accmode,
        int[] sub);
    
    accmode (input)
    Defines if operations are performed row-wise (constraint-oriented) or column-wise (variable-oriented).
    sub (input)
    Indexes of constraints or variables which should be removed.
    Syntax:

     

    public void remove (
        accmode accmode,
        int num,
        int[] sub);
    
    accmode (input)
    Defines if operations are performed row-wise (constraint-oriented) or column-wise (variable-oriented).
    num (input)
    Number of constraints or variables which should be removed.
    sub (input)
    Indexes of constraints or variables which should be removed.
    Description:
    The function removes a number of constraints or variables from the optimization task. This implies that the existing constraints and variables are renumbered, for instance if constraint 5 is removed then constraint 6 becomes constraint 5 and so forth.
    See also:

     

    mosek.Task.append

    Appends a number of variables or constraints to the optimization task.

  • mosek.Task.removecone

    Syntax:

     

    public void removecone (int k)
    
    k (input)
    Index of the conic constraint that should be removed.
    Description:

    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.

  • mosek.Task.resizetask

    Syntax:

     

    public void resizetask (
        int maxnumcon,
        int maxnumvar,
        int maxnumcone,
        int maxnumanz,
        int maxnumqnz);
    
    maxnumcon (input)
    New maximum number of constraints.
    maxnumvar (input)
    New maximum number of variables.
    maxnumcone (input)
    New maximum number of cones.
    maxnumanz (input)
    New maximum number of non-zeros in A.
    maxnumqnz (input)
    New maximum number of non-zeros in all Q matrices.
    Description:

    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.

    See also:

     

    mosek.Task.putmaxnumvar

    Sets the number of preallocated variables in the optimization task.

    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.putmaxnumanz

    The function changes the size of the preallocated storage for linear coefficients.

    mosek.Task.putmaxnumqnz

    Changes the size of the preallocated storage for quadratic terms.

  • mosek.Task.sensitivityreport

    Syntax:

     

    public void sensitivityreport (streamtype whichstream)
    
    whichstream (input)
    Index of the stream.
    Description:
    Reads a sensitivity format file from a location given by mosek.sparam.sensitivity_file_name and writes the result to the stream whichstream. If mosek.sparam.sensitivity_res_file_name is set to a non-empty string, then the sensitivity report is also written to a file of this name.
    See also:

     

    mosek.Task.dualsensitivity

    Performs sensitivity analysis on objective coefficients.

    mosek.Task.primalsensitivity

    Perform sensitivity analysis on bounds.

    mosek.iparam.log_sensitivity
    mosek.iparam.log_sensitivity_opt
    mosek.iparam.sensitivity_type
  • mosek.Task.set_Stream

    Syntax:

     

    public void set_Stream (
        streamtype whichstream,
        Stream stream);
    
    whichstream
    Index of the stream.
    stream
    The stream object to attach. To detach all objects, let this be null.
    Description:
    Attach a stream call-back handler.
  • mosek.Task.setdefaults

    Syntax:

     

    public void setdefaults ()
    
    Description:
    Resets all the parameters to their default values.
  • mosek.Task.sktostr

    Syntax:

     

    public void sktostr (
        int sk,
        StringBuilder str);
    
    sk (input)
    A valid status key.
    str (output)
    String corresponding to the status key sk.
    Description:
    Obtains an explanatory string corresponding to a status key.
  • mosek.Task.solstatostr

    Syntax:

     

    public void solstatostr (
        solsta solsta,
        StringBuilder str);
    
    solsta (input)
    Solution status.
    str (output)
    String corresponding to the solution status solsta.
    Description:
    Obtains an explanatory string corresponding to a solution status.
  • mosek.Task.solutiondef

    Syntax:

     

    public int solutiondef (soltype whichsol)
    
    whichsol (input)
    Selects a solution.
    Syntax:

     

    public void solutiondef (
        soltype whichsol,
        out int isdef);
    
    whichsol (input)
    Selects a solution.
    isdef (output)
    Is non-zero if the requested solution is defined.
    Description:
    Checks whether a solution is defined.
  • mosek.Task.solutionsummary

    Syntax:

     

    public void solutionsummary (streamtype whichstream)
    
    whichstream (input)
    Index of the stream.
    Description:
    Prints a short summary of the current solutions. Please see Section 8.7 for more details.
  • mosek.Task.solvewithbasis

    Syntax:

     

    public void solvewithbasis (
        int transp,
        ref int numnz,
        int[] sub,
        double[] val);
    
    transp (input)
    If this argument is non-zero, then (15.9.35) is solved. Otherwise the system (15.9.34) is solved.
    numnz (input/output)
    As input it is the number of non-zeros in b. As output it is the number of non-zeros in [[MathCmd 420]].
    sub (input/output)

    As input it contains the positions of the non-zeros in b, i.e.

    \begin{displaymath}\nonumber{}b[\mathtt{sub}[k]]\not=0,~k=0,\ldots ,\mathtt{numnz[0]}-1.\end{displaymath}

    As output it contains the positions of the non-zeros in [[MathCmd 420]]. It is important that sub has room for numcon elements.

    val (input/output)

    As input it is the vector b. Although the positions of the non-zero elements are specified in sub it is required that [[MathCmd 916]] if b[i]=0. As output val is the vector [[MathCmd 420]].

    Please note that val is a dense vector — not a packed sparse vector. This implies that val has room for numcon elements.

    Description:

    If a basic solution is available, then exactly [[MathCmd 18]] basis variables are defined. These [[MathCmd 18]] basis variables are denoted the basis. Associated with the basis is a basis matrix denoted B. This function solves either the linear equation system

    \begin{math}\nonumber{}B\bar{x}=b\end{math} (15.9.34)

    or the system

    \begin{math}\nonumber{}B^{T}\bar{x}=b\end{math} (15.9.35)

    for the unknowns [[MathCmd 420]], with b being a user-defined vector.

    In order to make sense of the solution [[MathCmd 420]] it is important to know the ordering of the variables in the basis because the ordering specifies how B is constructed. When calling mosek.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 [[MathCmd 157]] it implies that

    \begin{displaymath}\nonumber{}B_{{i,k}}=A_{{i,j}},~i=0,\ldots ,\mathtt{numcon}-1.\end{displaymath}

    Otherwise if the kth basis variable is variable [[MathCmd 926]] it implies that`

    \begin{displaymath}\nonumber{}B_{{i,k}}=\left\lbrace{}\begin{array}{ll}\nonumber{}-1, & i=j,\\\nonumber{}0, & i\not=j.\end{array}\right.\end{displaymath}

    Given the knowledge of how B is constructed it is possible to interpret the solution [[MathCmd 420]] correctly.

    Please note that this function exploits the sparsity in the vector b to speed up the computations.

    See also:

     

    mosek.Task.initbasissolve

    Prepare a task for basis solver.

    mosek.iparam.basis_solve_use_plus_one
  • mosek.Task.strtoconetype

    Syntax:

     

    public void strtoconetype (
        string str,
        out conetype conetype);
    
    str (input)
    String corresponding to the cone type code codetype.
    conetype (output)
    The cone type corresponding to the string str.
    Description:
    Obtains cone type code corresponding to a cone type string.
  • mosek.Task.strtosk

    Syntax:

     

    public void strtosk (
        string str,
        out int sk);
    
    str (input)
    Status key string.
    sk (output)
    Status key corresponding to the string.
    Description:
    Obtains the status key corresponding to an explanatory string.
  • mosek.Task.undefsolution

    Syntax:

     

    public void undefsolution (soltype whichsol)
    
    whichsol (input)
    Selects a solution.
    Description:
    Undefines a solution. Purges all information regarding whichsol.
  • mosek.Task.writebranchpriorities

    Syntax:

     

    public void writebranchpriorities (string filename)
    
    filename (input)
    Data is written to the file filename.
    Description:
    Writes branching priority data to a file.
    See also:

     

    mosek.Task.readbranchpriorities

    Reads branching priority data from a file.

  • mosek.Task.writedata

    Syntax:

     

    public void writedata (string filename)
    
    filename (input)
    Data is written to the file filename if it is a nonempty string. Otherwise data is written to the file specified by mosek.sparam.data_file_name.
    Description:

    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 D.

    MPS : A text based column oriented format. File extension .mps. See Appendix C.

    OPF : A text based row oriented format. File extension .opf. Supports more problem types than MPS and LP. See Appendix E.

    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.

    See also:

     

    mosek.Task.readdata

    Reads problem data from a file.

    mosek.iparam.write_data_format
  • mosek.Task.writeparamfile

    Syntax:

     

    public void writeparamfile (string filename)
    
    filename (input)
    The name of parameter file.
    Description:
    Writes all the parameters to a parameter file.
  • mosek.Task.writesolution

    Syntax:

     

    public void writesolution (
        soltype whichsol,
        string filename);
    
    whichsol (input)
    Selects a solution.
    filename (input)
    A valid file name.
    Description:
    Saves the current basic, interior-point, or integer solution to a file.

15.10. Class mosek.Warning

Derived from:

mosek.Exception

Description:

This is an exception class representing MOSEK warnings.

15.10.1. Constructors

  • mosek.Warning
    Syntax:

     

    public Warning (rescode code)
    
    Description:
    Construct a warning from a MOSEK error code.
    Arguments:

     

    code
    The MOSEK response code to create the exception from.
Wed Feb 29 16:04:38 2012