Initializing help system before first use

# XPRSprob.AbstractUserFunction

- java.lang.Object
- - com.dashoptimization.XPRSprob.AbstractUserFunction

- Direct Known Subclasses:
    `XPRSprob.MapDeltaFunction`, `XPRSprob.MapFunction`, `XPRSprob.MultiMapDeltaFunction`, `XPRSprob.MultiMapFunction`, `XPRSprob.VecMapDeltaFunction`, `XPRSprob.VecMapFunction`
  Enclosing class:
    XPRSprob

      public abstract class XPRSprob.AbstractUserFunction
      extends java.lang.Object

  Base class for user functions. You will usually not have to create an instance of this class or its subclasses yourself. Instead the way to create an instance is to use an `XPRSprob` instance as factory:

              MapFunction f = prob.nlpAddUserFunction("myf", 0, d -> 2 * d);

  That is, you create an instance of `XPRSprob.MapFunctor`, `XPRSprob.VecMapFunctor`, `XPRSprob.MultiMapFunctor`, `XPRSprob.MapDeltaFunctor`, `XPRSprob.VecMapDeltaFunctor`, or `XPRSprob.MultiMapDeltaFunctor` and then pass that to the appropriate overload of `nlpAddUserFunction`. This will register the function with the Xpress problem object and return a user function instance that can then be used in the code to build formulas.

- - ### Method Summary

    Modifier and Type | Method | Description
    --- | --- | ---
    `abstract Expression` | `call​(int output, Expression... arguments)` | Create an expression that represents a symbolic call to this function.
    `Expression` | `call​(Expression... arguments)` | Create an expression that represents a symbolic call to this function.
    `double` | `evaluate​(double[] args)` | Shorthand for `evaluate(1, args)`.
    `abstract double` | `evaluate​(int output, double[] args)` | Evaluate this function for the given values.
    `int` | `getId()` | Get the id for this function.
    `java.lang.String` | `getName()` | Get the name with which the function was registered.
    `abstract boolean` | `isMultiOutput()` | Check whether this is a function that produces more than one value for a single call.
    `void` | `storeCBException​(java.lang.Throwable ex)` |

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### getId

          public int getId()

      Get the id for this function. The id is used to identify this function in formulas that are specified as token/value arrays.
      Returns:
        This function's id.

        Examples using `getId`:

        - PolygonMap.java
        - PolygonMapDelta.java
        - PolygonMultiMap.java
        - PolygonMultiMapDelta.java
        - PolygonVecMap.java
        - PolygonVecMapDelta.java

    - #### getName

          public java.lang.String getName()

      Get the name with which the function was registered.
      Returns:
        This function's name.

        Examples using `getName`:

        - BinBurglar.java
        - ContractAllocation.java
        - CuttingStock.java
        - FolioHeuristic.java
        - FolioIIS.java
        - FolioInit.java
        - FolioMip1.java
        - FolioMip2.java
        - FolioMipIIS.java
        - FolioQC.java
        - FolioQP.java
        - MultipleProblems.java
        - PolygonObjects.java
        - QuadraticProgramming.java
        - RecursiveFinancialPlanning.java

    - #### evaluate

          public abstract double evaluate​(int output,
                                          double[] args)

      Evaluate this function for the given values.

      Examples using `evaluate`:

      - CapitalBudgeting.java
      - PolygonObjects.java
      Parameters:
        `output` - Output selector. In case the function returns multiple outputs then this selects which of them to return. Otherwise this argument is ignored. Note that the first output has index 1!
        `args` - Arguments for the function call.
      Returns:
        The result.
      Since:
        43.00

    - #### evaluate

          public double evaluate​(double[] args)

      Shorthand for `evaluate(1, args)`.

      Examples using `evaluate`:

      - CapitalBudgeting.java
      - PolygonObjects.java
      Parameters:
        `args` - Arguments for the function call.
      Returns:
        The result.
      Since:
        43.00

    - #### isMultiOutput

          public abstract boolean isMultiOutput()

      Check whether this is a function that produces more than one value for a single call.
      Returns:
        `true` if the function has more than one output, `false` otherwise.
      Since:
        43.00

    - #### call

          public abstract Expression call​(int output,
                                          Expression... arguments)

      Create an expression that represents a symbolic call to this function.
      Parameters:
        `output` - If this is a multi-output function then this specifies which output to select. Note that the first output has index 1!
        `arguments` - Arguments for the function call.
      Returns:
        The expression representing a call to this function.
      Since:
        43.00

    - #### call

          public Expression call​(Expression... arguments)

      Create an expression that represents a symbolic call to this function. Shorthand for `call(1, arguments)`.
      Parameters:
        `arguments` - Arguments to function call.
      Returns:
        The new expression.
      Since:
        43.00

    - #### storeCBException

          public void storeCBException​(java.lang.Throwable ex)

Parent Topic XPRSprob

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