gethistory


Purpose
Return the history value of a variable
Synopsis
function gethistory(v:mpvar | i:integer) :integer
Arguments
an mpvar
an integer, being the index of an mpvar
Return value
The history value of the variable, or zero if the variable does not have a history or is not part of the current problem.
Example
The following example shows part of a callback function which is used to check the progress of the convergence of a variable:
function ConvergeTest(V: integer) : integer
declarations
 History:integer
end-declarations
History :=gethistory(V)
if History > 1 then
  writeln(SLPgetname(2,V)," has increased ",
    History," times in succession")
elif History < -1 then
  writeln(SLPgetname(2,V)," has decreased ",
    -History," times in succession")
end-if
end-function
Further information

This function returns the history value of an mpvar. The value describes the number of consecutive movements in the same direction which reached the step bound. Positive values of history are for positive movements (the value of the variable increases), negative values of history are for negative movements. When the direction changes sign, the history will be reset to +1 or -1.

If the argument is an integer, it is interpreted as the SLP index of the mpvar.




If you have any comments or suggestions about these pages, please send mail to docs@dashoptimization.com.