16.10 Function Types

callbackfunc
def callbackfunc (code, dinf, iinf, liinf) -> stop

The progress and information callback function is a user-defined function which will be called by MOSEK occasionally during the optimization process. In particular, the callback function is called at the beginning of each iteration in the interior-point optimizer. For the simplex optimizers iparam.log_sim_freq controls how frequently the callback is called.

The user must not call any MOSEK function directly or indirectly from the callback function. The only exception is the possibility to retrieve an integer solution, see Progress and data callback.

Parameters:
 
  • code (callbackcode) – Callback code indicating current operation of the solver. (input)
  • dinf (float[]) – Array of double information items. (input)
  • iinf (int[]) – Array of integer information items. (input)
  • liinf (int[]) – Array of long integer information items. (input)
Return:
 

stop (int) – Non-zero if the optimizer should be terminated; zero otherwise.

progresscallbackfunc
def progresscallbackfunc (code) -> stop

The progress callback function is a user-defined function which will be called by MOSEK occasionally during the optimization process. In particular, the callback function is called at the beginning of each iteration in the interior-point optimizer. For the simplex optimizers iparam.log_sim_freq controls how frequently the callback is called.

The user must not call any MOSEK function directly or indirectly from the callback function. If the progress callback function returns a non-zero value, the optimization process is terminated.

Parameters:
 code (mosek.callbackcode) – Callback code indicating the current status of the solver. (input)
Return:
 stop (int) – Non-zero if the optimizer should be terminated; zero otherwise.
streamfunc
def streamfunc (msg)

The message-stream callback function is a user-defined function which can be linked to any of the MOSEK streams. Doing so, the function is called whenever MOSEK sends a message to the stream.

The user must not call any MOSEK function directly or indirectly from the callback function.

Parameters:
 msg (str) – A string containing the message. (input)