15. API reference


This chapter lists all functionality in the MOSEK C API.

15.1. Type definitions

15.2. API Functionality

Functions in the interface grouped by functionality.

15.2.1. Analyzing the problem and associated data

Analyzing the problem and associated data.

MSK_analyzeproblem
Analyze the data of a task.

MSK_analyzesolution
Print information related to the quality of the solution.

15.2.2. Reading and writing data files

Reading and writing data files.

MSK_readbranchpriorities
Reads branching priority data from a file.

MSK_readdata
Reads problem data from a file.

MSK_readparamfile
Reads a parameter file.

MSK_readsolution
Reads a solution from a file.

MSK_writebranchpriorities
Writes branching priority data to a file.

MSK_writedata
Writes problem data to a file.

MSK_writeparamfile
Writes all the parameters to a parameter file.

MSK_writesolution
Write a solution to a file.

15.2.3. Solutions

Obtain or define a solution.

MSK_deletesolution
Undefines a solution and frees the memory it uses.

MSK_getdbi
Obtains the dual bound infeasibility.

MSK_getdcni
Obtains the dual cone infeasibility.

MSK_getdeqi
Optains the dual equation infeasibility.

MSK_getdualobj
Obtains the dual objective value.

MSK_getinti
Obtains the primal equation infeasibility.

MSK_getpbi
Obtains the primal bound infeasibility.

MSK_getpcni
Obtains the primal cone infeasibility.

MSK_getpeqi
Obtains the primal equation infeasibility.

MSK_getprimalobj
Obtains the primal objective value.

MSK_getreducedcosts
Obtains the difference of (slx-sux) for a sequence of variables.

MSK_getsolution
Obtains the complete solution.

MSK_getsolutioni
Obtains the solution for a single constraint or variable.

MSK_getsolutionincallback
Obtains the whole or a part of the solution from the progress call-back function.

MSK_getsolutioninf
Obtains information about a solution.

MSK_getsolutionslice
Obtains a slice of the solution.

MSK_getsolutionstatus
Obtains information about the problem and solution statuses.

MSK_getsolutionstatuskeyslice
Obtains a slice of the solution status keys.

MSK_makesolutionstatusunknown
Sets the solution status to unknown.

MSK_optimizersummary
Prints a short summary with optimizer statistics for last optimization.

MSK_putsolution
Inserts a solution.

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

MSK_readsolution
Reads a solution from a file.

MSK_solstatostr
Obtains a solution status string.

MSK_solutiondef
Checks whether a solution is defined.

MSK_solutionsummary
Prints a short summary of the current solutions.

MSK_undefsolution
Undefines a solution.

15.2.4. Call-backs (put/get)

Manipulating call-backs.

MSK_getcallbackfunc
Obtains the call-back function and the associated user handle.

MSK_getnlfunc
Gets nonlinear call-back functions.

MSK_getsolutionincallback
Obtains the whole or a part of the solution from the progress call-back function.

MSK_linkfunctoenvstream
Connects a user-defined function to a stream.

MSK_linkfunctotaskstream
Connects a user-defined function to a task stream.

MSK_putcallbackfunc
Input the progress call-back function.

MSK_putexitfunc
Inputs a user-defined exit function which is called in case of fatal errors.

MSK_putnlfunc
Inputs nonlinear function information.

MSK_putresponsefunc
Inputs a user-defined error call-back function.

MSK_unlinkfuncfromenvstream
Disconnects a user-defined function from a stream.

MSK_unlinkfuncfromtaskstream
Disconnects a user-defined function from a task stream.

15.2.5. Memory allocation and deallocation

Memory allocation and deallocation.

MSK_callocdbgenv
A replacement for the system calloc function.

MSK_callocdbgtask
A replacement for the system calloc function.

MSK_callocenv
A replacement for the system calloc function.

MSK_calloctask
A replacement for the system calloc function.

MSK_checkmemenv
Checks the memory allocated by the environment.

MSK_checkmemtask
Checks the memory allocated by the task.

MSK_freedbgenv
Frees space allocated by MOSEK.

MSK_freedbgtask
Frees space allocated by MOSEK.

MSK_freeenv
Frees space allocated by MOSEK.

MSK_freetask
Frees space allocated by MOSEK.

MSK_getmemusagetask
Obtains information about the amount of memory used by a task.

MSK_getmemusagetask64
Obtains information about the amount of memory used by a task.

15.2.6. Changing problem specification

Input or change problem specification.

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

MSK_appendcone
Appends a new cone constraint to the problem.

MSK_checkoutlicense
Check out a license feature from the license server ahead of time.

MSK_chgbound
Changes the bounds for one constraint or variable.

MSK_clonetask
Creates a clone of an existing task.

MSK_commitchanges
Commits all cached problem changes.

MSK_inputdata
Input the linear part of an optimization task in one function call.

MSK_inputdata64
Input the linear part of an optimization task in one function call.

MSK_putaij
Changes a single value in the linear coefficient matrix.

MSK_putaijlist
Changes one or more coefficients in the linear constraint matrix.

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

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

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

MSK_putbound
Changes the bound for either one constraint or one variable.

MSK_putboundlist
Changes the bounds of constraints or variables.

MSK_putboundslice
Modifies bounds.

MSK_putcfix
Replaces the fixed term in the objective.

MSK_putcj
Modifies one linear coefficient in the objective.

MSK_putclist
Modifies a part of the linear objective coefficients.

MSK_putcone
Replaces a conic constraint.

MSK_putobjsense
Sets the objective sense.

MSK_putqcon
Replaces all quadratic terms in constraints.

MSK_putqconk
Replaces all quadratic terms in a single constraint.

MSK_putqobj
Replaces all quadratic terms in the objective.

MSK_putqobjij
Replaces one coefficient in the quadratic term in the objective.

MSK_putvartype
Sets the variable type of one variable.

MSK_putvartypelist
Sets the variable type for one or more variables.

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

Functionality for deleting problem elements such as variables, constraints or cones.

MSK_remove
The function removes a number of constraints or variables.

MSK_removecone
Removes a conic constraint from the problem.

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

Functionality for adding problem elements such as variables, constraints or cones.

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

MSK_appendcone
Appends a new cone constraint to the problem.

15.2.9. Problem inspection

Functionality for inspecting the problem specification (A,Q, bounds, objective e.t.c).

MSK_getaij
Obtains a single coefficient in linear constraint matrix.

MSK_getaslice
Obtains a sequence of rows or columns from the coefficient matrix.

MSK_getaslice64
Obtains a sequence of rows or columns from the coefficient matrix.

MSK_getaslicetrip
Obtains a sequence of rows or columns from the coefficient matrix in triplet format.

MSK_getavec
Obtains one row or column of the linear constraint matrix.

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

MSK_getbound
Obtains bound information for one constraint or variable.

MSK_getboundslice
Obtains bounds information for a sequence of variables or constraints.

MSK_getc
Obtains all objective coefficients.

MSK_getcfix
Obtains the fixed term in the objective.

MSK_getcone
Obtains a conic constraint.

MSK_getconeinfo
Obtains information about a conic constraint.

MSK_getcslice
Obtains a sequence of coefficients from the objective.

MSK_getintpntnumthreads
Obtains the number of threads used by the interior-point optimizer.

MSK_getnumanz
Obtains the number of non-zeros in the coefficient matrix.

MSK_getnumanz64
Obtains the number of non-zeros in the coefficient matrix.

MSK_getnumcon
Obtains the number of constraints.

MSK_getnumcone
Obtains the number of cones.

MSK_getnumconemem
Obtains the number of members in a cone.

MSK_getnumintvar
Obtains the number of integer-constrained variables.

MSK_getnumqconknz
Obtains the number of non-zero quadratic terms in a constraint.

MSK_getnumqconknz64
Obtains the number of non-zero quadratic terms in a constraint.

MSK_getnumqobjnz
Obtains the number of non-zero quadratic terms in the objective.

MSK_getnumqobjnz64
Obtains the number of non-zero quadratic terms in the objective.

MSK_getnumvar
Obtains the number of variables.

MSK_getobjsense
Gets the objective sense.

MSK_getprobtype
Obtains the problem type.

MSK_getqconk
Obtains all the quadratic terms in a constraint.

MSK_getqconk64
Obtains all the quadratic terms in a constraint.

MSK_getqobj
Obtains all the quadratic terms in the objective.

MSK_getqobj64
Obtains all the quadratic terms in the objective.

MSK_getqobjij
Obtains one coefficient from the quadratic term of the objective

MSK_getvartype
Gets the variable type of one variable.

MSK_getvartypelist
Obtains the variable type for one or more variables.

15.2.10. Conic constraints

Functionality related to conic terms in the problem.

MSK_appendcone
Appends a new cone constraint to the problem.

MSK_getcone
Obtains a conic constraint.

MSK_getconeinfo
Obtains information about a conic constraint.

MSK_getnumcone
Obtains the number of cones.

MSK_putcone
Replaces a conic constraint.

MSK_removecone
Removes a conic constraint from the problem.

15.2.11. Bounds

Functionality related to changing or inspecting bounds on variables or constraints.

MSK_chgbound
Changes the bounds for one constraint or variable.

MSK_getbound
Obtains bound information for one constraint or variable.

MSK_getboundslice
Obtains bounds information for a sequence of variables or constraints.

MSK_putbound
Changes the bound for either one constraint or one variable.

MSK_putboundlist
Changes the bounds of constraints or variables.

MSK_putboundslice
Modifies bounds.

15.2.12. Task initialization and deletion

Task initialization and deletion.

MSK_deletetask
Deletes an optimization task.

MSK_makeemptytask
Creates a new and empty optimization task.

MSK_maketask
Creates a new optimization task.

15.2.13. Error handling

Error handling.

MSK_exceptiontask
Echo a response code to a task stream.

MSK_getcodedesc
Obtains a short description of a response code.

MSK_getcodedisc
Obtains a short description of a response code.

MSK_getresponseclass
Obtain the class of a response code.

MSK_putresponsefunc
Inputs a user-defined error call-back function.

15.2.14. Output stream functions

Output stream functions.

MSK_echoenv
Sends a message to a given environment stream.

MSK_echointro
Prints an intro to message stream.

MSK_echotask
Prints a format string to a task stream.

MSK_exceptiontask
Echo a response code to a task stream.

MSK_linkfiletoenvstream
Directs all output from a stream to a file.

MSK_linkfiletotaskstream
Directs all output from a task stream to a file.

MSK_linkfunctoenvstream
Connects a user-defined function to a stream.

MSK_linkfunctotaskstream
Connects a user-defined function to a task stream.

MSK_optimizersummary
Prints a short summary with optimizer statistics for last optimization.

MSK_printdata
Prints a part of the problem data to a stream.

MSK_printparam
Prints the current parameter settings.

MSK_readsummary
Prints information about last file read.

MSK_solutionsummary
Prints a short summary of the current solutions.

MSK_unlinkfuncfromenvstream
Disconnects a user-defined function from a stream.

MSK_unlinkfuncfromtaskstream
Disconnects a user-defined function from a task stream.

15.2.15. Objective function

Change or inspect objective function.

MSK_getc
Obtains all objective coefficients.

MSK_getcfix
Obtains the fixed term in the objective.

MSK_getcslice
Obtains a sequence of coefficients from the objective.

MSK_getdualobj
Obtains the dual objective value.

MSK_getnumqobjnz
Obtains the number of non-zero quadratic terms in the objective.

MSK_getnumqobjnz64
Obtains the number of non-zero quadratic terms in the objective.

MSK_getobjname
Obtains the name assigned to the objective function.

MSK_getobjname64
Obtains the name assigned to the objective function.

MSK_getobjsense
Gets the objective sense.

MSK_getprimalobj
Obtains the primal objective value.

MSK_getqobj
Obtains all the quadratic terms in the objective.

MSK_getqobj64
Obtains all the quadratic terms in the objective.

MSK_getqobjij
Obtains one coefficient from the quadratic term of the objective

MSK_putcfix
Replaces the fixed term in the objective.

MSK_putcj
Modifies one linear coefficient in the objective.

MSK_putclist
Modifies a part of the linear objective coefficients.

MSK_putobjsense
Sets the objective sense.

MSK_putqobj
Replaces all quadratic terms in the objective.

MSK_putqobjij
Replaces one coefficient in the quadratic term in the objective.

15.2.16. Optimizer statistics

Inspect statistics from the optimizer.

MSK_getdouinf
Obtains a double information item.

MSK_getinfindex
Obtains the index of a named information item.

MSK_getinfmax
Obtains the maximum index of an information of a given type inftype plus 1.

MSK_getinfname
Obtains the name of an information item.

MSK_getintinf
Obtains an integer information item.

MSK_getlintinf
Obtains an integer information item.

MSK_getnadouinf
Obtains a double information item.

MSK_getnaintinf
Obtains an integer information item.

MSK_getnaintparam
Obtains an integer parameter.

15.2.17. Parameters (set/get)

Setting and inspecting solver parameters.

MSK_getdouparam
Obtains a double parameter.

MSK_getintparam
Obtains an integer parameter.

MSK_getnadouparam
Obtains a double parameter.

MSK_getnastrparam
Obtains a string parameter.

MSK_getnastrparamal
Obtains the value of a string parameter.

MSK_getnumparam
Obtains the number of parameters of a given type.

MSK_getparammax
Obtains the maximum index of a parameter of a given type plus 1.

MSK_getparamname
Obtains the name of a parameter.

MSK_getstrparam
Obtains the value of a string parameter.

MSK_getstrparam64
Obtains the value of a string parameter.

MSK_getstrparamal
Obtains the value a string parameter.

MSK_getsymbcondim
Obtains dimensional information for the defined symbolic constants.

MSK_iparvaltosymnam
Obtains the symbolic name corresponding to a value that can be assigned to an integer parameter.

MSK_isdouparname
Checks a double parameter name.

MSK_isintparname
Checks an integer parameter name.

MSK_isstrparname
Checks a string parameter name.

MSK_putdouparam
Sets a double parameter.

MSK_putintparam
Sets an integer parameter.

MSK_putnadouparam
Sets a double parameter.

MSK_putnaintparam
Sets an integer parameter.

MSK_putnastrparam
Sets a string parameter.

MSK_putparam
Modifies the value of parameter.

MSK_putstrparam
Sets a string parameter.

MSK_setdefaults
Resets all parameters values.

MSK_symnamtovalue
Obtains the value corresponding to a symbolic name defined by MOSEK.

MSK_whichparam
Checks a parameter name.

15.2.18. Naming

Functionality related to naming.

MSK_getconname
Obtains a name of a constraint.

MSK_getconname64
Obtains a name of a constraint.

MSK_getmaxnamelen
Obtains the maximum length (not including terminating zero character) of any objective, constraint, variable or cone name.

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

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

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

MSK_getnameindex
Checks whether a name has been assigned and returns the index corresponding to the name.

MSK_getnamelen64
Obtains the length of a problem item name.

MSK_getobjname
Obtains the name assigned to the objective function.

MSK_getobjname64
Obtains the name assigned to the objective function.

MSK_gettaskname
Obtains the task name.

MSK_gettaskname64
Obtains the task name.

MSK_getvarname
Obtains a name of a variable.

MSK_getvarname64
Obtains a name of a variable.

MSK_putname
Assigns a name to a problem item.

MSK_putobjname
Assigns a new name to the objective.

MSK_puttaskname
Assigns a new name to the task.

15.2.19. Preallocating space for problem data

Functionality related to preallocating space for problem data.

MSK_getmaxnumanz
Obtains number of preallocated non-zeros in the linear constraint matrix.

MSK_getmaxnumanz64
Obtains number of preallocated non-zeros in the linear constraint matrix.

MSK_getmaxnumcon
Obtains the number of preallocated constraints in the optimization task.

MSK_getmaxnumcone
Obtains the number of preallocated cones in the optimization task.

MSK_getmaxnumqnz
Obtains the number of preallocated non-zeros for all quadratic terms in objective and constraints.

MSK_getmaxnumqnz64
Obtains the number of preallocated non-zeros for all quadratic terms in objective and constraints.

MSK_getmaxnumvar
Obtains the maximum number variables allowed.

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

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

MSK_putmaxnumcon
Sets the number of preallocated constraints in the optimization task.

MSK_putmaxnumcone
Sets the number of preallocated conic constraints in the optimization task.

MSK_putmaxnumqnz
Changes the size of the preallocated storage for quadratic terms.

MSK_putmaxnumqnz64
Changes the size of the preallocated storage for quadratic terms.

MSK_putmaxnumvar
Sets the number of preallocated variables in the optimization task.

15.2.20. Integer variables

Functionality related to integer variables.

MSK_getnumintvar
Obtains the number of integer-constrained variables.

MSK_getvarbranchdir
Obtains the branching direction for a variable.

MSK_getvarbranchorder
Obtains the branching priority for a variable.

MSK_getvarbranchpri
Obtains the branching priority for a variable.

MSK_getvartype
Gets the variable type of one variable.

MSK_getvartypelist
Obtains the variable type for one or more variables.

MSK_putvarbranchorder
Assigns a branching priority and direction to a variable.

MSK_putvartype
Sets the variable type of one variable.

MSK_putvartypelist
Sets the variable type for one or more variables.

15.2.21. Quadratic terms

Functionality related to quadratic terms.

MSK_getqconk
Obtains all the quadratic terms in a constraint.

MSK_getqconk64
Obtains all the quadratic terms in a constraint.

MSK_getqobj
Obtains all the quadratic terms in the objective.

MSK_getqobj64
Obtains all the quadratic terms in the objective.

MSK_getqobjij
Obtains one coefficient from the quadratic term of the objective

