XPRSbranchobject
- java.lang.Object
-
- com.dashoptimization.XPRSobject
-
- com.dashoptimization.XPRSbranchobject
-
public class XPRSbranchobject extends XPRSobject
Class encapsulating a branch object
-
-
Method Summary
Modifier and Type Method and Description voidaddBounds(int ibranch, int nbounds, byte[] cbndtype, int[] mbndcol, double[] dbndval)voidaddBranches(int nbranches)voidaddCuts(int ibranch, int ncuts, XPRScut[] mcutind)voidaddMsgHandlerListener(XPRSmsgHandlerListener listener)Add a listener for the MsgHandlercallback.voidaddMsgHandlerListener(XPRSmsgHandlerListener listener, int priority)Add the listener for the MsgHandlercallback.voidaddMsgHandlerListener(XPRSmsgHandlerListener listener, java.lang.Object data)Add the listener for the MsgHandlercallback.voidaddMsgHandlerListener(XPRSmsgHandlerListener listener, java.lang.Object data, int priority)Add the listener for the MsgHandlercallback.voidaddRows(int ibranch, int nrows, int nelems, byte[] crtype, double[] drrhs, int[] mrbeg, int[] mcol, double[] dval)voiddestroy()Deallocates resources associated with an XPRSobjectintgetBounds(int ibranch)intgetBounds(int ibranch, int nbounds_size, byte[] cbndtype, int[] mbndcol, double[] dbndval)intgetBranches()voidgetID(IntHolder p_id)java.lang.StringgetLastError()Returns last error message that occurred on this XPRSobjectjava.lang.StringgetLastError(IntHolder iMsgCode)intgetRows(int ibranch)intgetRows(int ibranch, int nrows_size, IntHolder p_nelems, int nelems_size, byte[] crtype, double[] drrhs, int[] mrbeg, int[] mcol, double[] dval)voidremoveMsgHandlerListener()Removes all MsgHandler listeners from the object.voidremoveMsgHandlerListener(XPRSmsgHandlerListener listener)Removes the given MsgHandler listener from the object.voidremoveMsgHandlerListener(XPRSmsgHandlerListener listener, java.lang.Object data)Removes the given MsgHandler listener with the given data value from the object.voidremoveMsgHandlerListeners()Remove all listeners for the MsgHandler callbackvoidsetPreferredBranch(int ibranch)voidsetPriority(int ipriority)intstore()Commits the branch object to the XPRSprob.voidvalidate(IntHolder p_status)-
Methods inherited from class com.dashoptimization.XPRSobject
addMsgHandlerListener, addMsgHandlerListener, isDestroyed
-
-
-
-
Method Detail
-
store
public int store() throws XPRSexceptionCommits the branch object to the XPRSprob. Note that the XPRSbranchobject will be invalidated when store() returns.- Throws:
-
XPRSexception
-
destroy
public void destroy() throws XPRSexceptionDescription copied from class:XPRSobjectDeallocates resources associated with an XPRSobject- Specified by:
-
destroyin classXPRSobject - Throws:
-
XPRSexception
-
addBranches
public void addBranches(int nbranches) throws XPRSexception- Throws:
-
XPRSexception
-
getBranches
public int getBranches() throws XPRSexception- Throws:
-
XPRSexception
-
setPriority
public void setPriority(int ipriority) throws XPRSexception- Throws:
-
XPRSexception
-
setPreferredBranch
public void setPreferredBranch(int ibranch) throws XPRSexception- Throws:
-
XPRSexception
-
addBounds
public void addBounds(int ibranch, int nbounds, byte[] cbndtype, int[] mbndcol, double[] dbndval) throws XPRSexception- Throws:
-
XPRSexception
-
getBounds
public int getBounds(int ibranch, int nbounds_size, byte[] cbndtype, int[] mbndcol, double[] dbndval) throws XPRSexception- Throws:
-
XPRSexception
-
getBounds
public int getBounds(int ibranch) throws XPRSexception- Throws:
-
XPRSexception
-
addRows
public void addRows(int ibranch, int nrows, int nelems, byte[] crtype, double[] drrhs, int[] mrbeg, int[] mcol, double[] dval) throws XPRSexception- Throws:
-
XPRSexception
-
getRows
public int getRows(int ibranch, int nrows_size, IntHolder p_nelems, int nelems_size, byte[] crtype, double[] drrhs, int[] mrbeg, int[] mcol, double[] dval) throws XPRSexception- Throws:
-
XPRSexception
-
getRows
public int getRows(int ibranch) throws XPRSexception- Throws:
-
XPRSexception
-
addCuts
public void addCuts(int ibranch, int ncuts, XPRScut[] mcutind) throws XPRSexception- Throws:
-
XPRSexception
-
getID
public void getID(IntHolder p_id) throws XPRSexception
- Throws:
-
XPRSexception
-
getLastError
public java.lang.String getLastError() throws XPRSexceptionDescription copied from class:XPRSobjectReturns last error message that occurred on this XPRSobject- Specified by:
-
getLastErrorin classXPRSobject - Throws:
-
XPRSexception
-
getLastError
public java.lang.String getLastError(IntHolder iMsgCode) throws XPRSexception
- Throws:
-
XPRSexception
-
validate
public void validate(IntHolder p_status) throws XPRSexception
- Throws:
-
XPRSexception
-
addMsgHandlerListener
public void addMsgHandlerListener(XPRSmsgHandlerListener listener) throws XPRSexception
Add a listener for the MsgHandlercallback. Note that an object can have multiple MsgHandler listeners.- Specified by:
-
addMsgHandlerListenerin classXPRSobject - Parameters:
-
listener- The listener to which the event will be dispatched. (If null, all MsgHandler listeners will be removed.) - Throws:
-
XPRSexception
-
addMsgHandlerListener
public void addMsgHandlerListener(XPRSmsgHandlerListener listener, java.lang.Object data) throws XPRSexception
Add the listener for the MsgHandlercallback. Note that an object can have multiple MsgHandler listeners.- Specified by:
-
addMsgHandlerListenerin classXPRSobject - Parameters:
-
listener- The listener to which the event will be dispatched. (If null, all MsgHandler listeners will be removed.) -
data- An additional object which will be passed down to the callback function - Throws:
-
XPRSexception
-
addMsgHandlerListener
public void addMsgHandlerListener(XPRSmsgHandlerListener listener, int priority) throws XPRSexception
Add the listener for the MsgHandlercallback. Note that an object can have multiple MsgHandler listeners.- Parameters:
-
listener- The listener to which the event will be dispatched. (If null, all MsgHandler listeners will be removed.) -
priority- Listeners with higher priorities are called first - Throws:
-
XPRSexception
-
addMsgHandlerListener
public void addMsgHandlerListener(XPRSmsgHandlerListener listener, java.lang.Object data, int priority) throws XPRSexception
Add the listener for the MsgHandlercallback. Note that an object can have multiple MsgHandler listeners.- Parameters:
-
listener- The listener to which the event will be dispatched. (If null, all MsgHandler listeners will be removed.) -
data- An additional object which will be passed down to the callback function -
priority- Listeners with higher priorities are called first - Throws:
-
XPRSexception
-
removeMsgHandlerListener
public void removeMsgHandlerListener(XPRSmsgHandlerListener listener) throws XPRSexception
Removes the given MsgHandler listener from the object.- Throws:
-
XPRSexception
-
removeMsgHandlerListener
public void removeMsgHandlerListener(XPRSmsgHandlerListener listener, java.lang.Object data) throws XPRSexception
Removes the given MsgHandler listener with the given data value from the object.- Throws:
-
XPRSexception
-
removeMsgHandlerListener
public void removeMsgHandlerListener() throws XPRSexceptionRemoves all MsgHandler listeners from the object. @deprecated as of Xpress 7.1, please useremoveMsgHandlerListener(XPRSmsgHandlerListener)orremoveMsgHandlerListeners()- Specified by:
-
removeMsgHandlerListenerin classXPRSobject - Throws:
-
XPRSexception
-
removeMsgHandlerListeners
public void removeMsgHandlerListeners() throws XPRSexceptionRemove all listeners for the MsgHandler callback- Throws:
-
XPRSexception
-
-
