Initializing help system before first use

XPRSbranchobject

  • All Implemented Interfaces:
    java.lang.AutoCloseable


    public class XPRSbranchobject
    extends XPRSobject
    Class encapsulating a branch object
    • Method Detail

      • store

        public int store()
                  throws XPRSexception
        Commits the branch object to the XPRSprob. Note that the XPRSbranchobject will be invalidated when store() returns.
        Throws:
        XPRSexception
      • close

        public void close()
        Description copied from class: XPRSobject
        Deallocates resources associated with an XPRSobject.
        Specified by:
        close in interface  java.lang.AutoCloseable
        Specified by:
        close in class  XPRSobject
      • addBranches

        public void addBranches(int nbranches)
                         throws XPRSexception
        Adds 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
      • setPriority

        public void setPriority(int priority)
                         throws XPRSexception
        Sets 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
      • setPreferredBranch

        public void setPreferredBranch(int branch)
                                throws XPRSexception
        Specifies 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
      • addBounds

        public void addBounds(int branch,
                              int nbounds,
                              byte[] bndtype,
                              int[] colind,
                              double[] bndval)
                       throws XPRSexception
        Adds 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 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
      • addRows

        public void addRows(int branch,
                            int nrows,
                            int ncoefs,
                            byte[] rowtype,
                            double[] rhs,
                            int[] start,
                            int[] colind,
                            double[] rowcoef)
                     throws XPRSexception
        Adds 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 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
      • addCuts

        public void addCuts(int branch,
                            int ncuts,
                            XPRScut[] cutind)
                     throws XPRSexception
        Adds 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
      • getID

        public 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
      • validate

        public 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
      • addMsgHandlerListener

        public void addMsgHandlerListener(XPRSmsgHandlerListener listener)
                                   throws XPRSexception
        Add a listener for the MsgHandler callback. Note that an object can have multiple MsgHandler listeners.
        Specified by:
        addMsgHandlerListener in class  XPRSobject
        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 a listener for the MsgHandler callback. Note that an object can have multiple MsgHandler listeners.
        Specified by:
        addMsgHandlerListener in class  XPRSobject
        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 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
      • addMsgHandlerListener

        public 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
      • 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
      • removeMsgHandlerListeners

        public void removeMsgHandlerListeners()
                                       throws XPRSexception
        Remove all listeners for the MsgHandler callback
        Throws:
        XPRSexception

© 2001-2023 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.