MSK_putqcon
Replaces all quadratic terms in constraints.

MSK_putqconk
Replaces all quadratic terms in a single constraint.

MSK_putqobj
Replaces all quadratic terms in the objective.

MSK_putqobjij
Replaces one coefficient in the quadratic term in the objective.

15.2.22. Diagnosing infeasibility

Functions for diagnosing infeasibility.

MSK_getinfeasiblesubproblem
Obtains an infeasible sub problem.

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

15.2.23. Optimization

Functions for optimization.

MSK_checkdata
Checks data of the task.

MSK_netoptimize
Optimizes a pure network flow problem.

MSK_optimize
Optimizes the problem.

MSK_optimizeconcurrent
Optimize a given task with several optimizers concurrently.

MSK_optimizetrm
Optimizes the problem.

15.2.24. Network optimization

Functions for network optimization.

MSK_netextraction
Finds embedded network structure.

MSK_netoptimize
Optimizes a pure network flow problem.

15.2.25. Sensitivity analysis

Functions for sensitivity analysis.

MSK_dualsensitivity
Performs sensitivity analysis on objective coefficients.

MSK_primalsensitivity
Perform sensitivity analysis on bounds.

MSK_sensitivityreport
Creates a sensitivity report.

15.2.26. Testing data validity

Functions for testing data validity.

MSK_checkconvexity
Checks if a quadratic optimization problem is convex.

15.2.27. Solving with the basis

Functions for solving linear systems with the basis matrix.

MSK_basiscond
Computes conditioning information for the basis matrix.

MSK_initbasissolve
Prepare a task for basis solver.

MSK_solvewithbasis
Solve a linear equation system involving a basis matrix.

15.2.28. Initialization of environment

Creation and initialization of environment.

MSK_checkinlicense
Check in a license feature from the license server ahead of time.

MSK_deleteenv
Delete a MOSEK environment.

MSK_initenv
Initialize a MOSEK environment.

MSK_makeenv
Creates a new MOSEK environment.

MSK_putlicensedefaults
Set defaults used by the license manager.

15.2.29. Change A

Change elements in the coefficient (A) matrix.

MSK_checkoutlicense
Check out a license feature from the license server ahead of time.

MSK_commitchanges
Commits all cached problem changes.

MSK_putaij
Changes a single value in the linear coefficient matrix.

MSK_putaijlist
Changes one or more coefficients in the linear constraint matrix.

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

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

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

15.3. Mosek Env

Description:

A Mosek Environment

