XPRSbranchobject
- java.lang.Object
-  
  - com.dashoptimization.XPRSobject
-  
    - com.dashoptimization.XPRSbranchobject
 
 
-  
   - All Implemented Interfaces:
- java.lang.AutoCloseable
 
 
 public class XPRSbranchobject extends XPRSobject Class encapsulating a branch object
-  
    
   -  
        Method SummaryModifier and Type Method and Description voidaddBounds(int branch, int nbounds, byte[] bndtype, int[] colind, double[] bndval)Adds new bounds to a branch of a user branching object.voidaddBranches(int nbranches)Adds new, empty branches to a user defined branching object.voidaddCuts(int branch, int ncuts, XPRScut[] cutind)Adds stored user cuts as new constraints to a branch of a user branching object.voidaddMsgHandlerListener(XPRSmsgHandlerListener listener)Add a listener for the MsgHandler callback.voidaddMsgHandlerListener(XPRSmsgHandlerListener listener, int priority)Add a listener for the MsgHandler callback.voidaddMsgHandlerListener(XPRSmsgHandlerListener listener, java.lang.Object data)Add a listener for the MsgHandler callback.voidaddMsgHandlerListener(XPRSmsgHandlerListener listener, java.lang.Object data, int priority)Add a listener for the MsgHandler callback.voidaddRows(int branch, int nrows, int ncoefs, byte[] rowtype, double[] rhs, int[] start, int[] colind, double[] rowcoef)Adds new constraints to a branch of a user branching object.voidclose()Deallocates resources associated with an XPRSobject.intgetBounds(int branch)Convenience wrapper forgetBounds(int, IntHolder, int, byte[], int[], double[]).intgetBounds(int branch, int maxbounds, byte[] bndtype, int[] colind, double[] bndval)Convenience wrapper forgetBounds(int, IntHolder, int, byte[], int[], double[]).intgetBranches()Convenience wrapper forgetBranches(IntHolder).voidgetID(IntHolder p_id)Returns the unique identifier assigned to a branching object.java.lang.StringgetLastError()Convenience wrapper forgetLastError(IntHolder, StringHolder, int, IntHolder).java.lang.StringgetLastError(IntHolder p_msgcode)Convenience wrapper forgetLastError(IntHolder, StringHolder, int, IntHolder).intgetRows(int branch)Convenience wrapper forgetRows(int, IntHolder, int, IntHolder, int, byte[], double[], int[], int[], double[]).intgetRows(int branch, int maxrows, IntHolder p_ncoefs, int maxcoefs, byte[] rowtype, double[] rhs, int[] start, int[] colind, double[] rowcoef)Convenience wrapper forgetRows(int, IntHolder, int, IntHolder, int, byte[], double[], int[], int[], double[]).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 branch)Specifies which of the child nodes corresponding to the branches of the object should be explored first.voidsetPriority(int priority)Sets the priority value of a user branching object.intstore()Commits the branch object to the XPRSprob.voidvalidate(IntHolder p_status)Verifies that a given branching object is valid for branching on the current branch-and-bound node of a MIP solve.-  
          Methods inherited from class com.dashoptimization.XPRSobjectaddMsgHandlerListener, addMsgHandlerListener, destroy, isDestroyed
 
-  
          
 
-  
        
-  
    
   -  
        Method Detail-  storepublic int store() throws XPRSexceptionCommits the branch object to the XPRSprob. Note that the XPRSbranchobject will be invalidated when store() returns.- Throws:
- 
         XPRSexception
 
 -  closepublic void close() Description copied from class:XPRSobjectDeallocates resources associated with an XPRSobject.- Specified by:
- 
         closein interfacejava.lang.AutoCloseable
- Specified by:
- 
         closein classXPRSobject
 
 -  addBranchespublic void addBranches(int nbranches) throws XPRSexceptionAdds new, empty branches to a user defined branching object.- Parameters:
- 
         nbranches- Number of new branches to create.
