XPRSbranchobject
- java.lang.Object
-  
  - com.dashoptimization.XPRSobject
-  
    - com.dashoptimization.XPRSbranchobject
 
 
-  
   - All Implemented Interfaces:
- 
     java.lang.AutoCloseable
 - Direct Known Subclasses:
- 
     XpressProblem.BranchObject
 
 public class XPRSbranchobject extends XPRSobject Class encapsulating a branch object
-  
    
   -  
         Method SummaryModifier and Type Method 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)Returns the bounds for a branch of a user branching object.intgetBounds(int branch, int maxbounds, byte[] bndtype, int[] colind, double[] bndval)Returns the bounds for a branch of a user branching object.intgetBranches()Returns the number of branches of a branching object.voidgetID(IntHolder p_id)Returns the unique identifier assigned to a branching object.java.lang.StringgetLastError()Returns the last error encountered during a call to the given branch object.java.lang.StringgetLastError(IntHolder p_msgcode)Returns the last error encountered during a call to the given branch object.intgetRows(int branch)Returns the constraints for a branch of a user branching object.intgetRows(int branch, int maxrows, IntHolder p_ncoefs, int maxcoefs, byte[] rowtype, double[] rhs, int[] start, int[] colind, double[] rowcoef)Returns the constraints for a branch of a user branching object.voidremoveMsgHandlerListener()Deprecated.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. This is a convenience wrapper forstore(IntHolder).- Returns:
- The success status of the operation, if non-zero the operation failed and the object was not stored.
- 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.This function is used in the following examples: - MostViolated
 - Parameters:
- 
          nbranches- Number of new branches to create.
- Throws:
- 
          XPRSexception
 
 -  getBranchespublic int getBranches() throws XPRSexceptionReturns the number of branches of a branching object.- Returns:
- The requested information.
- Throws:
- 
          XPRSexception
 
 -  setPrioritypublic void setPriority(int priority) throws XPRSexceptionSets the priority value of a user branching object.This function is used in the following examples: - MostViolated
 - 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.This function is used in the following examples: - MostViolated
 - 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.This function is used in the following examples: - MostViolated
 - Parameters:
- 
          branch- The number of the branch to add the new bounds for. This branch must already have been created usingaddBranches. Branches are indexed starting from zero.
- 
          nbounds- Number of new bounds to add.
- 
          bndtype- Character array of lengthnboundsindicating the type of bounds to add:- L: Lower bound.
- U: Upper bound.
 
- 
          colind- Integer array of lengthnboundscontaining the column indices for the new bounds.
- 
          bndval- Double array of lengthnboundsgiving the bound values.
- Throws:
- 
          XPRSexception
 
 -  getBoundspublic int getBounds(int branch, int maxbounds, byte[] bndtype, int[] colind, double[] bndval) throws XPRSexceptionReturns the bounds for a branch of a user branching object.- Parameters:
- 
          branch- The number of the branch to get the bounds for.
- 
          maxbounds- Maximum number of bounds to return.
- 
          bndtype- Character array of lengthmaxboundswhere the types of bounds will be returned:- L: Lower bound.
- U: Upper bound.
 
- 
          colind- Integer array of lengthmaxboundswhere the column indices will be returned. Allowed to be null.
- 
          bndval- Double array of lengthmaxboundswhere the bound values will be returned. Allowed to be null.
- Returns:
- The requested information.
- Throws:
- 
          XPRSexception
 
 -  getBoundspublic int getBounds(int branch) throws XPRSexceptionReturns the bounds for a branch of a user branching object.- Parameters:
- 
          branch- The number of the branch to get the bounds for.
- Returns:
- The requested information.
- Throws:
- 
          XPRSexception
 
 -  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.This function is used in the following examples: - LoadLP
- Trimloss
 - Parameters:
- 
          branch- The number of the branch to add the new constraints for. This branch must already have been created usingaddBranches. 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 lengthnrowsindicating the type of constraints to add:- L: Less than type.
- G: Greater than type.
- E: Equality type.
 
- 
          rhs- Double array of lengthnrowscontaining the right hand side values.
- 
          start- Integer array of lengthnrowscontaining the offsets of thecolindandrowcoefarrays of the start of the non zero coefficients in the new constraints.
- 
          colind- Integer array of lengthncoefscontaining the column indices for the non zero coefficients.
- 
          rowcoef- Double array of lengthncoefscontaining 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 XPRSexceptionReturns the constraints for a branch of a user branching object.This function is used in the following examples: - GlobalObjectiveParametrics
- GlobalRHSParametrics
- LoadLP
- Repair
- Tableau
- Trimloss
 - Parameters:
- 
          branch- The number of the branch to get the constraints from.
- 
          maxrows- Maximum number of rows to return.
- 
          p_ncoefs- Memory location where the number of non zero coefficients in the constraints should be returned.
- 
          maxcoefs- Maximum number of non zero coefficients to return.
- 
          rowtype- Character array of lengthmaxrowswhere the types of the rows will be returned:- L: Less than type.
- G: Greater than type.
- E: Equality type.
 
- 
          rhs- Double array of lengthmaxrowswhere the right hand side values will be returned.
- 
          start- Integer array of lengthmaxrowswhich will be filled with the offsets of thecolindandrowcoefarrays of the start of the non zero coefficients in the returned constraints.
- 
          colind- Integer array of lengthmaxcoefswhich will be filled with the column indices for the non zero coefficients.
- 
          rowcoef- Double array of lengthmaxcoefswhich will be filled with the non zero coefficient values.
- Returns:
- Throws:
- 
          XPRSexception
 
 -  getRowspublic int getRows(int branch) throws XPRSexceptionReturns the constraints for a branch of a user branching object.This function is used in the following examples: - GlobalObjectiveParametrics
- GlobalRHSParametrics
- LoadLP
- Repair
- Tableau
- Trimloss
 - Parameters:
- 
          branch- The number of the branch to get the constraints from.
- Returns:
- Throws:
- 
          XPRSexception
 
 -  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 usingaddBranches. Branches are indexed starting from zero.
- 
          ncuts- Number of cuts to add.
- 
          cutind- Array of lengthncutscontaining 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 XPRSexceptionReturns the last error encountered during a call to the given branch object.- Specified by:
- 
          getLastErrorin classXPRSobject
- Returns:
- The requested information.
- Throws:
- 
          XPRSexception
 
 -  getLastErrorpublic java.lang.String getLastError(IntHolder p_msgcode) throws XPRSexception Returns the last error encountered during a call to the given branch object.- Parameters:
- 
          p_msgcode- Location where the error code will be returned. Can be null if not required.
- Returns:
- The requested information.
- Throws:
- 
          XPRSexception
 
 -  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
 
 -  removeMsgHandlerListener@Deprecated public void removeMsgHandlerListener() throws XPRSexceptionDeprecated.Removes 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-2024 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.
 