15.3.1. Methods

  • MSK_callocdbgenv

    Syntax:

     

    void * MSK_callocdbgenv (
        MSKenv_t env,
        MSKCONST size_t number,
        MSKCONST size_t size,
        MSKCONST char * file,
        MSKCONST unsigned line);
    
    env (input)
    The MOSEK environment.
    number (input)
    Number of elements.
    size (input)
    Size of each individual element.
    file (input)
    File from which the function is called.
    line (input)
    Line in the file from which the function is called.
    Description:
    Debug version of MSK_callocenv.
  • MSK_callocenv

    Syntax:

     

    void * MSK_callocenv (
        MSKenv_t env,
        MSKCONST size_t number,
        MSKCONST size_t size);
    
    env (input)
    The MOSEK environment.
    number (input)
    Number of elements.
    size (input)
    Size of each individual element.
    Description:
    Equivalent to calloc i.e. allocate space for an array of length number where each element is of size size.
  • MSK_checkinlicense

    Syntax:

     

    MSKrescodee MSK_checkinlicense (
        MSKenv_t env,
        MSKfeaturee feature);
    
    env (input)
    The MOSEK environment.
    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 MSK_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.

  • MSK_checkmemenv

    Syntax:

     

    MSKrescodee MSK_checkmemenv (
        MSKenv_t env,
        MSKCONST char * file,
        MSKintt line);
    
    env (input)
    The MOSEK environment.
    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 environment.
  • MSK_checkoutlicense

    Syntax:

     

    MSKrescodee MSK_checkoutlicense (
        MSKenv_t env,
        MSKfeaturee feature);
    
    env (input)
    The MOSEK environment.
    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 MSK_optimizetrm. This function can be used to check out one or more features ahead of time.

    The license will remain checked out until the environment is deleted with MSK_deleteenv or the function MSK_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.

  • MSK_checkversion

    Syntax:

     

    MSKrescodee MSK_checkversion (
        MSKenv_t env,
        MSKintt major,
        MSKintt minor,
        MSKintt build,
        MSKintt revision);
    
    env (input)
    The MOSEK environment.
    major (input)
    Major version number.
    minor (input)
    Minor version number.
    build (input)
    Build number.
    revision (input)
    Revision number.
    Description:
    Compares the version of the MOSEK DLL with a specified version. Normally the specified version is the version at the build time.
  • MSK_deleteenv

    Syntax:

     

    MSKrescodee MSK_deleteenv (MSKenv_t * env)
    
    env (input/output)
    The MOSEK environment.
    Description:

    Deletes a MOSEK environment and all the data associated with it.

    Before calling this function it is a good idea to call the function MSK_unlinkfuncfromenvstream for each stream that has have had function linked to it.

  • MSK_echoenv

    Syntax:

     

    MSKrescodee MSK_echoenv (
        MSKenv_t env,
        MSKstreamtypee whichstream,
        MSKCONST char * format,
        ...);
    
    env (input)
    The MOSEK environment.
    whichstream (input)
    Index of the stream.
    format (input)
    Is a valid C format string which matches the arguments in `...'.
    varnumarg (input)
    A variable argument list.
    Description:
    Sends a message to a given environment stream.
  • MSK_echointro

    Syntax:

     

    MSKrescodee MSK_echointro (
        MSKenv_t env,
        MSKintt longver);
    
    env (input)
    The MOSEK environment.
    longver (input)
    If non-zero, then the intro is slightly longer.
    Description:
    Prints an intro to message stream.
  • MSK_freedbgenv

    Syntax:

     

    void MSK_freedbgenv (
        MSKenv_t env,
        MSKCONST void * buffer,
        MSKCONST char * file,
        MSKCONST unsigned line);
    
    env (input)
    The MOSEK environment.
    buffer (input)
    A pointer.
    file (input)
    File from which the function is called.
    line (input)
    Line in the file from which the function is called.
    Description:
    Frees space allocated by a MOSEK function. Must not be applied to the MOSEK environment and task.
  • MSK_freeenv

    Syntax:

     

    void MSK_freeenv (
        MSKenv_t env,
        MSKCONST void * buffer);
    
    env (input)
    The MOSEK environment.
    buffer (input)
    A pointer.
    Description:
    Frees space allocated by a MOSEK function. Must not be applied to the MOSEK environment and task.
  • MSK_getbuildinfo

    Syntax:

     

    MSKrescodee MSK_getbuildinfo (
        char * buildstate,
        char * builddate,
        char * 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.
  • MSK_getcodedesc

    Syntax:

     

    MSKrescodee MSK_getcodedesc (
        MSKrescodee code,
        char * symname,
        char * 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.
  • MSK_getcodedisc

    Syntax:

     

    MSKrescodee MSK_getcodedisc (
        MSKrescodee code,
        char * symname,
        char * 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.
  • MSK_getglbdllname

    Syntax:

     

    MSKrescodee MSK_getglbdllname (
        MSKenv_t env,
        MSKCONST size_t sizedllname,
        char * dllname);
    
    env (input)
    The MOSEK environment.
    sizedllname (input)
    dllname (output)
    The DLL name.
    Description:
    Obtains the name of the global optimizer DLL.
  • MSK_getresponseclass

    Syntax:

     

    MSKrescodee MSK_getresponseclass (
        MSKrescodee r,
        MSKrescodetypee * rc);
    
    r (input)
    A response code indicating the result of function call.
    rc (output)
    The return response class
    Description:
    Obtain the class of a response code.
  • MSK_getsymbcondim

    Syntax:

     

    MSKrescodee MSK_getsymbcondim (
        MSKenv_t env,
        MSKintt * num,
        size_t * maxlen);
    
    env (input)
    The MOSEK environment.
    num (output)
    Number of symbolic constants defined by MOSEK.
    maxlen (output)
    Maximum length of the name of any symbolic constants.
    Description:
    Obtains the number of symbolic constants defined by MOSEK and the maximum length of the name of any symbolic constant.
  • MSK_getversion

    Syntax:

     

    MSKrescodee MSK_getversion (
        MSKintt * major,
        MSKintt * minor,
        MSKintt * build,
        MSKintt * revision);
    
    major (output)
    Major version number.
    minor (output)
    Minor version number.
    build (output)
    Build number.
    revision (output)
    Revision number.
    Description:
    Obtains MOSEK version information.
  • MSK_initenv

    Syntax:

     

    MSKrescodee MSK_initenv (MSKenv_t env)
    
    env (input)
    The MOSEK environment.
    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.
  • MSK_iparvaltosymnam

    Syntax:

     

    MSKrescodee MSK_iparvaltosymnam (
        MSKenv_t env,
        MSKiparame whichparam,
        MSKintt whichvalue,
        char * symbolicname);
    
    env (input)
    The MOSEK environment.
    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.
  • MSK_isinfinity

    Syntax:

     

    MSKbooleant MSK_isinfinity (MSKrealt value)
    
    value
    Description:
    Return true if value considered infinity by MOSEK
  • MSK_linkfiletoenvstream

    Syntax:

     

    MSKrescodee MSK_linkfiletoenvstream (
        MSKenv_t env,
        MSKstreamtypee whichstream,
        MSKCONST char * filename,
        MSKintt append);
    
    env (input)
    The MOSEK environment.
    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.
  • MSK_linkfunctoenvstream

    Syntax:

     

    MSKrescodee MSK_linkfunctoenvstream (
        MSKenv_t env,
        MSKstreamtypee whichstream,
        MSKuserhandle_t handle,
        MSKstreamfunc func);
    
    env (input)
    The MOSEK environment.
    whichstream (input)
    Index of the stream.
    handle (input)
    A user-defined handle which is passed to the user-defined function func.
    func (input)
    All output to the stream whichstream is passed to func.
    Description:
    Connects a user-defined function to a stream.
  • MSK_makeemptytask

    Syntax:

     

    MSKrescodee MSK_makeemptytask (
        MSKenv_t env,
        MSKtask_t * task);
    
    env (input)
    The MOSEK environment.
    task (output)
    An optimization task.
    Description:
    Creates a new optimization task.
  • MSK_makeenv

    Syntax:

     

    MSKrescodee MSK_makeenv (
        MSKenv_t * env,
        MSKuserhandle_t usrptr,
        MSKmallocfunc usrmalloc,
        MSKfreefunc usrfree,
        MSKCONST char * dbgfile);
    
    env (output)
    The MOSEK environment.
    usrptr (input)
    A pointer to user-defined data structure. The pointer is feed into usrmalloc and usrfree.
    usrmalloc (input)
    A user-defined malloc function or a NULL pointer.
    usrfree (input)
    A user-defined free function which is used deallocate space allocated by usrmalloc. This function must be defined if usrmalloc!=NULL.
    dbgfile (input)
    A user-defined file debug file.
    Description:
    Creates a new MOSEK environment. Before the created environment can be used to create a task, then the environment must be initialized using the function MSK_initenv.
    See also:

     

    MSK_initenv

    Initialize a MOSEK environment.

    MSK_putdllpath

    Sets the path to the DLL/shared libraries that MOSEK is loading.

    MSK_putlicensedefaults

    Set defaults used by the license manager.

    MSK_putcpudefaults

    Set defaults default CPU type and cache sizes.

  • MSK_maketask

    Syntax:

     

    MSKrescodee MSK_maketask (
        MSKenv_t env,
        MSKintt maxnumcon,
        MSKintt maxnumvar,
        MSKtask_t * task);
    
    env (input)
    The MOSEK environment.
    maxnumcon (input)
    An optional estimate on the maximum number of constraints in the task. Can e.g be 0 if no such estimate is known.
    maxnumvar (input)
    An optional estimate on the maximum number of variables in the task. Can be 0 if no such estimate is known.
    task (output)
    An optimization task.
    Description:
    Creates a new task.
  • MSK_putcpudefaults

    Syntax:

     

    MSKrescodee MSK_putcpudefaults (
        MSKenv_t env,
        int cputype,
        MSKintt sizel1,
        MSKintt sizel2);
    
    env (input)
    The MOSEK environment.
    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 MSK_initenv.
  • MSK_putdllpath

    Syntax:

     

    MSKrescodee MSK_putdllpath (
        MSKenv_t env,
        MSKCONST char * dllpath);
    
    env (input)
    The MOSEK environment.
    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 MSK_initenv.
  • MSK_putexitfunc

    Syntax:

     

    MSKrescodee MSK_putexitfunc (
        MSKenv_t env,
        MSKexitfunc exitfunc,
        MSKuserhandle_t handle);
    
    env (input)
    The MOSEK environment.
    exitfunc (input)
    A user-defined exit function.
    handle (input)
    A pointer to user-defined data structure which is passed to exitfunc when called.
    Description:
    In case MOSEK has a fatal error, then an exit function is called. The exit function should terminate MOSEK. In general it is not necessary to define an exit function.
  • MSK_putkeepdlls

    Syntax:

     

    MSKrescodee MSK_putkeepdlls (
        MSKenv_t env,
        MSKintt keepdlls);
    
    env (input)
    Size of the L2 cache.
    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.
  • MSK_putlicensedefaults

    Syntax:

     

    MSKrescodee MSK_putlicensedefaults (
        MSKenv_t env,
        MSKCONST char * licensefile,
        MSKCONST MSKintt * licensebuf,
        MSKintt licwait,
        MSKintt licdebug);
    
    env (input)
    The MOSEK environment.
    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 MSK_initenv.
  • MSK_replacefileext

    Syntax:

     

    void MSK_replacefileext (
        char * filename,
        MSKCONST char * newextension);
    
    filename (input/output)
    The filename.
    newextension (input)
    The new extension.
    Description:
    Replaces the file extension in a file name by a new one.
  • MSK_strdupdbgenv

    Syntax:

     

    char * MSK_strdupdbgenv (
        MSKenv_t env,
        MSKCONST char * str,
        MSKCONST char * file,
        MSKCONST unsigned line);
    
    env (input)
    The MOSEK environment.
    str (input)
    String that should be copied.
    file (input)
    File from which the function is called.
    line (input)
    Line in the file from which the function is called.
    Description:
    Make a copy of a string. The string created by this procedure must be freed by MSK_freeenv.
  • MSK_strdupenv

    Syntax:

     

    char * MSK_strdupenv (
        MSKenv_t env,
        MSKCONST char * str);
    
    env (input)
    The MOSEK environment.
    str (input)
    String that should be copied.
    Description:
    Make a copy of a string. The string created by this procedure must be freed by MSK_freeenv.
  • MSK_symnamtovalue

    Syntax:

     

    MSKbooleant MSK_symnamtovalue (
        MSKCONST char * name,
        char * value);
    
    name (input)
    Symbolic name.
    value (output)
    The corresponding value.
    Description:
    Obtains the value corresponding to a symbolic name defined by MOSEK.
  • MSK_unlinkfuncfromenvstream

    Syntax:

     

    MSKrescodee MSK_unlinkfuncfromenvstream (
        MSKenv_t env,
        MSKstreamtypee whichstream);
    
    env (input)
    The MOSEK environment.
    whichstream (input)
    Index of the stream.
    Description:
    Disconnects a user-defined function from a stream.
  • MSK_utf8towchar

    Syntax:

     

    MSKrescodee MSK_utf8towchar (
        MSKCONST size_t outputlen,
        size_t * len,
        size_t * conv,
        MSKwchart * output,
        MSKCONST char * input);
    
    outputlen (input)
    The length of the output buffer.
    len (output)
    The length of the string contained in the output buffer.
    conv (output)
    Returns the number of characters from converted, i.e. input[conv] is the first char which was not converted. If the whole string was converted, then input[conv]=0.
    output (output)
    The input string converted to a wchar string.
    input (input)
    The UTF8 input string.
    Description:
    Converts an UTF8 string to a wchar string.
  • MSK_wchartoutf8

    Syntax:

     

    MSKrescodee MSK_wchartoutf8 (
        MSKCONST size_t outputlen,
        size_t * len,
        size_t * conv,
        char * output,
        MSKCONST MSKwchart * input);
    
    outputlen (input)
    The length of the output buffer.
    len (output)
    The length of the string contained in the output buffer.
    conv (output)
    Returns the number of characters from converted, i.e. input[conv] is the first char which was not converted. If the whole string was converted, then input[conv]=0.
    output (output)
    The input string converted to a wchar string.
    input (input)
    The UTF8 input string.
    Description:
    Converts an UTF8 string to a wchar string.

15.4. Mosek Task

Description:

A Mosek Optimization task

15.4.1. Methods

  • MSK_analyzeproblem

    Syntax:

     

    MSKrescodee MSK_analyzeproblem (
        MSKtask_t task,
        MSKstreamtypee whichstream);
    
    task (input)
    An optimization task.
    whichstream (input)
    Index of the stream.
    Description:
    The function analyze the data of task and writes out a report.
  • MSK_analyzesolution

    Syntax:

     

    MSKrescodee MSK_analyzesolution (
        MSKtask_t task,
        MSKstreamtypee whichstream,
        MSKsoltypee whichsol);
    
    task (input)
    An optimization task.
    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:

    • MSK_IPAR_ANA_SOL_BASIS. Enables or disables printing of statistics specific to the basis solution (condition number, number of basic variables etc.). Default is on.
    • MSK_IPAR_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.
    • MSK_DPAR_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:

     

    MSK_getpeqi

    Obtains the primal equation infeasibility.

    MSK_getdeqi

    Optains the dual equation infeasibility.

    MSK_getpbi

    Obtains the primal bound infeasibility.

    MSK_getdbi

    Obtains the dual bound infeasibility.

    MSK_getdcni

    Obtains the dual cone infeasibility.

    MSK_getpcni

    Obtains the primal cone infeasibility.

    MSK_getsolutioninf

    Obtains information about a solution.

    MSK_getsolutionstatus

    Obtains information about the problem and solution statuses.

  • MSK_append

    Syntax:

     

    MSKrescodee MSK_append (
        MSKtask_t task,
        MSKaccmodee accmode,
        MSKintt num);
    
    task (input)
    An optimization task.
    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:

     

    MSK_remove

    The function removes a number of constraints or variables.

  • MSK_appendcone

    Syntax:

     

    MSKrescodee MSK_appendcone (
        MSKtask_t task,
        MSKconetypee conetype,
        MSKrealt conepar,
        MSKintt nummem,
        MSKCONST MSKidxt * submem);
    
    task (input)
    An optimization task.
    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 62]] is a convex cone. [[MathCmd 528]] 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 (MSK_CT_QUAD) or rotated quadratic cone (MSK_CT_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.

  • MSK_basiscond

    Syntax:

     

    MSKrescodee MSK_basiscond (
        MSKtask_t task,
        MSKrealt * nrmbasis,
        MSKrealt * nrminvbasis);
    
    task (input)
    An optimization task.
    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 879]] and [[MathCmd 880]] it is also possible to estimate [[MathCmd 881]].

  • MSK_bktostr

    Syntax:

     

    MSKrescodee MSK_bktostr (
        MSKtask_t task,
        MSKboundkeye bk,
        char * str);
    
    task (input)
    An optimization task.
    bk (input)
    Bound key.
    str (output)
    String corresponding to the bound key code bk.
    Description:
    Obtains an identifier string corresponding to a bound key.
  • MSK_callbackcodetostr

    Syntax:

     

    MSKrescodee MSK_callbackcodetostr (
        MSKcallbackcodee code,
        char * callbackcodestr);
    
    code (input)
    A call-back code.
    callbackcodestr (output)
    String corresponding to the call-back code.
    Description:
    Obtains a the string representation of a corresponding to a call-back code.
  • MSK_callocdbgtask

    Syntax:

     

    void * MSK_callocdbgtask (
        MSKtask_t task,
        MSKCONST size_t number,
        MSKCONST size_t size,
        MSKCONST char * file,
        MSKCONST unsigned line);
    
    task (input)
    An optimization task.
    number (input)
    Number of elements.
    size (input)
    Size of each individual element.
    file (input)
    File from which the function is called.
    line (input)
    Line in the file from which the function is called.
    Description:
    Debug version of MSK_calloctask.
  • MSK_calloctask

    Syntax:

     

    void * MSK_calloctask (
        MSKtask_t task,
        MSKCONST size_t number,
        MSKCONST size_t size);
    
    task (input)
    An optimization task.
    number (input)
    Number of elements.
    size (input)
    Size of each individual element.
    Description:
    Equivalent to calloc i.e. allocate space for an array of length number where each element is of size size.
  • MSK_checkconvexity

    Syntax:

     

    MSKrescodee MSK_checkconvexity (MSKtask_t task)
    
    task (input)
    An optimization task.
    Description:

    This function checks if a quadratic optimization problem is convex. The amount of checking is controlled by MSK_IPAR_CHECK_CONVEXITY.

    The function returns an error code other than MSK_RES_OK if the problem is not convex.

    See also:

     

    MSK_IPAR_CHECK_CONVEXITY
  • MSK_checkdata

    Syntax:

     

    MSKrescodee MSK_checkdata (MSKtask_t task)
    
    task (input)
    An optimization task.
    Description:
    Checks the data of the optimization task.
  • MSK_checkmemtask

    Syntax:

     

    MSKrescodee MSK_checkmemtask (
        MSKtask_t task,
        MSKCONST char * file,
        MSKintt line);
    
    task (input)
    An optimization task.
    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.
  • MSK_chgbound

    Syntax:

     

    MSKrescodee MSK_chgbound (
        MSKtask_t task,
        MSKaccmodee accmode,
        MSKidxt i,
        MSKintt lower,
        MSKintt finite,
        MSKrealt value);
    
    task (input)
    An optimization task.
    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 MSK_ACC_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:

     

    MSK_putbound

    Changes the bound for either one constraint or one variable.

    MSK_DPAR_DATA_TOL_BOUND_INF
    MSK_DPAR_DATA_TOL_BOUND_WRN
  • MSK_clonetask

    Syntax:

     

    MSKrescodee MSK_clonetask (
        MSKtask_t task,
        MSKtask_t * clonedtask);
    
    task (input)
    An optimization task.
    clonedtask (output)
    The cloned task.
    Description:
    Creates a clone of an existing task copying all problem data and parameter settings to a new task. Call-back functions are not copied, so a task containing nonlinear functions cannot be cloned.
  • MSK_commitchanges

    Syntax:

     

    MSKrescodee MSK_commitchanges (MSKtask_t task)
    
    task (input)
    An optimization task.
    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.
  • MSK_conetypetostr

    Syntax:

     

    MSKrescodee MSK_conetypetostr (
        MSKtask_t task,
        MSKconetypee conetype,
        char * str);
    
    task (input)
    An optimization task.
    conetype (input)
    Specifies the type of the cone.
    str (output)
    String corresponding to the cone type code conetype.
    Description:
    Obtains the cone string identifier corresponding to a cone type.
  • MSK_deletesolution

    Syntax:

     

    MSKrescodee MSK_deletesolution (
        MSKtask_t task,
        MSKsoltypee whichsol);
    
    task (input)
    An optimization task.
    whichsol (input)
    Selects a solution.
    Description:
    Undefines a solution and frees the memory it uses.
  • MSK_deletetask

    Syntax:

     

    MSKrescodee MSK_deletetask (MSKtask_t * task)
    
    task (input/output)
    An optimization task.
    Description:
    Deletes a task.
  • MSK_dualsensitivity

    Syntax:

     

    MSKrescodee MSK_dualsensitivity (
        MSKtask_t task,
        MSKintt numj,
        MSKCONST MSKidxt * subj,
        MSKrealt * leftpricej,
        MSKrealt * rightpricej,
        MSKrealt * leftrangej,
        MSKrealt * rightrangej);
    
    task (input)
    An optimization task.
    numj (input)
    Number of coefficients to be analyzed. Length of subj.
    subj (input)
    Index of objective coefficients to analyze.
    leftpricej (output)
    [[MathCmd 884]] is the left shadow price for the coefficients with index [[MathCmd 885]].
    rightpricej (output)
    [[MathCmd 886]] is the right shadow price for the coefficients with index [[MathCmd 885]].
    leftrangej (output)
    [[MathCmd 888]] is the left range [[MathCmd 741]] for the coefficient with index [[MathCmd 885]].
    rightrangej (output)
    [[MathCmd 891]] is the right range [[MathCmd 742]] for the coefficient with index [[MathCmd 885]].
    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 895]] is the left shadow price of the objective coefficient with index [[MathCmd 896]].

    The type of sensitivity analysis to perform (basis or optimal partition) is controlled by the parameter MSK_IPAR_SENSITIVITY_TYPE.

    For an example, please see Section 12.5.

    See also:

     

    MSK_primalsensitivity

    Perform sensitivity analysis on bounds.

    MSK_sensitivityreport

    Creates a sensitivity report.

    MSK_IPAR_SENSITIVITY_TYPE
    MSK_IPAR_LOG_SENSITIVITY
    MSK_IPAR_LOG_SENSITIVITY_OPT
  • MSK_echotask

    Syntax:

     

    MSKrescodee MSK_echotask (
        MSKtask_t task,
        MSKstreamtypee whichstream,
        MSKCONST char * format,
        ...);
    
    task (input)
    An optimization task.
    whichstream (input)
    Index of the stream.
    format (input)
    varnumarg (input)
    Description:
    Prints a format string to a task stream.
  • MSK_exceptiontask

    Syntax:

     

    MSKrescodee MSK_exceptiontask (
        MSKtask_t task,
        MSKrescodee code,
        ...);
    
    task (input)
    An optimization task.
    code (input)
    varnumarg (input)
    Description:
    Prints the code to the error task stream formatted “nicely”. code must be a valid response code listed in Appendix 17. Moreover, the corresponding response string listed in Appendix 17 is printed. It is the users responsibility to provide appropriate arguments for the response string listed in Appendix 17 too.
  • MSK_freedbgtask

    Syntax:

     

    void MSK_freedbgtask (
        MSKtask_t task,
        MSKCONST void * buffer,
        MSKCONST char * file,
        MSKCONST unsigned line);
    
    task (input)
    An optimization task.
    buffer (input)
    A pointer.
    file (input)
    File from which the function is called.
    line (input)
    Line in the file from which the function is called.
    Description:
    Frees space allocated by a MOSEK function. Must not be applied to the MOSEK environment and task.
  • MSK_freetask

    Syntax:

     

    void MSK_freetask (
        MSKtask_t task,
        MSKCONST void * buffer);
    
    task (input)
    An optimization task.
    buffer (input)
    A pointer.
    Description:
    Frees space allocated by a MOSEK function. Must not be applied to the MOSEK environment and task.
  • MSK_getaij

    Syntax:

     

    MSKrescodee MSK_getaij (
        MSKtask_t task,
        MSKidxt i,
        MSKidxt j,
        MSKrealt * aij);
    
    task (input)
    An optimization task.
    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 897]].
    Description:
    Obtains a single coefficient in A.
  • MSK_getapiecenumnz

    Syntax:

     

    MSKrescodee MSK_getapiecenumnz (
        MSKtask_t task,
        MSKidxt firsti,
        MSKidxt lasti,
        MSKidxt firstj,
        MSKidxt lastj,
        MSKintt * numnz);
    
    task (input)
    An optimization task.
    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 899]] means the number of elements in the set [[MathCmd 900]].

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

    See also:

     

    MSK_getavecnumnz

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

    MSK_getaslicenumnz

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

  • MSK_getaslice

    Syntax:

     

    MSKrescodee MSK_getaslice (
        MSKtask_t task,
        MSKaccmodee accmode,
        MSKidxt first,
        MSKidxt last,
        MSKintt maxnumnz,
        MSKintt * surp,
        MSKintt * ptrb,
        MSKlidxt * ptre,
        MSKidxt * sub,
        MSKrealt * val);
    
    task (input)
    An optimization task.
    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.
    maxnumnz (input)
    Denotes the length of the arrays sub and val.
    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:

     

    MSK_getaslicenumnz

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

  • MSK_getaslice64

    Syntax:

     

    MSKrescodee MSK_getaslice64 (
        MSKtask_t task,
        MSKaccmodee accmode,
        MSKidxt first,
        MSKidxt last,
        MSKint64t maxnumnz,
        MSKint64t * surp,
        MSKint64t * ptrb,
        MSKint64t * ptre,
        MSKidxt * sub,
        MSKrealt * val);
    
    task (input)
    An optimization task.
    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.
    maxnumnz (input)
    Denotes the length of the arrays sub and val.
    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:

     

    MSK_getaslicenumnz64

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

  • MSK_getaslicenumnz

    Syntax:

     

    MSKrescodee MSK_getaslicenumnz (
        MSKtask_t task,
        MSKaccmodee accmode,
        MSKidxt first,
        MSKidxt last,
        MSKintt * numnz);
    
    task (input)
    An optimization task.
    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.
  • MSK_getaslicenumnz64

    Syntax:

     

    MSKrescodee MSK_getaslicenumnz64 (
        MSKtask_t task,
        MSKaccmodee accmode,
        MSKidxt first,
        MSKidxt last,
        MSKint64t * numnz);
    
    task (input)
    An optimization task.
    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.
  • MSK_getaslicetrip

    Syntax:

     

    MSKrescodee MSK_getaslicetrip (
        MSKtask_t task,
        MSKaccmodee accmode,
        MSKidxt first,
        MSKidxt last,
        MSKintt maxnumnz,
        MSKintt * surp,
        MSKidxt * subi,
        MSKidxt * subj,
        MSKrealt * val);
    
    task (input)
    An optimization task.
    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.
    maxnumnz (input)
    Denotes the length of the arrays subi, subj, and aval.
    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.

    Define [[MathCmd 901]] as

    \begin{displaymath}\nonumber{}p^{1}=\mathtt{maxnumnz-surp[0]}\end{displaymath}

    when the function is called and [[MathCmd 903]] by

    \begin{displaymath}\nonumber{}p^{2}=\mathtt{maxnumnz-surp[0]},\end{displaymath}

    where surp[0] is the value upon termination. Using this notation then

    \begin{displaymath}\nonumber{}\mathtt{val}[k]=a_{{\mathtt{subi[k]},\mathtt{subj[k]}}},\quad{}k=p^{1},\ldots ,p^{2}-1.\end{displaymath}
    See also:

     

    MSK_getaslicenumnz

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

  • MSK_getavec

    Syntax:

     

    MSKrescodee MSK_getavec (
        MSKtask_t task,
        MSKaccmodee accmode,
        MSKidxt i,
        MSKintt * nzi,
        MSKidxt * subi,
        MSKrealt * vali);
    
    task (input)
    An optimization task.
    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 MSK_ACC_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 MSK_ACC_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}
  • MSK_getavecnumnz

    Syntax:

     

    MSKrescodee MSK_getavecnumnz (
        MSKtask_t task,
        MSKaccmodee accmode,
        MSKidxt i,
        MSKintt * nzj);
    
    task (input)
    An optimization task.
    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.
  • MSK_getbound

    Syntax:

     

    MSKrescodee MSK_getbound (
        MSKtask_t task,
        MSKaccmodee accmode,
        MSKidxt i,
        MSKboundkeye * bk,
        MSKrealt * bl,
        MSKrealt * bu);
    
    task (input)
    An optimization task.
    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.
  • MSK_getboundslice

    Syntax:

     

    MSKrescodee MSK_getboundslice (
        MSKtask_t task,
        MSKaccmodee accmode,
        MSKidxt first,
        MSKidxt last,
        MSKboundkeye * bk,
        MSKrealt * bl,
        MSKrealt * bu);
    
    task (input)
    An optimization task.
    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.
  • MSK_getc

    Syntax:

     

    MSKrescodee MSK_getc (
        MSKtask_t task,
        MSKrealt * c);
    
    task (input)
    An optimization task.
    c (output)
    Linear terms of the objective as a dense vector. The lengths is the number of variables.
    Description:
    Obtains all objective coefficients c.
  • MSK_getcallbackfunc

    Syntax:

     

    MSKrescodee MSK_getcallbackfunc (
        MSKtask_t task,
        MSKcallbackfunc * func,
        MSKuserhandle_t * handle);
    
    task (input)
    An optimization task.
    func (output)
    Get the user-defined progress call-back function MSK_callbackfunc associated with task. If func is identical to NULL, then no call-back function is associated with the task.
    handle (output)
    The user-defined pointer associated with the user-defined call-back function.
    Description:
    Obtains the current user-defined call-back function and associated userhandle.
  • MSK_getcfix

    Syntax:

     

    MSKrescodee MSK_getcfix (
        MSKtask_t task,
        MSKrealt * cfix);
    
    task (input)
    An optimization task.
    cfix (output)
    Fixed term in the objective.
    Description:
    Obtains the fixed term in the objective.
  • MSK_getcone

    Syntax:

     

    MSKrescodee MSK_getcone (
        MSKtask_t task,
        MSKidxt k,
        MSKconetypee * conetype,
        MSKrealt * conepar,
        MSKintt * nummem,
        MSKidxt * submem);
    
    task (input)
    An optimization task.
    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.
  • MSK_getconeinfo

    Syntax:

     

    MSKrescodee MSK_getconeinfo (
        MSKtask_t task,
        MSKidxt k,
        MSKconetypee * conetype,
        MSKrealt * conepar,
        MSKintt * nummem);
    
    task (input)
    An optimization task.
    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.
  • MSK_getconname

    Syntax:

     

    MSKrescodee MSK_getconname (
        MSKtask_t task,
        MSKidxt i,
        MSKCONST size_t maxlen,
        char * name);
    
    task (input)
    An optimization task.
    i (input)
    Index.
    maxlen (input)
    Maximum length of name that can be stored in name.
    name (output)
    Is assigned the required name.
    Description:
    Obtains a name of a constraint.
    See also:

     

    MSK_getmaxnamelen

    Obtains the maximum length (not including terminating zero character) of any objective, constraint, variable or cone name.

  • MSK_getconname64

    Syntax:

     

    MSKrescodee MSK_getconname64 (
        MSKtask_t task,
        MSKidxt i,
        MSKint64t maxlen,
        char * name);
    
    task (input)
    An optimization task.
    i (input)
    Index.
    maxlen (input)
    Maximum length of name that can be stored in name.
    name (output)
    Is assigned the required name.
    Description:
    Obtains a name of a constraint.
    See also:

     

    MSK_getmaxnamelen

    Obtains the maximum length (not including terminating zero character) of any objective, constraint, variable or cone name.

  • MSK_getcslice

    Syntax:

     

    MSKrescodee MSK_getcslice (
        MSKtask_t task,
        MSKidxt first,
        MSKidxt last,
        MSKrealt * c);
    
    task (input)
    An optimization task.
    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.
  • MSK_getdbi

    Syntax:

     

    MSKrescodee MSK_getdbi (
        MSKtask_t task,
        MSKsoltypee whichsol,
        MSKaccmodee accmode,
        MSKCONST MSKidxt * sub,
        MSKintt len,
        MSKrealt * dbi);
    
    task (input)
    An optimization task.
    whichsol (input)
    Selects a solution.
    accmode (input)
    If set to MSK_ACC_CON then sub contains constraint indexes, otherwise variable indexes.
    sub (input)
    Indexes of constraints or variables.
    len (input)
    Length of sub
    dbi (output)

    Dual bound infeasibility. If acmode is MSK_ACC_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.4.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.4.2)
    Description:
    Obtains the dual bound infeasibility.
    See also:

     

    MSK_getsolutioninf

    Obtains information about a solution.

  • MSK_getdcni

    Syntax:

     

    MSKrescodee MSK_getdcni (
        MSKtask_t task,
        MSKsoltypee whichsol,
        MSKCONST MSKidxt * sub,
        MSKintt len,
        MSKrealt * dcni);
    
    task (input)
    An optimization task.
    whichsol (input)
    Selects a solution.
    sub (input)
    Constraint indexes to calculate equation infeasibility for.
    len (input)
    Length of sub and dcni
    dcni (output)
    dcni[i] contains dual cone infeasibility for the cone with index sub[i].
    Description:
    Obtains the dual cone infeasibility.
    See also:

     

    MSK_getsolutioninf

    Obtains information about a solution.

  • MSK_getdeqi

    Syntax:

     

    MSKrescodee MSK_getdeqi (
        MSKtask_t task,
        MSKsoltypee whichsol,
        MSKaccmodee accmode,
        MSKCONST MSKidxt * sub,
        MSKintt len,
        MSKrealt * deqi,
        MSKintt normalize);
    
    task (input)
    An optimization task.
    whichsol (input)
    Selects a solution.
    accmode (input)
    If set to MSK_ACC_CON the dual equation infeasibilitys corresponding to constraints are retrieved. Otherwise for a variables.
    sub (input)
    Indexes of constraints or variables.
    len (input)
    Length of sub and deqi.
    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 MSK_ACC_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.4.3)

    If acmode is MSK_ACC_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.4.4)
    See also:

     

    MSK_getsolutioninf

    Obtains information about a solution.

  • MSK_getdouinf

    Syntax:

     

    MSKrescodee MSK_getdouinf (
        MSKtask_t task,
        MSKdinfiteme whichdinf,
        MSKrealt * dvalue);
    
    task (input)
    An optimization task.
    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.
  • MSK_getdouparam

    Syntax:

     

    MSKrescodee MSK_getdouparam (
        MSKtask_t task,
        MSKdparame param,
        MSKrealt * parvalue);
    
    task (input)
    An optimization task.
    param (input)
    Which parameter.
    parvalue (output)
    Parameter value.
    Description:
    Obtains the value of a double parameter.
  • MSK_getdualobj

    Syntax:

     

    MSKrescodee MSK_getdualobj (
        MSKtask_t task,
        MSKsoltypee whichsol,
        MSKrealt * dualobj);
    
    task (input)
    An optimization task.
    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.
  • MSK_getenv

    Syntax:

     

    MSKrescodee MSK_getenv (
        MSKtask_t task,
        MSKenv_t * env);
    
    task (input)
    An optimization task.
    env (output)
    The MOSEK environment.
    Description:
    Obtains the environment used to create the task.
  • MSK_getinfeasiblesubproblem

    Syntax:

     

    MSKrescodee MSK_getinfeasiblesubproblem (
        MSKtask_t task,
        MSKsoltypee whichsol,
        MSKtask_t * inftask);
    
    task (input)
    An optimization task.
    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:

     

    MSK_IPAR_INFEAS_PREFER_PRIMAL
    MSK_relaxprimal

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

  • MSK_getinfindex

    Syntax:

     

    MSKrescodee MSK_getinfindex (
        MSKtask_t task,
        MSKinftypee inftype,
        MSKCONST char * infname,
        MSKintt * infindex);
    
    task (input)
    An optimization task.
    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.
  • MSK_getinfmax

    Syntax:

     

    MSKrescodee MSK_getinfmax (
        MSKtask_t task,
        MSKinftypee inftype,
        MSKintt * infmax);
    
    task (input)
    An optimization task.
    inftype (input)
    Type of the information item.
    infmax (output)
    Description:
    Obtains the maximum index of an information of a given type inftype plus 1.
  • MSK_getinfname

    Syntax:

     

    MSKrescodee MSK_getinfname (
        MSKtask_t task,
        MSKinftypee inftype,
        MSKintt whichinf,
        char * infname);
    
    task (input)
    An optimization task.
    inftype (input)
    Type of the information item.
    whichinf (input)
    An information item. See section 18.13 and section 18.16 for the possible values.
    infname (output)
    Name of the information item.
    Description:
    Obtains the name of an information item.
  • MSK_getinti

    Syntax:

     

    MSKrescodee MSK_getinti (
        MSKtask_t task,
        MSKsoltypee whichsol,
        MSKCONST MSKidxt * sub,
        MSKintt len,
        MSKrealt * inti);
    
    task (input)
    An optimization task.
    whichsol (input)
    Selects a solution.
    sub (input)
    Variable indexes for which to calculate the integer infeasibility.
    len (input)
    Length of sub and inti
    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.4.5)
    See also:

     

    MSK_getsolutioninf

    Obtains information about a solution.

  • MSK_getintinf

    Syntax:

     

    MSKrescodee MSK_getintinf (
        MSKtask_t task,
        MSKiinfiteme whichiinf,
        MSKintt * ivalue);
    
    task (input)
    An optimization task.
    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.
  • MSK_getintparam

    Syntax:

     

    MSKrescodee MSK_getintparam (
        MSKtask_t task,
        MSKiparame param,
        MSKintt * parvalue);
    
    task (input)
    An optimization task.
    param (input)
    Which parameter.
    parvalue (output)
    Parameter value.
    Description:
    Obtains the value of an integer parameter.
  • MSK_getintpntnumthreads

    Syntax:

     

    MSKrescodee MSK_getintpntnumthreads (
        MSKtask_t task,
        MSKintt * numthreads);
    
    task (input)
    An optimization task.
    numthreads (output)
    The number of threads.
    Description:
    Obtains the number of threads used by the interior-point optimizer. If MSK_IPAR_INTPNT_NUM_THREADS is set to zero this function will return the number of cores on the system. Otherwise it return the value of MSK_IPAR_INTPNT_NUM_THREADS.
  • MSK_getlasterror

    Syntax:

     

    MSKrescodee MSK_getlasterror (
        MSKtask_t task,
        MSKrescodee * lastrescode,
        MSKCONST size_t maxlen,
        size_t * lastmsglen,
        char * lastmsg);
    
    task (input)
    An optimization task.
    lastrescode (output)
    Returns the last error code reported in the task.
    maxlen
    The length if the lastmsg buffer.
    lastmsglen (output)
    Returns the length of the last error message reported in the task.
    lastmsg (output)
    Returns the the last error message reported in the task.
    Description:

    Obtains the last response code and corresponding message reported in MOSEK.

    If there is no previous error, warning or termination code for this task, lastrescode returns MSK_RES_OK and lastmsg returns an empty string, otherwise the last response code different from MSK_RES_OK and the corresponding message are returned.

  • MSK_getlasterror64

    Syntax:

     

    MSKrescodee MSK_getlasterror64 (
        MSKtask_t task,
        MSKrescodee * lastrescode,
        MSKint64t maxlen,
        MSKint64t * lastmsglen,
        char * lastmsg);
    
    task (input)
    An optimization task.
    lastrescode (output)
    Returns the last error code reported in the task.
    maxlen
    The length if the lastmsg buffer.
    lastmsglen (output)
    Returns the length of the last error message reported in the task.
    lastmsg (output)
    Returns the the last error message reported in the task.
    Description:

    Obtains the last response code and corresponding message reported in MOSEK.

    If there is no previous error, warning or termination code for this task, lastrescode returns MSK_RES_OK and lastmsg returns an empty string, otherwise the last response code different from MSK_RES_OK and the corresponding message are returned.

  • MSK_getlintinf

    Syntax:

     

    MSKrescodee MSK_getlintinf (
        MSKtask_t task,
        MSKliinfiteme whichliinf,
        MSKint64t * ivalue);
    
    task (input)
    An optimization task.
    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.
  • MSK_getmaxnamelen

    Syntax:

     

    MSKrescodee MSK_getmaxnamelen (
        MSKtask_t task,
        size_t * maxlen);
    
    task (input)
    An optimization task.
    maxlen (output)
    The maximum length of any name.
    Description:
    Obtains the maximum length (not including terminating zero character) of any objective, constraint, variable or cone name.
  • MSK_getmaxnumanz

    Syntax:

     

    MSKrescodee MSK_getmaxnumanz (
        MSKtask_t task,
        MSKintt * maxnumanz);
    
    task (input)
    An optimization task.
    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.
  • MSK_getmaxnumanz64

    Syntax:

     

    MSKrescodee MSK_getmaxnumanz64 (
        MSKtask_t task,
        MSKint64t * maxnumanz);
    
    task (input)
    An optimization task.
    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.
  • MSK_getmaxnumcon

    Syntax:

     

    MSKrescodee MSK_getmaxnumcon (
        MSKtask_t task,
        MSKintt * maxnumcon);
    
    task (input)
    An optimization task.
    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.
  • MSK_getmaxnumcone

    Syntax:

     

    MSKrescodee MSK_getmaxnumcone (
        MSKtask_t task,
        MSKintt * maxnumcone);
    
    task (input)
    An optimization task.
    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.
  • MSK_getmaxnumqnz

    Syntax:

     

    MSKrescodee MSK_getmaxnumqnz (
        MSKtask_t task,
        MSKintt * maxnumqnz);
    
    task (input)
    An optimization task.
    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.
  • MSK_getmaxnumqnz64

    Syntax:

     

    MSKrescodee MSK_getmaxnumqnz64 (
        MSKtask_t task,
        MSKint64t * maxnumqnz);
    
    task (input)
    An optimization task.
    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.
  • MSK_getmaxnumvar

    Syntax:

     

    MSKrescodee MSK_getmaxnumvar (
        MSKtask_t task,
        MSKintt * maxnumvar);
    
    task (input)
    An optimization task.
    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.
  • MSK_getmemusagetask

    Syntax:

     

    MSKrescodee MSK_getmemusagetask (
        MSKtask_t task,
        size_t * meminuse,
        size_t * maxmemuse);
    
    task (input)
    An optimization task.
    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.
  • MSK_getmemusagetask64

    Syntax:

     

    MSKrescodee MSK_getmemusagetask64 (
        MSKtask_t task,
        MSKint64t * meminuse,
        MSKint64t * maxmemuse);
    
    task (input)
    An optimization task.
    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.
  • MSK_getnadouinf

    Syntax:

     

    MSKrescodee MSK_getnadouinf (
        MSKtask_t task,
        MSKCONST char * whichdinf,
        MSKrealt * dvalue);
    
    task (input)
    An optimization task.
    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 task information database.
  • MSK_getnadouparam

    Syntax:

     

    MSKrescodee MSK_getnadouparam (
        MSKtask_t task,
        MSKCONST char * paramname,
        MSKrealt * parvalue);
    
    task (input)
    An optimization task.
    paramname (input)
    Name of a parameter.
    parvalue (output)
    Parameter value.
    Description:
    Obtains the value of a named double parameter.
  • MSK_getnaintinf

    Syntax:

     

    MSKrescodee MSK_getnaintinf (
        MSKtask_t task,
        MSKCONST char * infitemname,
        MSKintt * ivalue);
    
    task (input)
    An optimization task.
    infitemname (input)
    ivalue (output)
    The value of the required integer information item.
    Description:
    Obtains an integer information item from the task information database.
  • MSK_getnaintparam

    Syntax:

     

    MSKrescodee MSK_getnaintparam (
        MSKtask_t task,
        MSKCONST char * paramname,
        MSKintt * parvalue);
    
    task (input)
    An optimization task.
    paramname (input)
    Name of a parameter.
    parvalue (output)
    Parameter value.
    Description:
    Obtains the value of a named integer parameter.
  • MSK_getname

    Syntax:

     

    MSKrescodee MSK_getname (
        MSKtask_t task,
        MSKproblemiteme whichitem,
        MSKidxt i,
        MSKCONST size_t maxlen,
        size_t * len,
        char * name);
    
    task (input)
    An optimization task.
    whichitem (input)
    Problem item, i.e. a cone, a variable or a constraint name..
    i (input)
    Index.
    maxlen (input)
    Maximum length of name that can be stored in name. The buffer name must be be able to hold the name including a terminating zero character.
    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.
    See also:

     

    MSK_getmaxnamelen

    Obtains the maximum length (not including terminating zero character) of any objective, constraint, variable or cone name.

  • MSK_getname64

    Syntax:

     

    MSKrescodee MSK_getname64 (
        MSKtask_t task,
        MSKproblemiteme whichitem,
        MSKidxt i,
        MSKint64t maxlen,
        MSKint64t * len,
        char * name);
    
    task (input)
    An optimization task.
    whichitem (input)
    Problem item, i.e. a cone, a variable or a constraint name..
    i (input)
    Index.
    maxlen (input)
    Maximum length of name that can be stored in name. The buffer name must be be able to hold the name including a terminating zero character.
    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.
    See also:

     

    MSK_getmaxnamelen

    Obtains the maximum length (not including terminating zero character) of any objective, constraint, variable or cone name.

  • MSK_getnameapi64

    Syntax:

     

    MSKrescodee MSK_getnameapi64 (
        MSKtask_t task,
        MSKproblemiteme whichitem,
        MSKidxt i,
        MSKint64t maxlen,
        char * name);
    
    task (input)
    An optimization task.
    whichitem (input)
    Problem item, i.e. a cone, a variable or a constraint name..
    i (input)
    Index.
    maxlen (input)
    Maximum length of name that can be stored in name. The buffer name must be be able to hold the name including a terminating zero character.
    name (output)
    Is assigned the required name.
    Description:
    Obtains a name of a problem item, i.e. a cone, a variable or a constraint.
    See also:

     

    MSK_getmaxnamelen

    Obtains the maximum length (not including terminating zero character) of any objective, constraint, variable or cone name.

  • MSK_getnameindex

    Syntax:

     

    MSKrescodee MSK_getnameindex (
        MSKtask_t task,
        MSKproblemiteme whichitem,
        MSKCONST char * name,
        MSKintt * asgn,
        MSKidxt * index);
    
    task (input)
    An optimization task.
    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.
  • MSK_getnamelen64

    Syntax:

     

    MSKrescodee MSK_getnamelen64 (
        MSKtask_t task,
        MSKproblemiteme whichitem,
        MSKidxt i,
        MSKint64t * len);
    
    task (input)
    An optimization task.
    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:

     

    MSK_getmaxnamelen

    Obtains the maximum length (not including terminating zero character) of any objective, constraint, variable or cone name.

    MSK_getname

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

    MSK_getname64

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

  • MSK_getnastrparam

    Syntax:

     

    MSKrescodee MSK_getnastrparam (
        MSKtask_t task,
        MSKCONST char * paramname,
        MSKCONST size_t maxlen,
        size_t * len,
        char * parvalue);
    
    task (input)
    An optimization task.
    paramname (input)
    Name of a parameter.
    maxlen (input)
    Length of parvalue.
    len (output)
    Identical to length of string hold by parvalue.
    parvalue (output)
    Parameter value.
    Description:
    Obtains the value of a named string parameter.
  • MSK_getnastrparamal

    Syntax:

     

    MSKrescodee MSK_getnastrparamal (
        MSKtask_t task,
        MSKCONST char * paramname,
        MSKCONST size_t numaddchr,
        MSKstring_t * value);
    
    task (input)
    An optimization task.
    paramname (input)
    Name of a parameter.
    numaddchr (input)
    Number of additional characters that is made room for in value[0].
    value (input/output)
    Is the value corresponding to string parameter param. value[0] is char buffer allocated MOSEK and it must be freed by MSK_freetask.
    Description:
    Obtains the value of a string parameter.
  • MSK_getnlfunc

    Syntax:

     

    MSKrescodee MSK_getnlfunc (
        MSKtask_t task,
        MSKuserhandle_t * nlhandle,
        MSKnlgetspfunc * nlgetsp,
        MSKnlgetvafunc * nlgetva);
    
    task (input)
    An optimization task.
    nlhandle (input/output)
    Retrieve the pointer to the user-defined data structure. This structure is passed to the functions nlgetsp and nlgetva whenever those two functions called.
    nlgetsp (output)
    Retrieve the function which provide information about the structure of the nonlinear functions in the optimization problem.
    nlgetva (output)
    Retrieve the function which is used to evaluate the nonlinear function in the optimization problem at a given point.
    Description:
    This function is used to retrieve the nonlinear call-back functions. If NULL no nonlinear call-back function exists.
  • MSK_getnumanz

    Syntax:

     

    MSKrescodee MSK_getnumanz (
        MSKtask_t task,
        MSKintt * numanz);
    
    task (input)
    An optimization task.
    numanz (output)
    Number of non-zero elements in A.
    Description:
    Obtains the number of non-zeros in A.
  • MSK_getnumanz64

    Syntax:

     

    MSKrescodee MSK_getnumanz64 (
        MSKtask_t task,
        MSKint64t * numanz);
    
    task (input)
    An optimization task.
    numanz (output)
    Number of non-zero elements in A.
    Description:
    Obtains the number of non-zeros in A.
  • MSK_getnumcon

    Syntax:

     

    MSKrescodee MSK_getnumcon (
        MSKtask_t task,
        MSKintt * numcon);
    
    task (input)
    An optimization task.
    numcon (output)
    Number of constraints.
    Description:
    Obtains the number of constraints.
  • MSK_getnumcone

    Syntax:

     

    MSKrescodee MSK_getnumcone (
        MSKtask_t task,
        MSKintt * numcone);
    
    task (input)
    An optimization task.
    numcone (output)
    Number conic constraints.
    Description:
    Obtains the number of cones.
  • MSK_getnumconemem

    Syntax:

     

    MSKrescodee MSK_getnumconemem (
        MSKtask_t task,
        MSKidxt k,
        MSKintt * nummem);
    
    task (input)
    An optimization task.
    k (input)
    Index of the cone.
    nummem (output)
    Number of member variables in the cone.
    Description:
    Obtains the number of members in a cone.
  • MSK_getnumintvar

    Syntax:

     

    MSKrescodee MSK_getnumintvar (
        MSKtask_t task,
        MSKintt * numintvar);
    
    task (input)
    An optimization task.
    numintvar (output)
    Number of integer variables.
    Description:
    Obtains the number of integer-constrained variables.
  • MSK_getnumparam

    Syntax:

     

    MSKrescodee MSK_getnumparam (
        MSKtask_t task,
        MSKparametertypee partype,
        MSKintt * numparam);
    
    task (input)
    An optimization task.
    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.
  • MSK_getnumqconknz

    Syntax:

     

    MSKrescodee MSK_getnumqconknz (
        MSKtask_t task,
        MSKidxt k,
        MSKintt * numqcnz);
    
    task (input)
    An optimization task.
    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.
  • MSK_getnumqconknz64

    Syntax:

     

    MSKrescodee MSK_getnumqconknz64 (
        MSKtask_t task,
        MSKidxt k,
        MSKint64t * numqcnz);
    
    task (input)
    An optimization task.
    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.
  • MSK_getnumqobjnz

    Syntax:

     

    MSKrescodee MSK_getnumqobjnz (
        MSKtask_t task,
        MSKintt * numqonz);
    
    task (input)
    An optimization task.
    numqonz (output)
    Number of non-zero elements in [[MathCmd 36]].
    Description:
    Obtains the number of non-zero quadratic terms in the objective.
  • MSK_getnumqobjnz64

    Syntax:

     

    MSKrescodee MSK_getnumqobjnz64 (
        MSKtask_t task,
        MSKint64t * numqonz);
    
    task (input)
    An optimization task.
    numqonz (output)
    Number of non-zero elements in [[MathCmd 36]].
    Description:
    Obtains the number of non-zero quadratic terms in the objective.
  • MSK_getnumvar

    Syntax:

     

    MSKrescodee MSK_getnumvar (
        MSKtask_t task,
        MSKintt * numvar);
    
    task (input)
    An optimization task.
    numvar (output)
    Number of variables.
    Description:
    Obtains the number of variables.
  • MSK_getobjname

    Syntax:

     

    MSKrescodee MSK_getobjname (
        MSKtask_t task,
        MSKCONST size_t maxlen,
        size_t * len,
        char * objname);
    
    task (input)
    An optimization task.
    maxlen (input)
    Length of 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.
  • MSK_getobjname64

    Syntax:

     

    MSKrescodee MSK_getobjname64 (
        MSKtask_t task,
        MSKint64t maxlen,
        MSKint64t * len,
        char * objname);
    
    task (input)
    An optimization task.
    maxlen (input)
    Length of 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.
  • MSK_getobjsense

    Syntax:

     

    MSKrescodee MSK_getobjsense (
        MSKtask_t task,
        MSKobjsensee * sense);
    
    task (input)
    An optimization task.
    sense (output)
    The returned objective sense.
    Description:
    Gets the objective sense of the task.
    See also:

     

    MSK_putobjsense

    Sets the objective sense.

  • MSK_getparammax

    Syntax:

     

    MSKrescodee MSK_getparammax (
        MSKtask_t task,
        MSKparametertypee partype,
        MSKCONST MSKintt * parammax);
    
    task (input)
    An optimization task.
    partype (input)
    Parameter type.
    parammax (input)
    Description:
    Obtains the maximum index of a parameter of a given type plus 1.
  • MSK_getparamname

    Syntax:

     

    MSKrescodee MSK_getparamname (
        MSKtask_t task,
        MSKparametertypee partype,
        MSKintt param,
        char * parname);
    
    task (input)
    An optimization task.
    partype (input)
    Parameter type.
    param (input)
    Which parameter.
    parname (output)
    Parameter name.
    Description:
    Obtains the name for a parameter param of type partype.
  • MSK_getpbi

    Syntax:

     

    MSKrescodee MSK_getpbi (
        MSKtask_t task,
        MSKsoltypee whichsol,
        MSKaccmodee accmode,
        MSKCONST MSKidxt * sub,
        MSKintt len,
        MSKrealt * pbi,
        MSKintt normalize);
    
    task (input)
    An optimization task.
    whichsol (input)
    Selects a solution.
    accmode (input)
    If set to MSK_ACC_VAR return bound infeasibility for x otherwise for [[MathCmd 289]].
    sub (input)
    An array of constraint or variable indexes.
    len (input)
    Length of sub and pbi
    pbi (output)
    Bound infeasibility for x or [[MathCmd 289]].
    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 MSK_ACC_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.4.6)

    If acmode is MSK_ACC_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.4.7)
    See also:

     

    MSK_getsolutioninf

    Obtains information about a solution.

  • MSK_getpcni

    Syntax:

     

    MSKrescodee MSK_getpcni (
        MSKtask_t task,
        MSKsoltypee whichsol,
        MSKCONST MSKidxt * sub,
        MSKintt len,
        MSKrealt * pcni);
    
    task (input)
    An optimization task.
    whichsol (input)
    Selects a solution.
    sub (input)
    Constraint indexes for which to calculate the equation infeasibility.
    len (input)
    Length of sub and pcni
    pcni (output)
    pcni[i] contains primal cone infeasibility for the cone with index sub[i].
    Description:
    Obtains the primal cone infeasibility.
    See also:

     

    MSK_getsolutioninf

    Obtains information about a solution.

  • MSK_getpeqi

    Syntax:

     

    MSKrescodee MSK_getpeqi (
        MSKtask_t task,
        MSKsoltypee whichsol,
        MSKCONST MSKidxt * sub,
        MSKintt len,
        MSKrealt * peqi,
        MSKintt normalize);
    
    task (input)
    An optimization task.
    whichsol (input)
    Selects a solution.
    sub (input)
    Constraint indexes for which to calculate the equation infeasibility.
    len (input)
    Length of sub and peqi
    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.4.8)
    See also:

     

    MSK_getsolutioninf

    Obtains information about a solution.

  • MSK_getprimalobj

    Syntax:

     

    MSKrescodee MSK_getprimalobj (
        MSKtask_t task,
        MSKsoltypee whichsol,
        MSKrealt * primalobj);
    
    task (input)
    An optimization task.
    whichsol (input)
    Selects a solution.
    primalobj (output)
    Objective value corresponding to the primal solution.
    Description:
    Obtains the primal objective value for a solution.
  • MSK_getprobtype

    Syntax:

     

    MSKrescodee MSK_getprobtype (
        MSKtask_t task,
        MSKproblemtypee * probtype);
    
    task (input)
    An optimization task.
    probtype (output)
    The problem type.
    Description:
    Obtains the problem type.
  • MSK_getqconk

    Syntax:

     

    MSKrescodee MSK_getqconk (
        MSKtask_t task,
        MSKidxt k,
        MSKintt maxnumqcnz,
        MSKintt * qcsurp,
        MSKintt * numqcnz,
        MSKidxt * qcsubi,
        MSKidxt * qcsubj,
        MSKrealt * qcval);
    
    task (input)
    An optimization task.
    k (input)
    Which constraint.
    maxnumqcnz (input)
    Length of the arrays qcsubi, qcsubj, and qcval.
    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 94]]. See (5.8.4).
    qcsubj (output)
    j subscripts for [[MathCmd 94]]. See (5.8.4).
    qcval (output)
    Numerical value for [[MathCmd 94]].
    Description:
    Obtains all the quadratic terms in a constraint. The quadratic terms are stored sequentially qcsubi, qcsubj, and qcval.
  • MSK_getqconk64

    Syntax:

     

    MSKrescodee MSK_getqconk64 (
        MSKtask_t task,
        MSKidxt k,
        MSKint64t maxnumqcnz,
        MSKint64t * qcsurp,
        MSKint64t * numqcnz,
        MSKidxt * qcsubi,
        MSKidxt * qcsubj,
        MSKrealt * qcval);
    
    task (input)
    An optimization task.
    k (input)
    Which constraint.
    maxnumqcnz (input)
    Length of the arrays qcsubi, qcsubj, and qcval.
    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 94]]. See (5.8.4).
    qcsubj (output)
    j subscripts for [[MathCmd 94]]. See (5.8.4).
    qcval (output)
    Numerical value for [[MathCmd 94]].
    Description:
    Obtains all the quadratic terms in a constraint. The quadratic terms are stored sequentially qcsubi, qcsubj, and qcval.
  • MSK_getqobj

    Syntax:

     

    MSKrescodee MSK_getqobj (
        MSKtask_t task,
        MSKintt maxnumqonz,
        MSKintt * qosurp,
        MSKintt * numqonz,
        MSKidxt * qosubi,
        MSKidxt * qosubj,
        MSKrealt * qoval);
    
    task (input)
    An optimization task.
    maxnumqonz (input)
    The length of the arrays qosubi, qosubj, and 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 36]].
    qosubi (output)
    i subscript for [[MathCmd 88]].
    qosubj (output)
    j subscript for [[MathCmd 88]].
    qoval (output)
    Numerical value for [[MathCmd 88]].
    Description:
    Obtains the quadratic terms in the objective. The required quadratic terms are stored sequentially in qosubi, qosubj, and qoval.
  • MSK_getqobj64

    Syntax:

     

    MSKrescodee MSK_getqobj64 (
        MSKtask_t task,
        MSKint64t maxnumqonz,
        MSKint64t * qosurp,
        MSKint64t * numqonz,
        MSKidxt * qosubi,
        MSKidxt * qosubj,
        MSKrealt * qoval);
    
    task (input)
    An optimization task.
    maxnumqonz (input)
    The length of the arrays qosubi, qosubj, and 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 36]].
    qosubi (output)
    i subscript for [[MathCmd 88]].
    qosubj (output)
    j subscript for [[MathCmd 88]].
    qoval (output)
    Numerical value for [[MathCmd 88]].
    Description:
    Obtains the quadratic terms in the objective. The required quadratic terms are stored sequentially in qosubi, qosubj, and qoval.
  • MSK_getqobjij

    Syntax:

     

    MSKrescodee MSK_getqobjij (
        MSKtask_t task,
        MSKidxt i,
        MSKidxt j,
        MSKrealt * qoij);
    
    task (input)
    An optimization task.
    i (input)
    Row index of the coefficient.
    j (input)
    Column index of coefficient.
    qoij (output)
    The required coefficient.
    Description:
    Obtains one coefficient [[MathCmd 88]] in the quadratic term of the objective.
  • MSK_getreducedcosts

    Syntax:

     

    MSKrescodee MSK_getreducedcosts (
        MSKtask_t task,
        MSKsoltypee whichsol,
        MSKidxt first,
        MSKidxt last,
        MSKrealt * redcosts);
    
    task (input)
    An optimization task.
    whichsol (input)
    Selects a solution.
    first (input)
    See formula (15.4.9) for the definition.
    last (input)
    See formula (15.4.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.4.9)
  • MSK_getsolution

    Syntax:

     

    MSKrescodee MSK_getsolution (
        MSKtask_t task,
        MSKsoltypee whichsol,
        MSKprostae * prosta,
        MSKsolstae * solsta,
        MSKstakeye * skc,
        MSKstakeye * skx,
        MSKstakeye * skn,
        MSKrealt * xc,
        MSKrealt * xx,
        MSKrealt * y,
        MSKrealt * slc,
        MSKrealt * suc,
        MSKrealt * slx,
        MSKrealt * sux,
        MSKrealt * snx);
    
    task (input)
    An optimization task.
    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 936]]).
    suc (output)
    Dual variables corresponding to the upper bounds on the constraints ([[MathCmd 937]]).
    slx (output)
    Dual variables corresponding to the lower bounds on the variables ([[MathCmd 938]]).
    sux (output)
    Dual variables corresponding to the upper bounds on the variables (appears as [[MathCmd 939]]).
    snx (output)
    Dual variables corresponding to the conic constraints on the variables ([[MathCmd 940]]).
    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.4.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.4.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 936]].

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

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

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

    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:

    MSK_SOL_STA_OPTIMAL An optimal solution satisfying the optimality criteria for continuous problems is returned.

    MSK_SOL_STA_INTEGER_OPTIMAL An optimal solution satisfying the optimality criteria for integer problems is returned.

    MSK_SOL_STA_PRIM_FEAS A solution satisfying the feasibility criteria.

    MSK_SOL_STA_PRIM_INFEAS_CER A primal certificate of infeasibility is returned.

    MSK_SOL_STA_DUAL_INFEAS_CER A dual certificate of infeasibility is returned.

    See also:

     

    MSK_getsolutioni

    Obtains the solution for a single constraint or variable.

    MSK_getsolutionslice

    Obtains a slice of the solution.

  • MSK_getsolutioni

    Syntax:

     

    MSKrescodee MSK_getsolutioni (
        MSKtask_t task,
        MSKaccmodee accmode,
        MSKidxt i,
        MSKsoltypee whichsol,
        MSKstakeye * sk,
        MSKrealt * x,
        MSKrealt * sl,
        MSKrealt * su,
        MSKrealt * sn);
    
    task (input)
    An optimization task.
    accmode (input)
    If set to MSK_ACC_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:

     

    MSK_getsolution

    Obtains the complete solution.

    MSK_getsolutionslice

    Obtains a slice of the solution.

  • MSK_getsolutionincallback

    Syntax:

     

    MSKrescodee MSK_getsolutionincallback (
        MSKtask_t task,
        MSKcallbackcodee where,
        MSKsoltypee whichsol,
        MSKprostae * prosta,
        MSKsolstae * solsta,
        MSKstakeye * skc,
        MSKstakeye * skx,
        MSKstakeye * skn,
        MSKrealt * xc,
        MSKrealt * xx,
        MSKrealt * y,
        MSKrealt * slc,
        MSKrealt * suc,
        MSKrealt * slx,
        MSKrealt * sux,
        MSKrealt * snx);
    
    task (input)
    An optimization task.
    where (input)
    The call-back-key from the current call-back
    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 936]]).
    suc (output)
    Dual variables corresponding to the upper bounds on the constraints ([[MathCmd 937]]).
    slx (output)
    Dual variables corresponding to the lower bounds on the variables ([[MathCmd 938]]).
    sux (output)
    Dual variables corresponding to the upper bounds on the variables (appears as [[MathCmd 939]]).
    snx (output)
    Dual variables corresponding to the conic constraints on the variables ([[MathCmd 940]]).
    Description:

    Obtains the whole or a part of the solution from within a progress call-back. This function must only be called from a progress call-back function.

    This is an experimental feature. Please contact MOSEK support before using this function.

  • MSK_getsolutioninf

    Syntax:

     

    MSKrescodee MSK_getsolutioninf (
        MSKtask_t task,
        MSKsoltypee whichsol,
        MSKprostae * prosta,
        MSKsolstae * solsta,
        MSKrealt * primalobj,
        MSKrealt * maxpbi,
        MSKrealt * maxpcni,
        MSKrealt * maxpeqi,
        MSKrealt * maxinti,
        MSKrealt * dualobj,
        MSKrealt * maxdbi,
        MSKrealt * maxdcni,
        MSKrealt * maxdeqi);
    
    task (input)
    An optimization task.
    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.4.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.4.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.4.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.4.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.4.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.4.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.4.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.4.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.4.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 MSK_getsolutionstatus instead.

    See also:

     

    MSK_getpeqi

    Obtains the primal equation infeasibility.

    MSK_getdeqi

    Optains the dual equation infeasibility.

    MSK_getpbi

    Obtains the primal bound infeasibility.

    MSK_getdbi

    Obtains the dual bound infeasibility.

    MSK_getdcni

    Obtains the dual cone infeasibility.

    MSK_getpcni

    Obtains the primal cone infeasibility.

    MSK_analyzesolution

    Print information related to the quality of the solution.

    MSK_getsolutionstatus

    Obtains information about the problem and solution statuses.

  • MSK_getsolutionslice

    Syntax:

     

    MSKrescodee MSK_getsolutionslice (
        MSKtask_t task,
        MSKsoltypee whichsol,
        MSKsoliteme solitem,
        MSKidxt first,
        MSKidxt last,
        MSKrealt * values);
    
    task (input)
    An optimization task.
    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 962]] 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.4.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.4.22)

    The solitem argument determines which part of the solution is returned:

    MSK_SOL_ITEM_XX: The variable values return x.

    MSK_SOL_ITEM_Y: The variable values return y.

    MSK_SOL_ITEM_SLC: The variable values return [[MathCmd 936]].

    MSK_SOL_ITEM_SUC: The variable values return [[MathCmd 937]].

    MSK_SOL_ITEM_SLX: The variable values return [[MathCmd 938]].

    MSK_SOL_ITEM_SUX: The variable values return [[MathCmd 939]].

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

    This introduces one additional dual variable [[MathCmd 940]]. This variable can be acceded by selecting solitem as MSK_SOL_ITEM_SNX.

    The meaning of the values returned by this function also depends on the solution status which can be obtained with MSK_getsolutionstatus. Depending on the solution status value will be:

    MSK_SOL_STA_OPTIMAL A part of the optimal solution satisfying the optimality criteria for continuous problems.

    MSK_SOL_STA_INTEGER_OPTIMAL A part of the optimal solution satisfying the optimality criteria for integer problems.

    MSK_SOL_STA_PRIM_FEAS A part of the solution satisfying the feasibility criteria.

    MSK_SOL_STA_PRIM_INFEAS_CER A part of the primal certificate of infeasibility.

    MSK_SOL_STA_DUAL_INFEAS_CER A part of the dual certificate of infeasibility.

    See also:

     

    MSK_getsolution

    Obtains the complete solution.

    MSK_getsolutioni

    Obtains the solution for a single constraint or variable.

  • MSK_getsolutionstatus

    Syntax:

     

    MSKrescodee MSK_getsolutionstatus (
        MSKtask_t task,
        MSKsoltypee whichsol,
        MSKprostae * prosta,
        MSKsolstae * solsta);
    
    task (input)
    An optimization task.
    whichsol (input)
    Selects a solution.
    prosta (output)
    Problem status.
    solsta (output)
    Solution status.
    Description:
    Obtains information about the problem and solution statuses.
  • MSK_getsolutionstatuskeyslice

    Syntax:

     

    MSKrescodee MSK_getsolutionstatuskeyslice (
        MSKtask_t task,
        MSKaccmodee accmode,
        MSKsoltypee whichsol,
        MSKidxt first,
        MSKidxt last,
        MSKstakeye * sk);
    
    task (input)
    An optimization task.
    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 962]] 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:

     

    MSK_getsolution

    Obtains the complete solution.

    MSK_getsolutioni

    Obtains the solution for a single constraint or variable.

  • MSK_getstrparam

    Syntax:

     

    MSKrescodee MSK_getstrparam (
        MSKtask_t task,
        MSKsparame param,
        MSKCONST size_t maxlen,
        size_t * len,
        char * parvalue);
    
    task (input)
    An optimization task.
    param (input)
    Which parameter.
    maxlen (input)
    Length of the parvalue buffer.
    len (output)
    The length of the parameter value.
    parvalue (output)
    If this is not NULL, the parameter value is stored here.
    Description:
    Obtains the value of a string parameter.
  • MSK_getstrparam64

    Syntax:

     

    MSKrescodee MSK_getstrparam64 (
        MSKtask_t task,
        MSKsparame param,
        MSKint64t maxlen,
        MSKint64t * len,
        char * parvalue);
    
    task (input)
    An optimization task.
    param (input)
    Which parameter.
    maxlen (input)
    Length of the parvalue buffer.
    len (output)
    The length of the parameter value.
    parvalue (output)
    If this is not NULL, the parameter value is stored here.
    Description:
    Obtains the value of a string parameter.
  • MSK_getstrparamal

    Syntax:

     

    MSKrescodee MSK_getstrparamal (
        MSKtask_t task,
        MSKsparame param,
        MSKCONST size_t numaddchr,
        MSKstring_t * value);
    
    task (input)
    An optimization task.
    param (input)
    Which parameter.
    numaddchr (input)
    Number of additional characters that is made room for in value[0].
    value (input/output)
    Is the value corresponding to string parameter param. value[0] is char buffer allocated MOSEK and it must be freed by MSK_freetask.
    Description:
    Obtains the value of a string parameter.
  • MSK_getsymbcon

    Syntax:

     

    MSKrescodee MSK_getsymbcon (
        MSKtask_t task,
        MSKidxt i,
        MSKCONST size_t maxlen,
        char * name,
        MSKintt * value);
    
    task (input)
    An optimization task.
    i (input)
    Index.
    maxlen (input)
    The length of the buffer pointed to by the value argument.
    name (output)
    Name of the ith symbolic constant.
    value (output)
    The corresponding value.
    Description:
    Obtains the name and corresponding value for the ith symbolic constant.
  • MSK_gettaskname

    Syntax:

     

    MSKrescodee MSK_gettaskname (
        MSKtask_t task,
        MSKCONST size_t maxlen,
        size_t * len,
        char * taskname);
    
    task (input)
    An optimization task.
    maxlen (input)
    Length of the taskname array.
    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.
  • MSK_gettaskname64

    Syntax:

     

    MSKrescodee MSK_gettaskname64 (
        MSKtask_t task,
        MSKint64t maxlen,
        MSKint64t * len,
        char * taskname);
    
    task (input)
    An optimization task.
    maxlen (input)
    Length of the taskname array.
    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.
  • MSK_getvarbranchdir

    Syntax:

     

    MSKrescodee MSK_getvarbranchdir (
        MSKtask_t task,
        MSKidxt j,
        MSKbranchdire * direction);
    
    task (input)
    An optimization task.
    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.
  • MSK_getvarbranchorder

    Syntax:

     

    MSKrescodee MSK_getvarbranchorder (
        MSKtask_t task,
        MSKidxt j,
        MSKintt * priority,
        MSKbranchdire * direction);
    
    task (input)
    An optimization task.
    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.
  • MSK_getvarbranchpri

    Syntax:

     

    MSKrescodee MSK_getvarbranchpri (
        MSKtask_t task,
        MSKidxt j,
        MSKintt * priority);
    
    task (input)
    An optimization task.
    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.
  • MSK_getvarname

    Syntax:

     

    MSKrescodee MSK_getvarname (
        MSKtask_t task,
        MSKidxt i,
        MSKCONST size_t maxlen,
        char * name);
    
    task (input)
    An optimization task.
    i (input)
    Index.
    maxlen (input)
    The length of the buffer pointed to by the name argument.
    name (output)
    Is assigned the required name.
    Description:
    Obtains a name of a variable.
    See also:

     

    MSK_getmaxnamelen

    Obtains the maximum length (not including terminating zero character) of any objective, constraint, variable or cone name.

  • MSK_getvarname64

    Syntax:

     

    MSKrescodee MSK_getvarname64 (
        MSKtask_t task,
        MSKidxt i,
        MSKint64t maxlen,
        char * name);
    
    task (input)
    An optimization task.
    i (input)
    Index.
    maxlen (input)
    The length of the buffer pointed to by the name argument.
    name (output)
    Is assigned the required name.
    Description:
    Obtains a name of a variable.
    See also:

     

    MSK_getmaxnamelen

    Obtains the maximum length (not including terminating zero character) of any objective, constraint, variable or cone name.

  • MSK_getvartype

    Syntax:

     

    MSKrescodee MSK_getvartype (
        MSKtask_t task,
        MSKidxt j,
        MSKvariabletypee * vartype);
    
    task (input)
    An optimization task.
    j (input)
    Index of the variable.
    vartype (output)
    Variable type of variable j.
    Description:
    Gets the variable type of one variable.
  • MSK_getvartypelist

    Syntax:

     

    MSKrescodee MSK_getvartypelist (
        MSKtask_t task,
        MSKintt num,
        MSKCONST MSKidxt * subj,
        MSKvariabletypee * vartype);
    
    task (input)
    An optimization task.
    num (input)
    Number of variables for which the variable type should be obtained.
    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].

  • MSK_initbasissolve

    Syntax:

     

    MSKrescodee MSK_initbasissolve (
        MSKtask_t task,
        MSKidxt * basis);
    
    task (input)
    An optimization task.
    basis (output)

    The array of basis indexes to use.

    The array is interpreted as follows: If [[MathCmd 972]], then [[MathCmd 973]] is in the basis at position i, otherwise [[MathCmd 974]] is in the basis at position i.

    Description:

    Prepare a task for use with the MSK_solvewithbasis function.

    This function should be called

    If the basis is singular i.e. not invertible, then the response code MSK_RES_ERR_BASIS_SINGULAR.

  • MSK_inputdata

    Syntax:

     

    MSKrescodee MSK_inputdata (
        MSKtask_t task,
        MSKintt maxnumcon,
        MSKintt maxnumvar,
        MSKintt numcon,
        MSKintt numvar,
        MSKCONST MSKrealt * c,
        MSKrealt cfix,
        MSKCONST MSKintt * aptrb,
        MSKCONST MSKintt * aptre,
        MSKCONST MSKidxt * asub,
        MSKCONST MSKrealt * aval,
        MSKCONST MSKboundkeye * bkc,
        MSKCONST MSKrealt * blc,
        MSKCONST MSKrealt * buc,
        MSKCONST MSKboundkeye * bkx,
        MSKCONST MSKrealt * blx,
        MSKCONST MSKrealt * bux);
    
    task (input)
    An optimization task.
    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.

  • MSK_inputdata64

    Syntax:

     

    MSKrescodee MSK_inputdata64 (
        MSKtask_t task,
        MSKintt maxnumcon,
        MSKintt maxnumvar,
        MSKintt numcon,
        MSKintt numvar,
        MSKCONST MSKrealt * c,
        MSKrealt cfix,
        MSKCONST MSKint64t * aptrb,
        MSKCONST MSKint64t * aptre,
        MSKCONST MSKidxt * asub,
        MSKCONST MSKrealt * aval,
        MSKCONST MSKboundkeye * bkc,
        MSKCONST MSKrealt * blc,
        MSKCONST MSKrealt * buc,
        MSKCONST MSKboundkeye * bkx,
        MSKCONST MSKrealt * blx,
        MSKCONST MSKrealt * bux);
    
    task (input)
    An optimization task.
    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.

  • MSK_isdouparname

    Syntax:

     

    MSKrescodee MSK_isdouparname (
        MSKtask_t task,
        MSKCONST char * parname,
        MSKdparame * param);
    
    task (input)
    An optimization task.
    parname (input)
    Parameter name.
    param (output)
    Which parameter.
    Description:
    Checks whether parname is a valid double parameter name.
  • MSK_isintparname

    Syntax:

     

    MSKrescodee MSK_isintparname (
        MSKtask_t task,
        MSKCONST char * parname,
        MSKiparame * param);
    
    task (input)
    An optimization task.
    parname (input)
    Parameter name.
    param (output)
    Which parameter.
    Description:
    Checks whether parname is a valid integer parameter name.
  • MSK_isstrparname

    Syntax:

     

    MSKrescodee MSK_isstrparname (
        MSKtask_t task,
        MSKCONST char * parname,
        MSKsparame * param);
    
    task (input)
    An optimization task.
    parname (input)
    Parameter name.
    param (output)
    Which parameter.
    Description:
    Checks whether parname is a valid string parameter name.
  • MSK_linkfiletotaskstream

    Syntax:

     

    MSKrescodee MSK_linkfiletotaskstream (
        MSKtask_t task,
        MSKstreamtypee whichstream,
        MSKCONST char * filename,
        MSKintt append);
    
    task (input)
    An optimization task.
    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.
  • MSK_linkfunctotaskstream

    Syntax:

     

    MSKrescodee MSK_linkfunctotaskstream (
        MSKtask_t task,
        MSKstreamtypee whichstream,
        MSKuserhandle_t handle,
        MSKstreamfunc func);
    
    task (input)
    An optimization task.
    whichstream (input)
    Index of the stream.
    handle (input)
    A user-defined handle which is passed to the user-defined function func.
    func (input)
    All output to the stream whichstream is passed to func.
    Description:
    Connects a user-defined function to a task stream.
  • MSK_makesolutionstatusunknown

    Syntax:

     

    MSKrescodee MSK_makesolutionstatusunknown (
        MSKtask_t task,
        MSKsoltypee whichsol);
    
    task (input)
    An optimization task.
    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.
  • MSK_netextraction

    Syntax:

     

    MSKrescodee MSK_netextraction (
        MSKtask_t task,
        MSKintt * numcon,
        MSKintt * numvar,
        MSKidxt * netcon,
        MSKidxt * netvar,
        MSKrealt * scalcon,
        MSKrealt * scalvar,
        MSKrealt * cx,
        MSKboundkeye * bkc,
        MSKrealt * blc,
        MSKrealt * buc,
        MSKboundkeye * bkx,
        MSKrealt * blx,
        MSKrealt * bux,
        MSKidxt * from,
        MSKidxt * to);
    
    task (input)
    Task containing the linear problem the network extraction heuristics should be performed on.
    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 MSK_netoptimize.
    Each arc a in the network corresponds to a scaled subset of elements in column [[MathCmd 975]] 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.6. The relation between A and the extracted embedded network can be explained as follows:

    • [[MathCmd 976]]
    • [[MathCmd 977]]
    • 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:

     

    MSK_netoptimize

    Optimizes a pure network flow problem.

  • MSK_netoptimize

    Syntax:

     

    MSKrescodee MSK_netoptimize (
        MSKtask_t task,
        MSKintt numcon,
        MSKintt numvar,
        MSKCONST MSKrealt * cc,
        MSKCONST MSKrealt * cx,
        MSKCONST MSKboundkeye * bkc,
        MSKCONST MSKrealt * blc,
        MSKCONST MSKrealt * buc,
        MSKCONST MSKboundkeye * bkx,
        MSKCONST MSKrealt * blx,
        MSKCONST MSKrealt * bux,
        MSKCONST MSKidxt * from,
        MSKCONST MSKidxt * to,
        MSKprostae * prosta,
        MSKsolstae * solsta,
        MSKbooleant hotstart,
        MSKstakeye * skc,
        MSKstakeye * skx,
        MSKrealt * xc,
        MSKrealt * xx,
        MSKrealt * y,
        MSKrealt * slc,
        MSKrealt * suc,
        MSKrealt * slx,
        MSKrealt * sux);
    
    task (input)
    An optimization task.
    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:

     

    MSK_netextraction

    Finds embedded network structure.

  • MSK_optimize

    Syntax:

     

    MSKrescodee MSK_optimize (MSKtask_t task)
    
    task (input)
    An optimization task.
    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 MSK_IPAR_OPTIMIZER.
    See also:

     

    MSK_optimizeconcurrent

    Optimize a given task with several optimizers concurrently.

    MSK_getsolution

    Obtains the complete solution.

    MSK_getsolutioni

    Obtains the solution for a single constraint or variable.

    MSK_getsolutioninf

    Obtains information about a solution.

    MSK_IPAR_OPTIMIZER
  • MSK_optimizeconcurrent

    Syntax:

     

    MSKrescodee MSK_optimizeconcurrent (
        MSKtask_t task,
        MSKCONST MSKtask_t * taskarray,
        MSKintt num);
    
    task (input)
    An optimization task.
    taskarray (input)
    An array of num tasks.
    num (input)
    Length of taskarray.
    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 978]] 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 MSK_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 MSK_optimizeconcurrent does the following:

    1. All data except task parameters (MSKiparam, MSKdparam and MSKsparam) 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.

  • MSK_optimizersummary

    Syntax:

     

    MSKrescodee MSK_optimizersummary (
        MSKtask_t task,
        MSKstreamtypee whichstream);
    
    task (input)
    An optimization task.
    whichstream (input)
    Index of the stream.
    Description:
    Prints a short summary with optimizer statistics for last optimization.
  • MSK_optimizetrm

    Syntax:

     

    MSKrescodee MSK_optimizetrm (
        MSKtask_t task,
        MSKrescodee * trmcode);
    
    task (input)
    An optimization task.
    trmcode (output)
    Is either MSK_RES_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 MSK_IPAR_OPTIMIZER.

    This function is equivalent to MSK_optimize except in the case where MSK_optimize would have returned a termination response code such as

    Response codes comes in three categories:

    • Errors: Indicate that an error has occurred during the optimization. E.g that the optimizer has run out of memory (MSK_RES_ERR_SPACE).
    • Warnings: Less fatal than errors. E.g MSK_RES_WRN_LARGE_CJ indicating possibly problematic problem data.
    • Termination codes: Relaying information about the conditions under which the optimizer terminated. E.g MSK_RES_TRM_MAX_ITERATIONS indicates that the optimizer finished because it reached the maximum number of iterations specified by the user.

    This function returns errors on the left hand side. Warnings are not returned and termination codes are returned in the separate argument trmcode.

    See also:

     

    MSK_optimize

    Optimizes the problem.

    MSK_optimizeconcurrent

    Optimize a given task with several optimizers concurrently.

    MSK_getsolution

    Obtains the complete solution.

    MSK_getsolutioni

    Obtains the solution for a single constraint or variable.

    MSK_getsolutioninf

    Obtains information about a solution.

    MSK_IPAR_OPTIMIZER
  • MSK_primalsensitivity

    Syntax:

     

    MSKrescodee MSK_primalsensitivity (
        MSKtask_t task,
        MSKintt numi,
        MSKCONST MSKidxt * subi,
        MSKCONST MSKmarke * marki,
        MSKintt numj,
        MSKCONST MSKidxt * subj,
        MSKCONST MSKmarke * markj,
        MSKrealt * leftpricei,
        MSKrealt * rightpricei,
        MSKrealt * leftrangei,
        MSKrealt * rightrangei,
        MSKrealt * leftpricej,
        MSKrealt * rightpricej,
        MSKrealt * leftrangej,
        MSKrealt * rightrangej);
    
    task (input)
    An optimization task.
    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] = MSK_MARK_UP the upper bound of constraint subi[i] is analyzed, and if marki[i] = MSK_MARK_LO the lower bound is analyzed. If subi[i] is an equality constraint, either MSK_MARK_LO or MSK_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.4.24)

    Suppose that

                        numi = 1;
                        subi = [0];
                        marki = [MSK_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.4.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] = MSK_MARK_UP the upper bound of constraint subi[j] is analyzed, and if markj[j] = MSK_MARK_LO the lower bound is analyzed. If subi[j] is an equality constraint, either MSK_MARK_LO or MSK_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 MSK_IPAR_SENSITIVITY_TYPE.

    See also:

     

    MSK_dualsensitivity

    Performs sensitivity analysis on objective coefficients.

    MSK_sensitivityreport

    Creates a sensitivity report.

    MSK_IPAR_SENSITIVITY_TYPE
    MSK_IPAR_LOG_SENSITIVITY
    MSK_IPAR_LOG_SENSITIVITY_OPT
  • MSK_printdata

    Syntax:

     

    MSKrescodee MSK_printdata (
        MSKtask_t task,
        MSKstreamtypee whichstream,
        MSKidxt firsti,
        MSKidxt lasti,
        MSKidxt firstj,
        MSKidxt lastj,
        MSKidxt firstk,
        MSKidxt lastk,
        MSKintt c,
        MSKintt qo,
        MSKintt a,
        MSKintt qc,
        MSKintt bc,
        MSKintt bx,
        MSKintt vartype,
        MSKintt cones);
    
    task (input)
    An optimization task.
    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 36]] is printed.
    a (input)
    If non-zero A is printed.
    qc (input)
    If non-zero [[MathCmd 37]] 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.
  • MSK_printparam

    Syntax:

     

    MSKrescodee MSK_printparam (MSKtask_t task)
    
    task (input)
    An optimization task.
    Description:
    Prints the current parameter settings to the message stream.
  • MSK_probtypetostr

    Syntax:

     

    MSKrescodee MSK_probtypetostr (
        MSKtask_t task,
        MSKproblemtypee probtype,
        char * str);
    
    task (input)
    An optimization task.
    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.
  • MSK_prostatostr

    Syntax:

     

    MSKrescodee MSK_prostatostr (
        MSKtask_t task,
        MSKprostae prosta,
        char * str);
    
    task (input)
    An optimization task.
    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.
  • MSK_putaij

    Syntax:

     

    MSKrescodee MSK_putaij (
        MSKtask_t task,
        MSKidxt i,
        MSKidxt j,
        MSKrealt aij);
    
    task (input)
    An optimization task.
    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 897]].
    Description:

    Changes a coefficient in A using the method

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

     

    MSK_putavec

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

    MSK_putaij

    Changes a single value in the linear coefficient matrix.

    MSK_putmaxnumanz

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

  • MSK_putaijlist

    Syntax:

     

    MSKrescodee MSK_putaijlist (
        MSKtask_t task,
        MSKintt num,
        MSKCONST MSKidxt * subi,
        MSKCONST MSKidxt * subj,
        MSKCONST MSKrealt * valij);
    
    task (input)
    An optimization task.
    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 897]].
    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 897]] entry appears multiple times only the last one will be used.

    See also:

     

    MSK_putavec

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

    MSK_putaij

    Changes a single value in the linear coefficient matrix.

    MSK_putmaxnumanz

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

  • MSK_putavec

    Syntax:

     

    MSKrescodee MSK_putavec (
        MSKtask_t task,
        MSKaccmodee accmode,
        MSKidxt i,
        MSKintt nzi,
        MSKCONST MSKidxt * asub,
        MSKCONST MSKrealt * aval);
    
    task (input)
    An optimization task.
    accmode (input)
    Defines whether to replace a column or a row.
    i (input)
    If accmode equals MSK_ACC_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 897]] values that should be changed.
    aval (input)
    New [[MathCmd 897]] 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:

     

    MSK_putavec

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

    MSK_putaij

    Changes a single value in the linear coefficient matrix.

    MSK_putmaxnumanz

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

  • MSK_putaveclist

    Syntax:

     

    MSKrescodee MSK_putaveclist (
        MSKtask_t task,
        MSKaccmodee accmode,
        MSKintt num,
        MSKCONST MSKidxt * sub,
        MSKCONST MSKintt * ptrb,
        MSKCONST MSKintt * ptre,
        MSKCONST MSKidxt * asub,
        MSKCONST MSKrealt * aval);
    
    task (input)
    An optimization task.
    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 MSK_ACC_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:

     

    MSK_putavec

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

    MSK_putmaxnumanz

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

  • MSK_putaveclist64

    Syntax:

     

    MSKrescodee MSK_putaveclist64 (
        MSKtask_t task,
        MSKaccmodee accmode,
        MSKintt num,
        MSKCONST MSKidxt * sub,
        MSKCONST MSKint64t * ptrb,
        MSKCONST MSKint64t * ptre,
        MSKCONST MSKidxt * asub,
        MSKCONST MSKrealt * aval);
    
    task (input)
    An optimization task.
    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 MSK_ACC_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:

     

    MSK_putavec

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

    MSK_putmaxnumanz

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

  • MSK_putbound

    Syntax:

     

    MSKrescodee MSK_putbound (
        MSKtask_t task,
        MSKaccmodee accmode,
        MSKidxt i,
        MSKboundkeye bk,
        MSKrealt bl,
        MSKrealt bu);
    
    task (input)
    An optimization task.
    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 MSK_DPAR_DATA_TOL_BOUND_INF it is considered infinite and the bound key is changed accordingly. If a bound value is numerically larger than MSK_DPAR_DATA_TOL_BOUND_WRN, a warning will be displayed, but the bound is inputted as specified.

    See also:

     

    MSK_putboundlist

    Changes the bounds of constraints or variables.

  • MSK_putboundlist

    Syntax:

     

    MSKrescodee MSK_putboundlist (
        MSKtask_t task,
        MSKaccmodee accmode,
        MSKintt num,
        MSKCONST MSKidxt * sub,
        MSKCONST MSKboundkeye * bk,
        MSKCONST MSKrealt * bl,
        MSKCONST MSKrealt * bu);
    
    task (input)
    An optimization task.
    accmode (input)
    Defines whether bounds for constraints (MSK_ACC_CON) or variables (MSK_ACC_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:

     

    MSK_putbound

    Changes the bound for either one constraint or one variable.

    MSK_DPAR_DATA_TOL_BOUND_INF
    MSK_DPAR_DATA_TOL_BOUND_WRN
  • MSK_putboundslice

    Syntax:

     

    MSKrescodee MSK_putboundslice (
        MSKtask_t task,
        MSKaccmodee con,
        MSKidxt first,
        MSKidxt last,
        MSKCONST MSKboundkeye * bk,
        MSKCONST MSKrealt * bl,
        MSKCONST MSKrealt * bu);
    
    task (input)
    An optimization task.
    con (input)
    Defines whether bounds for constraints (MSK_ACC_CON) or variables (MSK_ACC_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:

     

    MSK_putbound

    Changes the bound for either one constraint or one variable.

    MSK_DPAR_DATA_TOL_BOUND_INF
    MSK_DPAR_DATA_TOL_BOUND_WRN
  • MSK_putcallbackfunc

    Syntax:

     

    MSKrescodee MSK_putcallbackfunc (
        MSKtask_t task,
        MSKcallbackfunc func,
        MSKuserhandle_t handle);
    
    task (input)
    An optimization task.
    func (input)
    A user-defined function which will be called occasionally from within the MOSEK optimizers. If the argument is a NULL pointer, then a previous inputted call-back function removed. The progress function has the type MSK_callbackfunc.
    handle (input)
    A pointer to a user-defined data structure. Whenever the function callbackfunc is called, then handle is passed to the function.
    Description:
    The function is used to input a user-defined progress call-back function of type MSK_callbackfunc. The call-back function is called frequently during the optimization process.
    See also:

     

    MSK_IPAR_LOG_SIM_FREQ
  • MSK_putcfix

    Syntax:

     

    MSKrescodee MSK_putcfix (
        MSKtask_t task,
        MSKrealt cfix);
    
    task (input)
    An optimization task.
    cfix (input)
    Fixed term in the objective.
    Description:
    Replaces the fixed term in the objective by a new one.
  • MSK_putcj

    Syntax:

     

    MSKrescodee MSK_putcj (
        MSKtask_t task,
        MSKidxt j,
        MSKrealt cj);
    
    task (input)
    An optimization task.
    j (input)
    Index of the variable for which c should be changed.
    cj (input)
    New value of [[MathCmd 92]].
    Description:

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

    \begin{displaymath}\nonumber{}c_{{\mathtt{j}}}=\mathtt{cj}.\end{displaymath}
  • MSK_putclist

    Syntax:

     

    MSKrescodee MSK_putclist (
        MSKtask_t task,
        MSKintt num,
        MSKCONST MSKidxt * subj,
        MSKCONST MSKrealt * val);
    
    task (input)
    An optimization task.
    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.

  • MSK_putcone

    Syntax:

     

    MSKrescodee MSK_putcone (
        MSKtask_t task,
        MSKidxt k,
        MSKconetypee conetype,
        MSKrealt conepar,
        MSKintt nummem,
        MSKCONST MSKidxt * submem);
    
    task (input)
    An optimization task.
    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.
  • MSK_putdouparam

    Syntax:

     

    MSKrescodee MSK_putdouparam (
        MSKtask_t task,
        MSKdparame param,
        MSKrealt parvalue);
    
    task (input)
    An optimization task.
    param (input)
    Which parameter.
    parvalue (input)
    Parameter value.
    Description:
    Sets the value of a double parameter.
  • MSK_putintparam

    Syntax:

     

    MSKrescodee MSK_putintparam (
        MSKtask_t task,
        MSKiparame param,
        MSKintt parvalue);
    
    task (input)
    An optimization task.
    param (input)
    Which parameter.
    parvalue (input)
    Parameter value.
    Description:
    Sets the value of an integer parameter.
  • MSK_putmaxnumanz

    Syntax:

     

    MSKrescodee MSK_putmaxnumanz (
        MSKtask_t task,
        MSKintt maxnumanz);
    
    task (input)
    An optimization task.
    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:

     

    MSK_IINF_STO_NUM_A_REALLOC
  • MSK_putmaxnumanz64

    Syntax:

     

    MSKrescodee MSK_putmaxnumanz64 (
        MSKtask_t task,
        MSKint64t maxnumanz);
    
    task (input)
    An optimization task.
    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:

     

    MSK_IINF_STO_NUM_A_REALLOC
  • MSK_putmaxnumcon

    Syntax:

     

    MSKrescodee MSK_putmaxnumcon (
        MSKtask_t task,
        MSKintt maxnumcon);
    
    task (input)
    An optimization task.
    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.

  • MSK_putmaxnumcone

    Syntax:

     

    MSKrescodee MSK_putmaxnumcone (
        MSKtask_t task,
        MSKintt maxnumcone);
    
    task (input)
    An optimization task.
    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.

  • MSK_putmaxnumqnz

    Syntax:

     

    MSKrescodee MSK_putmaxnumqnz (
        MSKtask_t task,
        MSKintt maxnumqnz);
    
    task (input)
    An optimization task.
    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.

  • MSK_putmaxnumqnz64

    Syntax:

     

    MSKrescodee MSK_putmaxnumqnz64 (
        MSKtask_t task,
        MSKint64t maxnumqnz);
    
    task (input)
    An optimization task.
    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.

  • MSK_putmaxnumvar

    Syntax:

     

    MSKrescodee MSK_putmaxnumvar (
        MSKtask_t task,
        MSKintt maxnumvar);
    
    task (input)
    An optimization task.
    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.

  • MSK_putnadouparam

    Syntax:

     

    MSKrescodee MSK_putnadouparam (
        MSKtask_t task,
        MSKCONST char * paramname,
        MSKrealt parvalue);
    
    task (input)
    An optimization task.
    paramname (input)
    Name of a parameter.
    parvalue (input)
    Parameter value.
    Description:
    Sets the value of a named double parameter.
  • MSK_putnaintparam

    Syntax:

     

    MSKrescodee MSK_putnaintparam (
        MSKtask_t task,
        MSKCONST char * paramname,
        MSKintt parvalue);
    
    task (input)
    An optimization task.
    paramname (input)
    Name of a parameter.
    parvalue (input)
    Parameter value.
    Description:
    Sets the value of a named integer parameter.
  • MSK_putname

    Syntax:

     

    MSKrescodee MSK_putname (
        MSKtask_t task,
        MSKproblemiteme whichitem,
        MSKidxt i,
        MSKCONST char * name);
    
    task (input)
    An optimization task.
    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).
  • MSK_putnastrparam

    Syntax:

     

    MSKrescodee MSK_putnastrparam (
        MSKtask_t task,
        MSKCONST char * paramname,
        MSKCONST char * parvalue);
    
    task (input)
    An optimization task.
    paramname (input)
    Name of a parameter.
    parvalue (input)
    Parameter value.
    Description:
    Sets the value of a named string parameter.
  • MSK_putnlfunc

    Syntax:

     

    MSKrescodee MSK_putnlfunc (
        MSKtask_t task,
        MSKuserhandle_t nlhandle,
        MSKnlgetspfunc nlgetsp,
        MSKnlgetvafunc nlgetva);
    
    task (input)
    An optimization task.
    nlhandle (input)
    A pointer to a user-defined data structure. It is passed to the functions nlgetsp and nlgetva whenever those two functions called.
    nlgetsp (input)
    A user-defined function which provide information about the structure of the nonlinear functions in the optimization problem.
    nlgetva (input)
    A user-defined function which is used to evaluate the nonlinear function in the optimization problem at a given point.
    Description:
    This function is used to communicate the nonlinear function information to MOSEK.
  • MSK_putobjname

    Syntax:

     

    MSKrescodee MSK_putobjname (
        MSKtask_t task,
        MSKCONST char * objname);
    
    task (input)
    An optimization task.
    objname (input)
    Name of the objective.
    Description:
    Assigns the name given by objname to the objective function.
  • MSK_putobjsense

    Syntax:

     

    MSKrescodee MSK_putobjsense (
        MSKtask_t task,
        MSKobjsensee sense);
    
    task (input)
    An optimization task.
    sense (input)
    The objective sense of the task. The values MSK_OBJECTIVE_SENSE_MAXIMIZE and MSK_OBJECTIVE_SENSE_MINIMIZE means that the the problem is maximized or minimized respectively. The value MSK_OBJECTIVE_SENSE_UNDEFINED means that the objective sense is taken from the parameter MSK_IPAR_OBJECTIVE_SENSE.
    Description:
    Sets the objective sense of the task.
    See also:

     

    MSK_getobjsense

    Gets the objective sense.

  • MSK_putparam

    Syntax:

     

    MSKrescodee MSK_putparam (
        MSKtask_t task,
        MSKCONST char * parname,
        MSKCONST char * parvalue);
    
    task (input)
    An optimization task.
    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.
  • MSK_putqcon

    Syntax:

     

    MSKrescodee MSK_putqcon (
        MSKtask_t task,
        MSKintt numqcnz,
        MSKCONST MSKidxt * qcsubk,
        MSKCONST MSKidxt * qcsubi,
        MSKCONST MSKidxt * qcsubj,
        MSKCONST MSKrealt * qcval);
    
    task (input)
    An optimization task.
    numqcnz (input)
    Number of quadratic terms. See (5.8.4).
    qcsubk (input)
    k subscripts for [[MathCmd 94]]. See (5.8.4).
    qcsubi (input)
    i subscripts for [[MathCmd 94]]. See (5.8.4).
    qcsubj (input)
    j subscripts for [[MathCmd 94]]. See (5.8.4).
    qcval (input)
    Numerical value for [[MathCmd 94]].
    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.4.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.4.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.4.28)

    Values not assigned are set to zero.

    Please note that duplicate entries are added together.

    See also:

     

    MSK_putqconk

    Replaces all quadratic terms in a single constraint.

    MSK_putmaxnumqnz

    Changes the size of the preallocated storage for quadratic terms.

  • MSK_putqconk

    Syntax:

     

    MSKrescodee MSK_putqconk (
        MSKtask_t task,
        MSKidxt k,
        MSKintt numqcnz,
        MSKCONST MSKidxt * qcsubi,
        MSKCONST MSKintt * qcsubj,
        MSKCONST MSKrealt * qcval);
    
    task (input)
    An optimization task.
    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 94]]. See (5.8.4).
    qcsubj (input)
    j subscripts for [[MathCmd 94]]. See (5.8.4).
    qcval (input)
    Numerical value for [[MathCmd 94]].
    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.4.29)

    It is assumed that [[MathCmd 37]] is symmetric, i.e. [[MathCmd 1017]], and therefore, only the values of [[MathCmd 1018]] 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 MSK_putmaxnumqnz64 is employed to specify an appropriate maxnumqnz.
    • Only the lower triangular part should be specified because [[MathCmd 37]] is symmetric. Specifying values for [[MathCmd 1018]] 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:

     

    MSK_putqcon

    Replaces all quadratic terms in constraints.

    MSK_putmaxnumqnz

    Changes the size of the preallocated storage for quadratic terms.

  • MSK_putqobj

    Syntax:

     

    MSKrescodee MSK_putqobj (
        MSKtask_t task,
        MSKintt numqonz,
        MSKCONST MSKidxt * qosubi,
        MSKCONST MSKidxt * qosubj,
        MSKCONST MSKrealt * qoval);
    
    task (input)
    An optimization task.
    numqonz (input)
    Number of non-zero elements in [[MathCmd 36]].
    qosubi (input)
    i subscript for [[MathCmd 88]].
    qosubj (input)
    j subscript for [[MathCmd 88]].
    qoval (input)
    Numerical value for [[MathCmd 88]].
    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.4.30)

    It is assumed that [[MathCmd 36]] is symmetric, i.e. [[MathCmd 1028]], and therefore, only the values of [[MathCmd 1029]] 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 36]] is symmetric. Specifying values for [[MathCmd 1029]] 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.

  • MSK_putqobjij

    Syntax:

     

    MSKrescodee MSK_putqobjij (
        MSKtask_t task,
        MSKidxt i,
        MSKidxt j,
        MSKrealt qoij);
    
    task (input)
    An optimization task.
    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 88]].
    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 1035]] 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 MSK_putqobj instead whenever possible.

  • MSK_putresponsefunc

    Syntax:

     

    MSKrescodee MSK_putresponsefunc (
        MSKtask_t task,
        MSKresponsefunc responsefunc,
        MSKuserhandle_t handle);
    
    task (input)
    An optimization task.
    responsefunc (input)
    A user-defined response handling function.
    handle (input)
    A user-defined data structure that is passed to the function responsefunc whenever it is called.
    Description:
    Inputs a user-defined error call-back which is called when an error or warning occurs.
  • MSK_putsolution

    Syntax:

     

    MSKrescodee MSK_putsolution (
        MSKtask_t task,
        MSKsoltypee whichsol,
        MSKCONST MSKstakeye * skc,
        MSKCONST MSKstakeye * skx,
        MSKCONST MSKstakeye * skn,
        MSKCONST MSKrealt * xc,
        MSKCONST MSKrealt * xx,
        MSKCONST MSKrealt * y,
        MSKCONST MSKrealt * slc,
        MSKCONST MSKrealt * suc,
        MSKCONST MSKrealt * slx,
        MSKCONST MSKrealt * sux,
        MSKCONST MSKrealt * snx);
    
    task (input)
    An optimization task.
    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 936]]).
    suc (input)
    Dual variables corresponding to the upper bounds on the constraints ([[MathCmd 937]]).
    slx (input)
    Dual variables corresponding to the lower bounds on the variables ([[MathCmd 938]]).
    sux (input)
    Dual variables corresponding to the upper bounds on the variables (appears as [[MathCmd 939]]).
    snx (input)
    Dual variables corresponding to the conic constraints on the variables ([[MathCmd 940]]).
    Description:
    Inserts a solution into the task.
  • MSK_putsolutioni

    Syntax:

     

    MSKrescodee MSK_putsolutioni (
        MSKtask_t task,
        MSKaccmodee accmode,
        MSKidxt i,
        MSKsoltypee whichsol,
        MSKstakeye sk,
        MSKrealt x,
        MSKrealt sl,
        MSKrealt su,
        MSKrealt sn);
    
    task (input)
    An optimization task.
    accmode (input)
    If set to MSK_ACC_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 MSK_makesolutionstatusunknown function, then for each relevant constraint and variable call MSK_putsolutioni to set the solution information.

    See also:

     

    MSK_makesolutionstatusunknown

    Sets the solution status to unknown.

  • MSK_putsolutionyi

    Syntax:

     

    MSKrescodee MSK_putsolutionyi (
        MSKtask_t task,
        MSKidxt i,
        MSKsoltypee whichsol,
        MSKrealt y);
    
    task (input)
    An optimization task.
    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:

     

    MSK_makesolutionstatusunknown

    Sets the solution status to unknown.

    MSK_putsolutioni

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

  • MSK_putstrparam

    Syntax:

     

    MSKrescodee MSK_putstrparam (
        MSKtask_t task,
        MSKsparame param,
        MSKCONST char * parvalue);
    
    task (input)
    An optimization task.
    param (input)
    Which parameter.
    parvalue (input)
    Parameter value.
    Description:
    Sets the value of a string parameter.
  • MSK_puttaskname

    Syntax:

     

    MSKrescodee MSK_puttaskname (
        MSKtask_t task,
        MSKCONST char * taskname);
    
    task (input)
    An optimization task.
    taskname (input)
    Name assigned to the task.
    Description:
    Assigns the name taskname to the task.
  • MSK_putvarbranchorder

    Syntax:

     

    MSKrescodee MSK_putvarbranchorder (
        MSKtask_t task,
        MSKidxt j,
        MSKintt priority,
        int direction);
    
    task (input)
    An optimization task.
    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.
  • MSK_putvartype

    Syntax:

     

    MSKrescodee MSK_putvartype (
        MSKtask_t task,
        MSKidxt j,
        MSKvariabletypee vartype);
    
    task (input)
    An optimization task.
    j (input)
    Index of the variable.
    vartype (input)
    The new variable type.
    Description:
    Sets the variable type of one variable.
    See also:

     

    MSK_putvartypelist

    Sets the variable type for one or more variables.

  • MSK_putvartypelist

    Syntax:

     

    MSKrescodee MSK_putvartypelist (
        MSKtask_t task,
        MSKintt num,
        MSKCONST MSKidxt * subj,
        MSKCONST MSKvariabletypee * vartype);
    
    task (input)
    An optimization task.
    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 1041]] is assigned the variable type [[MathCmd 1042]].

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

    See also:

     

    MSK_putvartype

    Sets the variable type of one variable.

  • MSK_readbranchpriorities

    Syntax:

     

    MSKrescodee MSK_readbranchpriorities (
        MSKtask_t task,
        MSKCONST char * filename);
    
    task (input)
    An optimization task.
    filename (input)
    Data is read from the file filename.
    Description:
    Reads branching priority data from a file.
    See also:

     

    MSK_writebranchpriorities

    Writes branching priority data to a file.

  • MSK_readdata

    Syntax:

     

    MSKrescodee MSK_readdata (
        MSKtask_t task,
        MSKCONST char * filename);
    
    task (input)
    An optimization task.
    filename (input)
    Data is read from the file filename if it is a nonempty string. Otherwise data is read from the file specified by MSK_SPAR_DATA_FILE_NAME.
    Description:

    Reads an optimization data and associated data from a file.

    The data file format is determined by the MSK_IPAR_READ_DATA_FORMAT parameter. By default the parameter has the value MSK_DATA_FORMAT_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:

     

    MSK_writedata

    Writes problem data to a file.

    MSK_IPAR_READ_DATA_FORMAT
  • MSK_readparamfile

    Syntax:

     

    MSKrescodee MSK_readparamfile (MSKtask_t task)
    
    task (input)
    An optimization task.
    Description:
    Reads a parameter file.
  • MSK_readsolution

    Syntax:

     

    MSKrescodee MSK_readsolution (
        MSKtask_t task,
        MSKsoltypee whichsol,
        MSKCONST char * filename);
    
    task (input)
    An optimization task.
    whichsol (input)
    Selects a solution.
    filename (input)
    A valid file name.
    Description:
    Reads a solution file and inserts the solution into the solution whichsol.
  • MSK_readsummary

    Syntax:

     

    MSKrescodee MSK_readsummary (
        MSKtask_t task,
        MSKstreamtypee whichstream);
    
    task (input)
    An optimization task.
    whichstream (input)
    Index of the stream.
    Description:
    Prints a short summary of last file that was read.
  • MSK_relaxprimal

    Syntax:

     

    MSKrescodee MSK_relaxprimal (
        MSKtask_t task,
        MSKtask_t * relaxedtask,
        MSKrealt * wlc,
        MSKrealt * wuc,
        MSKrealt * wlx,
        MSKrealt * wux);
    
    task (input)
    An optimization task.
    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 1043]], then [[MathCmd 645]] 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 1045]], then [[MathCmd 646]] 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 1047]] then [[MathCmd 1048]] 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 1049]] then [[MathCmd 1050]] 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.4.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.4.32)

    Hence, the function adds so-called elasticity variables to all the constraints which relax the constraints, for instance [[MathCmd 645]] and [[MathCmd 646]] relax [[MathCmd 650]] and [[MathCmd 1056]] respectively. It should be obvious that (15.4.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 654]], [[MathCmd 655]], [[MathCmd 656]] and [[MathCmd 657]] 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.4.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 1043]] then [[MathCmd 645]] is fixed to zero.

    Now let [[MathCmd 660]] be the optimal objective value to (15.4.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.4.33)

    where the original objective function is minimized subject to the constraint that the total weighted relaxation is minimal.

    The parameter MSK_IPAR_FEASREPAIR_OPTIMIZE controls whether the function returns the problem (15.4.32) or the problem (15.4.33).The parameter can take one of the following values.

    MSK_FEASREPAIR_OPTIMIZE_NONE

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

    MSK_FEASREPAIR_OPTIMIZE_PENALTY

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

    MSK_FEASREPAIR_OPTIMIZE_COMBINED

    : The returned task relaxedtask contains problem (15.4.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 646]] ([[MathCmd 1068]]) is named “NAME_CON*up” (“NAME_VAR*up”).
    • The variable corresponding to [[MathCmd 645]] ([[MathCmd 647]]) is named “NAME_CON*lo” (“NAME_VAR*lo”).

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

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

     

    MSK_DPAR_FEASREPAIR_TOL
    MSK_IPAR_FEASREPAIR_OPTIMIZE
    MSK_SPAR_FEASREPAIR_NAME_SEPARATOR
    MSK_SPAR_FEASREPAIR_NAME_PREFIX
  • MSK_remove

    Syntax:

     

    MSKrescodee MSK_remove (
        MSKtask_t task,
        MSKaccmodee accmode,
        MSKintt num,
        MSKCONST MSKintt * sub);
    
    task (input)
    An optimization task.
    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:

     

    MSK_append

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

  • MSK_removecone

    Syntax:

     

    MSKrescodee MSK_removecone (
        MSKtask_t task,
        MSKidxt k);
    
    task (input)
    An optimization task.
    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.

  • MSK_resizetask

    Syntax:

     

    MSKrescodee MSK_resizetask (
        MSKtask_t task,
        MSKintt maxnumcon,
        MSKintt maxnumvar,
        MSKintt maxnumcone,
        MSKintt maxnumanz,
        MSKintt maxnumqnz);
    
    task (input)
    An optimization task.
    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:

     

    MSK_putmaxnumvar

    Sets the number of preallocated variables in the optimization task.

    MSK_putmaxnumcon

    Sets the number of preallocated constraints in the optimization task.

    MSK_putmaxnumcone

    Sets the number of preallocated conic constraints in the optimization task.

    MSK_putmaxnumanz

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

    MSK_putmaxnumqnz

    Changes the size of the preallocated storage for quadratic terms.

  • MSK_sensitivityreport

    Syntax:

     

    MSKrescodee MSK_sensitivityreport (
        MSKtask_t task,
        MSKstreamtypee whichstream);
    
    task (input)
    An optimization task.
    whichstream (input)
    Index of the stream.
    Description:
    Reads a sensitivity format file from a location given by MSK_SPAR_SENSITIVITY_FILE_NAME and writes the result to the stream whichstream. If MSK_SPAR_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:

     

    MSK_dualsensitivity

    Performs sensitivity analysis on objective coefficients.

    MSK_primalsensitivity

    Perform sensitivity analysis on bounds.

    MSK_IPAR_LOG_SENSITIVITY
    MSK_IPAR_LOG_SENSITIVITY_OPT
    MSK_IPAR_SENSITIVITY_TYPE
  • MSK_setdefaults

    Syntax:

     

    MSKrescodee MSK_setdefaults (MSKtask_t task)
    
    task (input)
    An optimization task.
    Description:
    Resets all the parameters to their default values.
  • MSK_sktostr

    Syntax:

     

    MSKrescodee MSK_sktostr (
        MSKtask_t task,
        MSKintt sk,
        char * str);
    
    task (input)
    An optimization task.
    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.
  • MSK_solstatostr

    Syntax:

     

    MSKrescodee MSK_solstatostr (
        MSKtask_t task,
        MSKsolstae solsta,
        char * str);
    
    task (input)
    An optimization task.
    solsta (input)
    Solution status.
    str (output)
    String corresponding to the solution status solsta.
    Description:
    Obtains an explanatory string corresponding to a solution status.
  • MSK_solutiondef

    Syntax:

     

    MSKrescodee MSK_solutiondef (
        MSKtask_t task,
        MSKsoltypee whichsol,
        MSKintt * isdef);
    
    task (input)
    An optimization task.
    whichsol (input)
    Selects a solution.
    isdef (output)
    Is non-zero if the requested solution is defined.
    Description:
    Checks whether a solution is defined.
  • MSK_solutionsummary

    Syntax:

     

    MSKrescodee MSK_solutionsummary (
        MSKtask_t task,
        MSKstreamtypee whichstream);
    
    task (input)
    An optimization task.
    whichstream (input)
    Index of the stream.
    Description:
    Prints a short summary of the current solutions. Please see Section 8.7 for more details.
  • MSK_solvewithbasis

    Syntax:

     

    MSKrescodee MSK_solvewithbasis (
        MSKtask_t task,
        MSKintt transp,
        MSKintt * numnz,
        MSKidxt * sub,
        MSKrealt * val);
    
    task (input)
    An optimization task.
    transp (input)
    If this argument is non-zero, then (15.4.35) is solved. Otherwise the system (15.4.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 528]].
    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 528]]. 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 1076]] if b[i]=0. As output val is the vector [[MathCmd 528]].

    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 23]] basis variables are defined. These [[MathCmd 23]] 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.4.34)

    or the system

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

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

    In order to make sense of the solution [[MathCmd 528]] it is important to know the ordering of the variables in the basis because the ordering specifies how B is constructed. When calling MSK_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 144]] 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 1086]] 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 528]] correctly.

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

    See also:

     

    MSK_initbasissolve

    Prepare a task for basis solver.

    MSK_IPAR_BASIS_SOLVE_USE_PLUS_ONE
  • MSK_strdupdbgtask

    Syntax:

     

    char * MSK_strdupdbgtask (
        MSKtask_t task,
        MSKCONST char * str,
        MSKCONST char * file,
        MSKCONST unsigned line);
    
    task (input)
    An optimization task.
    str (input)
    String that should be copied.
    file (input)
    File from which the function is called.
    line (input)
    Line in the file from which the function is called.
    Description:
    Make a copy of a string. The string created by this procedure must be freed by MSK_freetask.
  • MSK_strduptask

    Syntax:

     

    char * MSK_strduptask (
        MSKtask_t task,
        MSKCONST char * str);
    
    task (input)
    An optimization task.
    str (input)
    String that should be copied.
    Description:
    Make a copy of a string. The string created by this procedure must be freed by MSK_freetask.
  • MSK_strtoconetype

    Syntax:

     

    MSKrescodee MSK_strtoconetype (
        MSKtask_t task,
        MSKCONST char * str,
        MSKconetypee * conetype);
    
    task (input)
    An optimization task.
    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.
  • MSK_strtosk

    Syntax:

     

    MSKrescodee MSK_strtosk (
        MSKtask_t task,
        MSKCONST char * str,
        MSKintt * sk);
    
    task (input)
    An optimization task.
    str (input)
    Status key string.
    sk (output)
    Status key corresponding to the string.
    Description:
    Obtains the status key corresponding to an explanatory string.
  • MSK_undefsolution

    Syntax:

     

    MSKrescodee MSK_undefsolution (
        MSKtask_t task,
        MSKsoltypee whichsol);
    
    task (input)
    An optimization task.
    whichsol (input)
    Selects a solution.
    Description:
    Undefines a solution. Purges all information regarding whichsol.
  • MSK_unlinkfuncfromtaskstream

    Syntax:

     

    MSKrescodee MSK_unlinkfuncfromtaskstream (
        MSKtask_t task,
        MSKstreamtypee whichstream);
    
    task (input)
    An optimization task.
    whichstream (input)
    Index of the stream.
    Description:
    Disconnects a user-defined function from a task stream.
  • MSK_whichparam

    Syntax:

     

    MSKrescodee MSK_whichparam (
        MSKtask_t task,
        MSKCONST char * parname,
        MSKparametertypee * partype,
        MSKintt * param);
    
    task (input)
    An optimization task.
    parname (input)
    Parameter name.
    partype (output)
    Parameter type.
    param (output)
    Which parameter.
    Description:
    Checks if parname is valid parameter name. If yes then, partype and param denotes the type and the index of parameter respectively.
  • MSK_writebranchpriorities

    Syntax:

     

    MSKrescodee MSK_writebranchpriorities (
        MSKtask_t task,
        MSKCONST char * filename);
    
    task (input)
    An optimization task.
    filename (input)
    Data is written to the file filename.
    Description:
    Writes branching priority data to a file.
    See also:

     

    MSK_readbranchpriorities

    Reads branching priority data from a file.

  • MSK_writedata

    Syntax:

     

    MSKrescodee MSK_writedata (
        MSKtask_t task,
        MSKCONST char * filename);
    
    task (input)
    An optimization task.
    filename (input)
    Data is written to the file filename if it is a nonempty string. Otherwise data is written to the file specified by MSK_SPAR_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 MSK_IPAR_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 MSK_IPAR_WRITE_GENERIC_NAMES parameter to MSK_ON.

    See also:

     

    MSK_readdata

    Reads problem data from a file.

    MSK_IPAR_WRITE_DATA_FORMAT
  • MSK_writeparamfile

    Syntax:

     

    MSKrescodee MSK_writeparamfile (
        MSKtask_t task,
        MSKCONST char * filename);
    
    task (input)
    An optimization task.
    filename (input)
    The name of parameter file.
    Description:
    Writes all the parameters to a parameter file.
  • MSK_writesolution

    Syntax:

     

    MSKrescodee MSK_writesolution (
        MSKtask_t task,
        MSKsoltypee whichsol,
        MSKCONST char * filename);
    
    task (input)
    An optimization task.
    whichsol (input)
    Selects a solution.
    filename (input)
    A valid file name.
    Description:
    Saves the current basic, interior-point, or integer solution to a file.
Wed Feb 29 16:08:52 2012