- Throws:
- 
         XPRSexception
 
 -  getBranchespublic int getBranches() throws XPRSexceptionConvenience wrapper forgetBranches(IntHolder).- Throws:
- 
         XPRSexception
- See Also:
- 
         getBranches(IntHolder)
 
 -  setPrioritypublic void setPriority(int priority) throws XPRSexceptionSets the priority value of a user branching object.- Parameters:
- 
         priority- The new priority value to assign to the branching object, which must be a number from 0 to 1000. User branching objects are created with a default priority value of 500.
- Throws:
- 
         XPRSexception
 
 -  setPreferredBranchpublic void setPreferredBranch(int branch) throws XPRSexceptionSpecifies which of the child nodes corresponding to the branches of the object should be explored first.- Parameters:
- 
         branch- The number of the branch to mark as preferred.
- Throws:
- 
         XPRSexception
 
 -  addBoundspublic void addBounds(int branch, int nbounds, byte[] bndtype, int[] colind, double[] bndval) throws XPRSexceptionAdds new bounds to a branch of a user branching object.- Parameters:
- 
         branch- The number of the branch to add the new bounds for. This branch must already have been created using addBranches. Branches are indexed starting from zero.
- 
         nbounds- Number of new bounds to add.
- 
         bndtype- Character array of length nbounds indicating the type of bounds to add:- L: Lower bound.
- U: Upper bound.
 
- 
         colind- Integer array of length nbounds containing the column indices for the new bounds.
- 
         bndval- Double array of length nbounds giving the bound values.
- Throws:
- 
         XPRSexception
 
 -  getBoundspublic int getBounds(int branch, int maxbounds, byte[] bndtype, int[] colind, double[] bndval) throws XPRSexceptionConvenience wrapper forgetBounds(int, IntHolder, int, byte[], int[], double[]).- Throws:
- 
         XPRSexception
- See Also:
- 
         getBounds(int, IntHolder, int, byte[], int[], double[])
 
 -  getBoundspublic int getBounds(int branch) throws XPRSexceptionConvenience wrapper forgetBounds(int, IntHolder, int, byte[], int[], double[]).- Throws:
- 
         XPRSexception
- See Also:
- 
         getBounds(int, IntHolder, int, byte[], int[], double[])
 
 -  addRowspublic void addRows(int branch, int nrows, int ncoefs, byte[] rowtype, double[] rhs, int[] start, int[] colind, double[] rowcoef) throws XPRSexceptionAdds new constraints to a branch of a user branching object.- Parameters:
- 
         branch- The number of the branch to add the new constraints for. This branch must already have been created using addBranches. Branches are indexed starting from zero.
- 
         nrows- Number of new constraints to add.
- 
         ncoefs- Number of non-zero coefficients in all new constraints.
- 
         rowtype- Character array of length nrows indicating the type of constraints to add:- L: Less than type.
- G: Greater than type.
- E: Equality type.
 
- 
         rhs- Double array of length nrows containing the right hand side values.
- 
         start- Integer array of length nrows containing the offsets of the colind and rowcoef arrays of the start of the non zero coefficients in the new constraints.
- 
         colind- Integer array of length ncoefs containing the column indices for the non zero coefficients.
- 
         rowcoef- Double array of length ncoefs containing the non zero coefficient values.
- Throws:
- 
         XPRSexception
 
 -  getRowspublic int getRows(int branch, int maxrows, IntHolder p_ncoefs, int maxcoefs, byte[] rowtype, double[] rhs, int[] start, int[] colind, double[] rowcoef) throws XPRSexceptionConvenience wrapper forgetRows(int, IntHolder, int, IntHolder, int, byte[], double[], int[], int[], double[]).
 -  getRowspublic int getRows(int branch) throws XPRSexceptionConvenience wrapper forgetRows(int, IntHolder, int, IntHolder, int, byte[], double[], int[], int[], double[]).
 -  addCutspublic void addCuts(int branch, int ncuts, XPRScut[] cutind) throws XPRSexceptionAdds stored user cuts as new constraints to a branch of a user branching object.- Parameters:
