Documentation


GRBModel.GetPWLObj()

Retrieve the piecewise-linear objective function for a variable. The return value gives the number of points that define the function, and the $x$ and $y$ arguments give the coordinates of the points, respectively. The $x$ and $y$ arguments must be large enough to hold the result. Call this method with null values for $x$ and $y$ if you just want the number of points.

Refer to the description of SetPWLObj for additional information on what the values in $x$ and $y$ mean.

int GetPWLObj ( GRBVar var,
    double[] x,
    double[] y )
    Arguments:

    var: The variable whose objective function is being retrieved.

    x: The $x$ values for the points that define the piecewise-linear function. These will always be in non-decreasing order.

    y: The $y$ values for the points that define the piecewise-linear function.

    Return value:

    The number of points that define the piecewise-linear objective function.