Initializing help system before first use

XPRSglobalenv

  • All Implemented Interfaces:
    java.lang.AutoCloseable

    public class XPRSglobalenv
    extends XPRSobject
    Provides access to the global optimizer environment.
    • Method Detail

      • close

        public void close()
                   throws XPRSexception
        The Global Environment is destroyed by XPRS.free() so this close() function does nothing.
        Specified by:
        close in interface  java.lang.AutoCloseable
        Specified by:
        close in class  XPRSobject
        Throws:
        XPRSexception
        Since:
        38
      • setCheckedMode

        public void setCheckedMode​(boolean checkedmode)
                            throws XPRSexception
        You can use this function to disable some of the checking and validation of function calls and function call parameters for calls to the Xpress Optimizer API. This checking is relatively lightweight but disabling it can improve performance in cases where non-intensive Xpress Optimizer functions are called repeatedly in a short space of time. Please note: after disabling function call checking and validation, invalid usage of Xpress Optimizer functions may not be detected and may cause the Xpress Optimizer process to behave unexpectedly or crash. It is not recommended that you disable function call checking and validation during application development.
        Parameters:
        checkedmode - Pass as 0 to disable much of the validation for all Xpress function calls from the current process. Pass 1 to re-enable validation. By default, validation is enabled.
        Throws:
        XPRSexception
      • getCheckedMode

        public void getCheckedMode​(BoolHolder p_checkedmode)
                            throws XPRSexception
        You can use this function to interrogate whether checking and validation of all Optimizer function calls is enabled for the current process. Checking and validation is enabled by default but can be disabled by setCheckedMode.
        Parameters:
        p_checkedmode - Variable that is set to 0 if checking and validation of Optimizer function calls is disabled for the current process, non-zero otherwise.
        Throws:
        XPRSexception
      • getBanner

        public void getBanner​(StringHolder banner)
                       throws XPRSexception
        Returns the banner and copyright message.
        Parameters:
        banner - A buffer of at least XPRS_MAXBANNERLENGTH characters in which the null terminated banner string will be returned.
        Throws:
        XPRSexception
      • getVersion

        public static void getVersion​(StringHolder version)
                               throws XPRSexception
        Returns the full Optimizer version number in the form 15.10.03, where 15 is the major release, 10 is the minor release, and 03 is the build number.
        Parameters:
        version - Buffer long enough to hold the version string (plus a null terminator). This should be at least 16 characters.
        Throws:
        XPRSexception
      • getVersionNumbers

        public static void getVersionNumbers​(IntHolder p_major,
                                             IntHolder p_minor,
                                             IntHolder p_build)
                                      throws XPRSexception
        Returns the Optimizer version numbers split into major, minor, and build number.
        Parameters:
        p_major - Pointer to integer to receive the major version number. Can be null.
        p_minor - Pointer to integer to receive the minor version number. This is a number from 0 to 99. Can be null.
        p_build - Pointer to integer to receive the build number. This is a number from 0 to 99. Can be null.
        Throws:
        XPRSexception
      • getDaysLeft

        public void getDaysLeft​(IntHolder p_daysleft)
                         throws XPRSexception
        Returns the number of days left until the license expires.
        Parameters:
        p_daysleft - Pointer to an integer where the number of days is to be returned. For a permanent license, the return value will be XPRS_MAXINT
        Throws:
        XPRSexception
      • featureQuery

        public void featureQuery​(java.lang.String feature,
                                 IntHolder p_status)
                          throws XPRSexception
        Checks if the provided feature is available in the current license used by the optimizer.
        Parameters:
        feature - The feature string to be checked in the license.
        p_status - Return status of the check, a value of 1 indicates the feature is available.
        Throws:
        XPRSexception
      • setArchConsistency

        public void setArchConsistency​(int consistent)
                                throws XPRSexception
        Sets whether to force the same execution path on various CPU architecture extensions, in particular (pre-)AVX and AVX2.
        Parameters:
        consistent - Whether to force the same execution path:
        • 0: Do not force the same execution path (default behavior);
        • 1: Force the same execution path.
        Throws:
        XPRSexception
      • getLastError

        public java.lang.String getLastError()
                                      throws XPRSexception
        Returns the last error encountered during a call to the Xpress global environment.
        Specified by:
        getLastError in class  XPRSobject
        Returns:
        The requested information.
        Throws:
        XPRSexception
      • getLastError

        public java.lang.String getLastError​(IntHolder p_msgcode)
                                      throws XPRSexception
        Returns the last error encountered during a call to the Xpress global environment.
        Parameters:
        p_msgcode - Memory location in which the error code will be returned. Can be null if not required.
        Returns:
        The requested information.
        Throws:
        XPRSexception
      • setComputeAllowed

        public void setComputeAllowed​(XPRSenumerations.AllowCompute allow)
                               throws XPRSexception
        Set whether the current application is allowed to use the Insight Compute interface.
        Parameters:
        allow - Whether the Insight Compute interface may be used; must be one of the following constants:
        • XPRS_ALLOW_COMPUTE_ALWAYS: Always allow solves to be sent to Compute.
        • XPRS_ALLOW_COMPUTE_NEVER: Never allow solves to be sent to Compute.
        • XPRS_ALLOW_COMPUTE_DEFAULT: Allow solves to be sent to Compute only from non-OEM applications.
        Throws:
        XPRSexception
      • getComputeAllowed

        public XPRSenumerations.AllowCompute getComputeAllowed()
                                                        throws XPRSexception
        Query whether the current application is allowed to use the Insight Compute interface.
        Returns:
        Value will equal one of the following constants.
        • XPRS_ALLOW_COMPUTE_ALWAYS: Always allow solves to be sent to Compute.
        • XPRS_ALLOW_COMPUTE_NEVER: Never allow solves to be sent to Compute.
        • XPRS_ALLOW_COMPUTE_DEFAULT: Allow solves to be sent to Compute only from non-OEM applications.
        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)
                                      throws XPRSexception
        Removes the given MsgHandler listener from the object.
        Parameters:
        listener - The listener to remove.
        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.
        Parameters:
        listener - The listener to remove.
        data - The user data to remove.
        Throws:
        XPRSexception
      • removeMsgHandlerListeners

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

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