- 
         branch- The number of the branch to add the cuts for. This branch must already have been created using addBranches. Branches are indexed starting from zero.
- 
         ncuts- Number of cuts to add.
- 
         cutind- Array of length ncuts containing the pointers to user cuts that should be added to the branch.
- Throws:
- 
         XPRSexception
 
 -  getIDpublic void getID(IntHolder p_id) throws XPRSexception Returns the unique identifier assigned to a branching object.- Parameters:
- 
         p_id- Pointer to an integer where the identifier should be returned.
- Throws:
- 
         XPRSexception
 
 -  getLastErrorpublic java.lang.String getLastError() throws XPRSexceptionConvenience wrapper forgetLastError(IntHolder, StringHolder, int, IntHolder).- Specified by:
- 
         getLastErrorin classXPRSobject
- Throws:
- 
         XPRSexception
- See Also:
- 
         getLastError(IntHolder, StringHolder, int, IntHolder)
 
 -  getLastErrorpublic java.lang.String getLastError(IntHolder p_msgcode) throws XPRSexception Convenience wrapper forgetLastError(IntHolder, StringHolder, int, IntHolder).- Throws:
- 
         XPRSexception
- See Also:
- 
         getLastError(IntHolder, StringHolder, int, IntHolder)
 
 -  validatepublic void validate(IntHolder p_status) throws XPRSexception Verifies that a given branching object is valid for branching on the current branch-and-bound node of a MIP solve. The function will check that all branches are non-empty, and if required, verify that the branching object can be presolved.- Parameters:
- 
         p_status- The returned status from checking the provided branching object:- 0: The object is acceptable.
- 1: Failed to presolve the object due to dual reductions in presolve.
- 2: Failed to presolve the object due to duplicate column reductions in presolve.
- 3: The object contains an empty branch.
 
- Throws:
- 
         XPRSexception
 
 -  addMsgHandlerListenerpublic void addMsgHandlerListener(XPRSmsgHandlerListener listener) throws XPRSexception Add a listener for the MsgHandler callback. 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
 
 -  addMsgHandlerListenerpublic void addMsgHandlerListener(XPRSmsgHandlerListener listener, java.lang.Object data) throws XPRSexception Add a listener for the MsgHandler callback. 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
 
 -  addMsgHandlerListenerpublic void addMsgHandlerListener(XPRSmsgHandlerListener listener, int priority) throws XPRSexception Add a listener for the MsgHandler callback. 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
 
 -  addMsgHandlerListenerpublic void addMsgHandlerListener(XPRSmsgHandlerListener listener, java.lang.Object data, int priority) throws XPRSexception Add a listener for the MsgHandler callback. 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
 
 -  removeMsgHandlerListenerpublic void removeMsgHandlerListener(XPRSmsgHandlerListener listener) throws XPRSexception Removes the given MsgHandler listener from the object.- Throws:
- 
         XPRSexception
 
 -  removeMsgHandlerListenerpublic 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
 
 -  removeMsgHandlerListenerpublic 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
 
 -  removeMsgHandlerListenerspublic void removeMsgHandlerListeners() throws XPRSexceptionRemove all listeners for the MsgHandler callback- Throws:
- 
         XPRSexception
 
 
-  
 
-  
        
© 2001-2021 Fair Isaac Corporation. All rights reserved. This documentation is the property of Fair Isaac Corporation (“FICO”). Receipt or possession of this documentation does not convey rights to disclose, reproduce, make derivative works, use, or allow others to use it except solely for internal evaluation purposes to determine whether to purchase a license to the software described in this documentation, or as otherwise set forth in a written software license agreement between you and FICO (or a FICO affiliate). Use of this documentation and the software described in it must conform strictly to the foregoing permitted uses, and no other use is permitted.
 
