Initializing help system before first use

XpressProblem

  • All Implemented Interfaces:
    java.lang.AutoCloseable

    public class XpressProblem
    extends XPRSprob
    Optimizer interface that allows modeling by objects.
    • Field Detail

      • NULL_VARIABLE

        public static final Variable NULL_VARIABLE
        Variable object that is used to indicate a constant term in expressions that are implemented as maps.
        Since:
        43.00
      • callbacks

        public final XpressProblem.CallbackAPI callbacks
        Property through which callbacks for this instance can be accessed.
    • Constructor Detail

      • XpressProblem

        public XpressProblem()
        Create a new problem without internal name. If not yet done then Xpress is initialized with the license found at the default license location. If Xpress is initialized this way then it will be automatically de-initialized once the newly created problem instance is closed.
        Since:
        43.00
      • XpressProblem

        public XpressProblem​(java.lang.String problemName)
        Create a new problem with internal name. If not yet done then Xpress is initialized with the license found at the default license location. If Xpress is initialized this way then it will be automatically de-initialized once the newly created problem instance is closed.
        Parameters:
        problemName - Internal name of new problem, can be null.
        Since:
        43.00
      • XpressProblem

        public XpressProblem​(java.lang.String problemName,
                             java.lang.String licensePath)
        Create a new problem with internal name and non-default license. If not yet done then Xpress is initialized with the license found at licensePath. If Xpress is initialized this way then it will be automatically de-initialized once the newly created problem instance is closed.
        Parameters:
        problemName - Internal name of new problem, can be null.
        licensePath - Path to license location. Can be null or the empty string to indicate that the license is in the default location.
        Since:
        43.00
    • Method Detail

      • chgObj

        public XpressProblem chgObj​(Variable variable,
                                    double coefficient)
        Change objective function coefficient. This changes linear coefficient in the first/primary objective function. In order to delete a coefficient from the obejctive set it to 0 (zero),

        Used in these examples:

        • GlobalObjectiveParametrics
        • GoalProg
        Parameters:
        variable - Variable for which to change coefficient.
        coefficient - New coefficient for variables.
        Returns:
        Always returns this instance.
        Since:
        43.00
      • chgObj

        public XpressProblem chgObj​(Variable[] variables,
                                    double[] coefficients)
        Change objective function coefficients. This changes linear coefficients in the first/primary objective function. In order to delete a coefficient from the obejctive set it to 0 (zero),

        Used in these examples:

        • GlobalObjectiveParametrics
        • GoalProg
        Parameters:
        variables - Variables for which to change coefficients.
        coefficients - New coefficients for variables.
        Returns:
        Always returns this instance.
        Since:
        43.00
      • chgObjN

        public XpressProblem chgObjN​(int objidx,
                                     Variable variable,
                                     double coefficient)
        Change an objective function coefficient. This changes linear coefficient in the objective function objidx. In order to delete a coefficient from the obejctive set it to 0 (zero),

        Used in these examples:

        • GoalProg
        Parameters:
        objidx - Index of objective function to change,
        variable - Variable for which to change coefficient.
        coefficient - New coefficient for variable.
        Returns:
        Always returns this instance.
        Since:
        43.00
      • chgObjN

        public XpressProblem chgObjN​(int objidx,
                                     Variable[] variables,
                                     double[] coefficients)
        Change objective function coefficients. This changes linear coefficients in the objective function objidx. In order to delete a coefficient from the obejctive set it to 0 (zero),

        Used in these examples:

        • GoalProg
        Parameters:
        objidx - Index of objective function to change,
        variables - Variables for which to change coefficients.
        coefficients - New coefficients for variables.
        Returns:
        Always returns this instance.
        Since:
        43.00
      • chgCoef

        public XpressProblem chgCoef​(Inequality row,
                                     Variable variable,
                                     double coefficient)
        Changes the coefficient for variable in row in the linear matrix.
        Parameters:
        row - Inequality in which to change coefficient.
        variable - Variable for which to change coefficient.
        coefficient - The new coefficient.
        Returns:
        Always returns this instance.
        Since:
        43.00
      • chgCoefs

        public XpressProblem chgCoefs​(Inequality[] row,
                                      Variable[] variable,
                                      double[] coefficient)
        Change coefficients in the linear matrix. The function changes the coefficients as indicated by the triplets given by row, variable, coefficient.
        Parameters:
        row - Inequality in which to change coefficient.
        variable - Variable for which to change coefficient.
        coefficient - The new coefficient.
        Returns:
        Always returns this instance.
        Since:
        43.00
      • repairWeightedInfeas

        public int repairWeightedInfeas​(java.util.Map<Inequality,​java.lang.Double> lepref,
                                        java.util.Map<Inequality,​java.lang.Double> gepref,
                                        java.util.Map<Variable,​java.lang.Double> lbpref,
                                        java.util.Map<Variable,​java.lang.Double> ubpref,
                                        char phase2,
                                        double delta,
                                        java.lang.String flags)
        Repair infeasibilities using weights. By relaxing a set of selected constraints and bounds of an infeasible problem, it attempts to identify a 'solution' that violates the selected set of constraints and bounds minimally, while satisfying all other constraints and bounds. Among such solution candidates, it selects one that is optimal regarding the original objective function.

        Used in these examples:

        • Repair
        Parameters:
        lepref - Preferences for relaxing the less-than-or-equal direction of rows. Inequalities without preference will not be relaxed. Can be null.
        gepref - Preferences for relaxing the greater-than-or-equal direction of rows. Inequalities without preference will not be relaxed. Can be null.
        lbpref - Preferences for relaxing the lower bounds of variables. Variables without preference will not be relaxed. Can be null.
        ubpref - Preferences for relaxing the upper bounds of variables. Variables without preference will not be relaxed. Can be null.
        phase2 - Controls the second phase of optimization.
        delta - Relaxation multiplier in second phase - 1.
        flags - Flags passed to the optimizer.
        Returns:
        Result status.
        Since:
        43.00
      • inequalityForIndex

        public Inequality inequalityForIndex​(int index)
        Since:
        43.00
      • inequalitiesForIndices

        public Inequality[] inequalitiesForIndices​(int first,
                                                   int last)
        Since:
        43.00
      • getInequalities

        public Inequality[] getInequalities()
        Get all the inequalities currently defined in this problem.
        Since:
        43.00
      • delRows

        public void delRows​(int nrows,
                            int[] rowind)
        Delete rows from this problem. Note that this may be expensive if you use com.dashoptimization.objects.Inequality instances to formulate your problem since indices of remaining rows will have to be updated after rows were deleted from the underlying model. If you have to delete multiple rows then it is best to collect all rows to be deleted in an array and then delete all of them with a single call to this function.
        Overrides:
        delRows in class  XPRSprob
        Parameters:
        nrows - Number of rows to delete.
        rowind - Indices of rows to delete.
        Since:
        43.00
      • delInequalities

        public void delInequalities​(Inequality[] rows)
        Since:
        43.00
      • getSlacks

        public double[] getSlacks​(Inequality[] rows)
        Get the current slacks for an array of rows. The values in the returned array are in 1-to-1 correspondence with the rows in rows.
        Since:
        43.00
      • getSlacks

        public double[] getSlacks​(java.util.Collection<Inequality> rows)
        Get the current slacks for a collection of rows. The values in the returned array are in 1-to-1 correspondence with the rows in rows.
        Since:
        43.00
      • getSlack

        public double getSlack​(Inequality r)
        Get the current slack for a single row.
        Since:
        43.00
      • getDuals

        public double[] getDuals​(Inequality[] rows)
        Get the duals for an array of rows. The values in the returned array are in 1-to-1 correspondence with the rows in rows.
        Since:
        43.00
      • getDuals

        public double[] getDuals​(java.util.Collection<Inequality> rows)
        Get the duals for a collection of rows. The values in the returned array are in 1-to-1 correspondence with the row in row.
        Since:
        43.00
      • getDual

        public double getDual​(Inequality r)
        Get the dual for a single row.
        Since:
        43.00
      • rhsSA

        public void rhsSA​(int len,
                          Inequality[] rows,
                          double[] lower,
                          double[] upper)
        Returns upper and lower sensitivity ranges for specified right hand side (RHS) function coefficients. If the RHS coefficients are varied within these ranges the current basis remains optimal and the reduced costs remain valid.
        Parameters:
        len - Sensitity analysis is only performed for the first len elements in rows.
        rows - The rows for which to perform sensitivity analysis.
        lower - Array of length at least len that receives the sensitivity lower bounds.
        upper - Array of length at least len that receives the sensitivity upper bounds.
        Since:
        43.00
      • rhsSA

        public void rhsSA​(Inequality[] rows,
                          double[] lower,
                          double[] upper)
        Returns upper and lower sensitivity ranges for specified right hand side (RHS) function coefficients. If the RHS coefficients are varied within these ranges the current basis remains optimal and the reduced costs remain valid.
        Parameters:
        rows - The rows for which to perform sensitivity analysis.
        lower - Array at least as long as rows that receives the sensitivity lower bounds.
        upper - Array at least as long as rows that receives the sensitivity upper bounds.
        Since:
        43.00
      • chgRHS

        public void chgRHS​(Inequality[] rows,
                           double[] newRHS)
        Change right-hand side for multiple rows.

        Used in these examples:

        • GlobalRHSParametrics
        • Repair
        Parameters:
        rows - Inequalities for which to change right-hand sides.
        newRHS - New right-hand side values.
        Since:
        43.00
      • chgRowType

        public void chgRowType​(Inequality[] rows,
                               RowType[] rowType)
        Change types for multiple rows.

        Used in these examples:

        • Repair
        Parameters:
        rows - Inequalities for which to change types.
        rowType - New row types.
        Since:
        43.00
      • chgRHSrange

        public void chgRHSrange​(Inequality[] rows,
                                double[] newRange)
        Change right-hand side ranges for multiple rows.

        Used in these examples:

        • Repair
        Parameters:
        rows - Inequalities for which to right-hand side ranges.
        newRange - New right-hand side range values.
        Since:
        43.00
      • loadDelayedRows

        public void loadDelayedRows​(Inequality[] rows)
        Marks a set of rows as delayed rows.
        Parameters:
        rows - Inequalities to mark as delayed.
        Since:
        43.00
      • loadModelCuts

        public void loadModelCuts​(Inequality[] rows)
        Marks a set of rows as model cuts.
        Parameters:
        rows - Inequalities to mark as model cuts.
        Since:
        43.00
      • addConstraints

        public <T,​C extends Index> java.util.stream.Stream<java.util.Map.Entry<T,​C>> addConstraints​(java.util.Iterator<T> data,
                                                                                                                java.util.function.Function<T,​ConstraintDefinition<C>> defs)
        Add multiple constraints of the same type to the problem. Calls the specified functions for each element in data and adds a constraint as specified by the return values of the functions.
        Type Parameters:
        T - Data type.
        C - Constraint type.
        Parameters:
        data - Data to generate constraints.
        defs - Function to produce the constraint definitions.
        Returns:
        The created constraint indexed by data.
        Since:
        43.00
      • addConstraint

        public <C extends Index> C addConstraint​(ConstraintDefinition<C> def)
        Add a single constraint to this problem.
        Type Parameters:
        C - Constraint type.
        Parameters:
        def - Definition of the to add.
        Returns:
        The new constraint.
        Since:
        43.00
      • addConstraints

        public <C extends Index,​T extends ConstraintDefinition<C>> java.util.stream.Stream<C> addConstraints​(java.util.stream.Stream<T> defs)
        Add multiple constraints of the same type to the problem.
        Type Parameters:
        C - Constraint type.
        T - Definition type.
        Parameters:
        defs - The constraints to add.
        Returns:
        The new constraints.
        Since:
        43.00
      • addConstraints

        public <C extends Index,​T extends ConstraintDefinition<C>> java.util.stream.Stream<C> addConstraints​(java.lang.Iterable<T> defs)
        Add multiple constraints of the same type to the problem.
        Type Parameters:
        C - Constraint type.
        T - Definition type.
        Parameters:
        defs - The constraints to add.
        Returns:
        The new constraints.
        Since:
        43.00
      • addConstraints

        public <C extends Index> java.util.stream.Stream<C> addConstraints​(ConstraintDefinition<C>[] defs)
        Add multiple of the same type constraints to the problem.
        Type Parameters:
        C - Constraint type.
        Parameters:
        defs - The constraints to add.
        Returns:
        The new constraints.
        Since:
        43.00
      • addConstraints

        public <C extends Index> java.util.stream.Stream<C> addConstraints​(int count,
                                                                           java.util.function.IntFunction<ConstraintDefinition<C>> defs)
        Add multiple constraints of the same type to the problem. Calls the specified function for each element in [0, ..., count[ and adds a constraint as specified by the return value of the function.
        Type Parameters:
        C - Constraint type.
        Parameters:
        count - Number of constraints to add.
        defs - Function to produce the constraints to add.
        Returns:
        The new constraints.
        Since:
        43.00
      • addConstraints

        public <T,​C extends Index> java.util.stream.Stream<C> addConstraints​(java.util.stream.Stream<T> data,
                                                                                   java.util.function.Function<T,​ConstraintDefinition<C>> defs)
        Add multiple constraints of the same type to the problem. Calls the specified function for each element in data and adds a constraint as specified by the return value of the function.
        Type Parameters:
        T - Data type.
        C - Constraint type.
        Parameters:
        data - Data to generate constraints.
        defs - Function to generate a constraint for each data element.
        Returns:
        The new constraints.
        Since:
        43.00
      • addConstraints

        public <T,​C extends Index> java.util.stream.Stream<C> addConstraints​(T[] data,
                                                                                   java.util.function.Function<T,​ConstraintDefinition<C>> defs)
        Add multiple constraints of the same type to the problem. Calls the specified function for each element in data and adds a constraint as specified by the return value of the function.
        Type Parameters:
        T - Data type
        C - Constraint type.
        Parameters:
        data - Data to generate constraints.
        defs - Function to generate a constraint for each data element.
        Returns:
        The new constraints.
        Since:
        43.00
      • addConstraints

        public <T,​C extends Index> java.util.stream.Stream<C> addConstraints​(java.lang.Iterable<T> data,
                                                                                   java.util.function.Function<T,​ConstraintDefinition<C>> defs)
        Add multiple constraints of the same type to the problem. Calls the specified function for each element in data and adds a constraint as specified by the return value of the function.
        Type Parameters:
        T - Data type
        C - Constraint type.
        Parameters:
        data - Data for the constraints.
        defs - Function to generate a constraint for each data element.
        Returns:
        The new constraints.
        Since:
        43.00
      • addConstraints

        public <C extends Index> java.util.stream.Stream<C> addConstraints​(int[] data,
                                                                           java.util.function.IntFunction<ConstraintDefinition<C>> defs)
        Add multiple constraints of the same type to the problem. Calls the specified function for each element in data and adds a constraint as specified by the return value of the function.
        Type Parameters:
        C - Constraint type.
        Parameters:
        data - Data to generate constraints.
        defs - Function to generate a constraint for each data item.
        Returns:
        The new constraints.
        Since:
        43.00
      • addConstraints

        public <C extends Index> java.util.stream.Stream<C> addConstraints​(java.util.stream.IntStream data,
                                                                           java.util.function.IntFunction<ConstraintDefinition<C>> defs)
        Add multiple constraints of the same type to the problem. Calls the specified function for each element in data and adds a constraint as specified by the return value of the function.
        Type Parameters:
        C - Constraint type.
        Parameters:
        data - Data to generate constraints.
        defs - Function to generate a constraint for each data element.
        Returns:
        The new constraints.
        Since:
        43.00
      • variableForIndex

        public Variable variableForIndex​(int index)
        Since:
        43.00
      • variablesForIndices

        public Variable[] variablesForIndices​(int first,
                                              int last)
        Since:
        43.00
      • delCols

        public void delCols​(int ncols,
                            int[] colind)
        Delete columns from this problem. Note that this may be expensive if you use Variable instances to formulate your problem since indices of remaining variables will have to be updated after columns were deleted from the underlying model. If you have to delete multiple variables then it is best to collect all variables to be deleted in an array and then delete all of them with a single call to this function.
        Overrides:
        delCols in class  XPRSprob
        Parameters:
        ncols - Number of columns to delete.
        colind - Indices of columns to delete.
        Since:
        43.00
      • delVariables

        public void delVariables​(Variable[] vars)
        Since:
        43.00
      • getSolution

        public double[] getSolution​(Variable[] vars)
        Get the current solution for an array of variables. The values in the returned array are in 1-to-1 correspondence with the variables in vars.

        Used in these examples:

        • Polygon
        • PolygonMap
        • PolygonMapDelta
        • PolygonMultiMap
        • PolygonMultiMapDelta
        • PolygonVecMap
        • PolygonVecMapDelta
        Since:
        43.00
      • getSolution

        public double[] getSolution​(java.util.Collection<Variable> vars)
        Get the current solution for a collection of variables. The values in the returned array are in 1-to-1 correspondence with the variables in vars.

        Used in these examples:

        • Polygon
        • PolygonMap
        • PolygonMapDelta
        • PolygonMultiMap
        • PolygonMultiMapDelta
        • PolygonVecMap
        • PolygonVecMapDelta
        Since:
        43.00
      • getSolution

        public double getSolution​(Variable v)
        Get the current solution for a single variable.

        Used in these examples:

        • Polygon
        • PolygonMap
        • PolygonMapDelta
        • PolygonMultiMap
        • PolygonMultiMapDelta
        • PolygonVecMap
        • PolygonVecMapDelta
        Since:
        43.00
      • getRedCosts

        public double[] getRedCosts​(Variable[] vars)
        Get the reduced costs for an array of variables. The values in the returned array are in 1-to-1 correspondence with the variables in vars.
        Since:
        43.00
      • getRedCosts

        public double[] getRedCosts​(java.util.Collection<Variable> vars)
        Get the reduced costs for a collection of variables. The values in the returned array are in 1-to-1 correspondence with the variables in vars.
        Since:
        43.00
      • getRedCost

        public double getRedCost​(Variable v)
        Get the reduced cost for a single variable.
        Since:
        43.00
      • objSA

        public void objSA​(int len,
                          Variable[] variables,
                          double[] lower,
                          double[] upper)
        Returns upper and lower sensitivity ranges for specified objective function coefficients. If the objective coefficients are varied within these ranges the current basis remains optimal and the reduced costs remain valid.
        Parameters:
        len - Sensitivity analysis is performed only on the first len variables in variables.
        variables - Variables on which to perform sensitivity analysis.
        lower - Array of length at least len that receives the sensitivity analysis lower bounds.
        upper - Array of length at least len that receives the sensitivity analysis upper bounds.
        Since:
        43.00
      • objSA

        public void objSA​(Variable[] variables,
                          double[] lower,
                          double[] upper)
        Returns upper and lower sensitivity ranges for specified objective function coefficients. If the objective coefficients are varied within these ranges the current basis remains optimal and the reduced costs remain valid.
        Parameters:
        variables - Variables on which to perform sensitivity analysis.
        lower - Array at least as long as variables that receives the sensitivity analysis lower bounds.
        upper - Array at least as long as variables that receives the sensitivity analysis upper bounds.
        Since:
        43.00
      • bndSA

        public void bndSA​(int len,
                          Variable[] variables,
                          double[] lblower,
                          double[] lbupper,
                          double[] ublower,
                          double[] ubupper)
        Returns upper and lower sensitivity ranges for specified variables' lower and upper bounds. If the bounds are varied within these ranges the current basis remains optimal and feasible.
        Parameters:
        len - Sensitivity analysis is performed only on the first len variables in variables.
        variables - Variables on which to perform sensitivity analysis.
        lblower - Array of length at least len that receives the sensitivity analysis lower bounds for the variables' lower bound constraints.
        lbupper - Array of length at least len that receives the sensitivity analysis upper bounds for the variables' lower bound constraints.
        ublower - Array of length at least len that receives the sensitivity analysis lower bounds for the variables' upper bound constraints.
        ubupper - Array of length at least len that receives the sensitivity analysis upper bounds for the variables' upper bound constraints.
        Since:
        43.00
      • bndSA

        public void bndSA​(Variable[] variables,
                          double[] lblower,
                          double[] lbupper,
                          double[] ublower,
                          double[] ubupper)
        Returns upper and lower sensitivity ranges for specified variables' lower and upper bounds. If the bounds are varied within these ranges the current basis remains optimal and feasible.
        Parameters:
        variables - Variables on which to perform sensitivity analysis.
        lblower - Array at least as long as variables that receives the sensitivity analysis lower bounds for the variables' lower bound constraints.
        lbupper - Array at least as long as variables that receives the sensitivity analysis upper bounds for the variables' lower bound constraints.
        ublower - Array at least as long as variables that receives the sensitivity analysis lower bounds for the variables' upper bound constraints.
        ubupper - Array at least as long as variables that receives the sensitivity analysis upper bounds for the variables' upper bound constraints.
        Since:
        43.00
      • addMipSol

        public void addMipSol​(double[] values,
                              Variable[] variables,
                              java.lang.String name)
        Adds a new feasible, infeasible or partial MIP solution for the problem to the Optimizer.

        Used in these examples:

        • AddMipSol
        • TSP
        Parameters:
        values - Values for variables.
        variables - Variables in the solution.
        name - Name for solution, can be null.
        Since:
        43.00
      • getVariables

        public Variable[] getVariables()
        Get all the variables currently defined in this problem.
        Since:
        43.00
      • chgBounds

        public void chgBounds​(Variable[] variables,
                              byte[] bndType,
                              double[] bndValue)
        Change bounds for multiple variables.

        Used in these examples:

        • AddMipSol
        • FixBV
        • RoundInt
        Parameters:
        variables - Variables for which to change bounds.
        bndType - Type of bounds to change.
        bndValue - New bounds.
        Since:
        43.00
      • chgColType

        public void chgColType​(Variable[] variables,
                               ColumnType[] colType)
        Change types for multiple variables.

        Used in these examples:

        • Trimloss
        Parameters:
        variables - Variables for which to change types.
        colType - New column types.
        Since:
        43.00
      • getInequalityLinear

        public LinTermList getInequalityLinear​(Inequality row)
        Get the linear part of the left-hand side of a row.
        Parameters:
        row - The row for which the linear part is queried.
        Returns:
        The linear part of the row. This is guaranteed to not have any duplicates.
        Since:
        43.00
      • getInequalityLinear

        public LinExpression getInequalityLinear​(Inequality row,
                                                 java.util.function.Supplier<LinExpression> expression)
        Get the linear part of the left-hand side of a row. The function adds the linear part of row to the expression provided by expression. If expression is null then the function allocates a new com.dashoptimization.objects.LinTermList for it. If the function allocates a new com.dashoptimization.objects.LinTermList then it also returns that new object. In that case the list is guaranteed to not have any duplicates.
        Parameters:
        row - The row for which the linear part is queried.
        expression - Creates the expression that is returned by this function. Can be null in which case a new com.dashoptimization.objects.LinTermList is created.
        Returns:
        An expression that represent the linear part of the given row.
        Since:
        43.00
      • getCoef

        public double getCoef​(Inequality row,
                              Variable variable)
        Query a single coefficient from the linear matrix. Retrieves the coefficient of variable in row in the linear matrix. Note that the coefficient will be 0 (zero) in case the variable has no coefficient in that row.
        Parameters:
        row - The row in which to query the coefficient.
        variable - The variable for which to query the coefficient.
        Returns:
        The queried coefficient.
        Since:
        43.00
      • getObj

        public double getObj​(Variable variable)
        Query an objective function coefficient. Retrieves the linear objective coefficient for the specified variable from the first/primary objective.

        Used in these examples:

        • Knapsack
        Parameters:
        variable - The variable for which to query the objective.
        Returns:
        The objective coefficient for variable.
        Since:
        43.00
      • getObjN

        public double getObjN​(int objidx,
                              Variable variable)
        Query an objective function coefficient. Retrieves the linear objective coefficient for the specified variable from objective objidx.
        Parameters:
        objidx - objects.Index of objective function to query.
        variable - The variable for which to query the objective.
        Returns:
        The objective coefficient for variable.
        Since:
        43.00
      • pwlForIndex

        public PWL pwlForIndex​(int index)
        Since:
        43.00
      • pwlsForIndices

        public PWL[] pwlsForIndices​(int first,
                                    int last)
        Since:
        43.00
      • delPwlCons

        public void delPwlCons​(int npwls,
                               int[] pwlind)
        Delete piecewise linear constraints from this problem. Note that this may be expensive if you use PWL instances to formulate your problem since indices of remaining variables will have to be updated after columns were deleted from the underlying model. If you have to delete multiple variables then it is best to collect all variables to be deleted in an array and then delete all of them with a single call to this function.
        Overrides:
        delPwlCons in class  XPRSprob
        Parameters:
        npwls - Number of constraints to delete.
        pwlind - Indices of constraints to delete.
        Since:
        43.00
      • delPwlConstraints

        public void delPwlConstraints​(PWL[] pwls)
        Since:
        43.00
      • getGeneralConstraints

        public GeneralConstraint[] getGeneralConstraints()
        Get all the general constraints currently defined in this problem.
        Returns:
        All general constraints in this problem.
        Since:
        43.00
      • generalConstraintForIndex

        public GeneralConstraint generalConstraintForIndex​(int index)
        Map a general constraint index to a GeneralConstraint object.
        Parameters:
        index - The index to map.
        Returns:
        The GeneralConstraint object for index.
        Since:
        43.00
      • generalConstraintForIndices

        public GeneralConstraint[] generalConstraintForIndices​(int first,
                                                               int last)
        Map a range of general constraint indices to GeneralConstraint objects.
        Parameters:
        first - First index in range (inclusive).
        last - Last index in range (inclusive).
        Returns:
        The GeneralConstraint objects in the specified range.
        Since:
        43.00
      • delGenCons

        public void delGenCons​(int nconstraints,
                               int[] conind)
        Delete constraints from this problem. Note that this may be expensive if you use GeneralConstraint instances to formulate your problem since indices of remaining constraints will have to be updated after constraints were deleted from the underlying model. If you have to delete multiple constraints then it is best to collect all constraints to be deleted in an array and then delete all of them with a single call to this function.
        Overrides:
        delGenCons in class  XPRSprob
        Parameters:
        nconstraints - Number of constraints to delete.
        conind - Indices of constraints to delete.
        Since:
        43.00
      • delGeneralConstraints

        public void delGeneralConstraints​(GeneralConstraint[] constraints)
        Delete general constraints.
        Parameters:
        constraints - The constraints to be deleted.
        Since:
        43.00
      • getIIS

        public IIS getIIS​(int iis)
        Get the specified IIS.
        Parameters:
        iis - The index of the IIS for which data is queried.
        Returns:
        The IIS specified by iis.
        Since:
        43.00
      • isOriginal

        public boolean isOriginal()
        Check whether this model instance is in the original state. A model is not in the original state if it is a callback problem or its problem state indicates being presolved.

        Used in these examples:

        • MostViolated
        Since:
        43.00
      • addCut

        public int addCut​(int cuttype,
                          Inequality.Definition cut)
        Add a cut at the current node. It is assumed that the left-hand side ( lhs) is formulated in terms of the original model. So you can use Variable instances to formulate it. When using plain variable indices, be sure these indices are for the original model. The function will automatically transform (presolve) the cut to the presolved space. If presolving the cut fails then the cut is not added and the reason for failure is returned. Failing to presolve (and thus adding) a cut is not a problem in every context. That is why this does not raise an exception but instead leaves it to the caller to decide whether this is an error or not.

        Used in these examples:

        • TSP
        Parameters:
        cuttype - User defined cut type.
        cut - The inequality to add as cut.
        Returns:
        0 (zero) if the cut was successfully added. Otherwise the status code from presolveRow that indicates why the cut could not be presolved. It is up to the caller to decide whether not being able to presolve the cut is a problem or not.
        Since:
        43.00
      • createBranchObject

        public XpressProblem.BranchObject createBranchObject()
        Create a new branch object. This is different from the super class's createBranchObject() function in two aspects: - it returns an instance of BranchObject, not XPRSbranchobject. The format is a subclass of the latter and has functions to add bounds and constraints that reference Variable objects. - the returned object always operates in the original space.

        Used in these examples:

        • MostViolated
        Since:
        43.00
      • setObjective

        public void setObjective​(Expression obj)
        Set the objective function to a new expression.

        Used in these examples:

        • TSP
        Parameters:
        obj - The new objective
        Since:
        43.00
      • setObjective

        public void setObjective​(Expression obj,
                                 XPRSenumerations.ObjSense sense)
        Set the objective function to a new expression.

        Used in these examples:

        • TSP
        Parameters:
        obj - The new objective
        sense - The new objective sense (minimize or maximize).
        Since:
        43.00
      • addObjective

        public void addObjective​(Expression obj,
                                 int priority,
                                 double weight)
        Add a new objective function. This turns the problem into a multi-objective problem.
        Parameters:
        obj - The new objective
        priority - Priority for new objective.
        weight - Weight for new objective.
        Since:
        43.00
      • setObjective

        public void setObjective​(int idx,
                                 Expression obj,
                                 int priority,
                                 double weight,
                                 double abstol,
                                 double reltol)
        Set an objective function and its controls. In case of error: - if the function created new objectives then all newly created objectives will be removed, - if an existing objective was modified then that objective function will be cleared and all controls will be unchanged.

        Used in these examples:

        • TSP
        Parameters:
        idx - Index of objective to set.
        obj - New objective for idx.
        priority - New objective priority.
        weight - New objective weight.
        abstol - New absolute tolerance for objective idx.
        reltol - New relative tolerance for objective idx.
        Since:
        43.00
      • nlpSetInitVal

        public void nlpSetInitVal​(java.util.Map<Variable,​java.lang.Double> values)
        Set initial values of variables for a non-linear solve.
        Parameters:
        values - Values to be set. For each variable/value pair in this map the corresponding initial value is set.
        Since:
        43.00
      • nlpSetInitVal

        public void nlpSetInitVal​(Variable[] variables,
                                  double[] values)
        Set initial values of variables for a non-linear solve.
        Parameters:
        variables - Variables for which to set values.
        values - Values for variables. This must have the same length as variables. The initial value for variables[i] is values[i].
        Since:
        43.00
      • getLhsExpression

        public Expression getLhsExpression​(int row)
        Get the left-hand side of a row as an expression.
        Parameters:
        row - Index of row to fetch.
        Returns:
        The left-hand side of row row.
        Since:
        43.00
      • sosForIndex

        public SOS sosForIndex​(int index)
        Since:
        43.00
      • sosForIndices

        public SOS[] sosForIndices​(int first,
                                   int last)
        Since:
        43.00
      • delSets

        public void delSets​(int nsets,
                            int[] sosind)
        Delete sets from this problem. Note that this may be expensive if you use SOS instances to formulate your problem since indices of remaining sets will have to be updated after sets were deleted from the underlying model. If you have to delete multiple sets then it is best to collect all sets to be deleted in an array and then delete all of them with a single call to this function.
        Overrides:
        delSets in class  XPRSprob
        Parameters:
        nsets - Number of sets to delete.
        sosind - Indices of sets to delete.
        Since:
        43.00
      • delSOS

        public void delSOS​(SOS[] soss)
        Delete special ordered set constraints. Removes all the specified special ordered set constraints from this problem.
        Parameters:
        soss - SOS to be deleted.
        Since:
        43.00
      • delSOS

        public void delSOS​(SOS sos)
        Delete a single SOS from the problem.
        Parameters:
        sos - SOS to delete.
        Since:
        43.00
      • delIndicator

        public void delIndicator​(Inequality row)
        Delete a single indicator constraint. This only deletes the "indicator property from the specified row. Neither the associated variable nor the row are deleted.
        Parameters:
        row - Row from which to delete the indicator constraint.
        Since:
        43.00
      • getIndicator

        public IndicatorObjects getIndicator​(Inequality row)
        Get indicator information for a single row.
        Parameters:
        row - The row to query.
        Returns:
        Indicator information for row. This will be null if row is not an indicator row.
        Since:
        43.00
      • setIndicator

        public void setIndicator​(Variable indicatorVariable,
                                 boolean indicatorValue,
                                 Inequality row)
        Add an indicator constraint to this model. Both variable and row must exist.
        Parameters:
        indicatorVariable - Indicator variable.
        indicatorValue - Whether row becomes active if indicatorVariable is non-zero ( indicatorValue is true) or if indicatorVariable is zero ( indicatorValue is false).
        row - The implied row for the indicator constraint.
        Since:
        43.00
      • setIndicators

        public void setIndicators​(Variable[] indicatorVariable,
                                  boolean[] indicatorValue,
                                  Inequality[] row)
        Add indicator constraints to this model. The provided arrays must all have length at least count and for any i in 0.. count-1 an indicator constraint is constructed from indicatorVariable[i], indicatorValue[i] and row[i]. If indicatorValue[i] is true then the constraints states that if indicatorVariable[i] is 1 (one), then row[i] must be satisfied (and if indicator is 0 (zero) then row[i] is ignored). Otherwise, row[i] must be satisfied if indicator[i] is 0 (zero) and is ignored otherwise. All referenced variables and rows must exist.
        Parameters:
        indicatorVariable - Indicator variables.
        indicatorValue - Whether rows become active if indicator variables are non-zero ( indicatorValue[.] is true) or if indicator variables are zero ( indicatorValue is false). If this is null then rows become active if indicator variables are non-zero.
        row - The implied rows for the indicator constraints.
        Since:
        43.00
      • setIndicators

        public <T> void setIndicators​(java.lang.Iterable<T> data,
                                      java.util.function.Function<T,​Variable> indicatorVariable,
                                      java.util.function.Function<T,​java.lang.Boolean> indicatorValue,
                                      java.util.function.Function<T,​Inequality> row)
        Add indicator constraints to this model. The function iterates through data and calls the provided functions for each element found. The return values of the functions are used to construct an indicator constraint. For a fixed t, if indicatorValue(t) returns true then the created constraint states that if indicatorVariable(t) is 1 (one), then row(t) must be satisfied and is ignored otherwise. Otherwise, row(t) must be satisfied if indicatorVariable(t) is 0 (zero) and is ignored otherwise. All referenced variables and rows must exist.
        Type Parameters:
        T - Data type.
        Parameters:
        data - Data for which constraints are created.
        indicatorVariable - Indicator variables.
        indicatorValue - Whether indicator variables should be non-zero or zero for rows to become active. If this is null then none of the variables must be 1 (one) for rows to become active.
        row - The implied rows for the indicator constraints.
        Since:
        43.00
      • setIndicators

        public <T> void setIndicators​(T[] data,
                                      java.util.function.Function<T,​Variable> indicatorVariable,
                                      java.util.function.Function<T,​java.lang.Boolean> indicatorValue,
                                      java.util.function.Function<T,​Inequality> row)
        Add indicator constraints to this model. The function iterates through data and calls the provided functions for each element found. The return values of the functions are used to construct an indicator constraint. For a fixed t, if indicatorValue(t) returns true then the created constraint states that if indicatorVariable(t) is 1 (one), then row(t) must be satisfied and is ignored otherwise. Otherwise, row(t) must be satisfied if indicatorVariable(t) is 0 (zero) and is ignored otherwise. All referenced variables and rows must exist.
        Type Parameters:
        T - Data type.
        Parameters:
        data - Data for which constraints are created.
        indicatorVariable - Indicator variables.
        indicatorValue - Whether indicator variables should be non-zero or zero for rows to become active. If this is null then none of the variables must be 1 (one) for rows to become active.
        row - The implied rows for the indicator constraints.
        Since:
        43.00
      • setIndicators

        public <T> void setIndicators​(java.util.Collection<T> data,
                                      java.util.function.Function<T,​Variable> indicatorVariable,
                                      java.util.function.Function<T,​java.lang.Boolean> indicatorValue,
                                      java.util.function.Function<T,​Inequality> row)
        Add indicator constraints to this model. The function iterates through data and calls the provided functions for each element found. The return values of the functions are used to construct an indicator constraint. For a fixed t, if indicatorValue(t) returns true then the created constraint states that if indicatorVariable(t) is 1 (one), then row(t) must be satisfied and is ignored otherwise. Otherwise, row(t) must be satisfied if indicatorVariable(t) is 0 (zero) and is ignored otherwise. All referenced variables and rows must exist.
        Type Parameters:
        T - Data type.
        Parameters:
        data - Data for which constraints are created.
        indicatorVariable - Indicator variables.
        indicatorValue - Whether indicator variables should be non-zero or zero for rows to become active. If this is null then none of the variables must be 1 (one) for rows to become active.
        row - The implied rows for the indicator constraints.
        Since:
        43.00
      • setIndicators

        public <T> void setIndicators​(java.util.stream.Stream<T> data,
                                      java.util.function.Function<T,​Variable> indicatorVariable,
                                      java.util.function.Function<T,​java.lang.Boolean> indicatorValue,
                                      java.util.function.Function<T,​Inequality> row)
        Add indicator constraints to this model. The function iterates through data and calls the provided functions for each element found. The return values of the functions are used to construct an indicator constraint. For a fixed t, if indicatorValue(t) returns true then the created constraint states that if indicatorVariable(t) is 1 (one), then row(t) must be satisfied and is ignored otherwise. Otherwise, row(t) must be satisfied if indicatorVariable(t) is 0 (zero) and is ignored otherwise. All referenced variables and rows must exist.
        Type Parameters:
        T - Data type.
        Parameters:
        data - Data for which constraints are created.
        indicatorVariable - Indicator variables.
        indicatorValue - Whether indicator variables should be non-zero or zero for rows to become active. If this is null then none of the variables must be 1 (one) for rows to become active.
        row - The implied rows for the indicator constraints.
        Since:
        43.00
      • setIndicators

        public void setIndicators​(int count,
                                  java.util.function.Function<java.lang.Integer,​Variable> indicatorVariable,
                                  java.util.function.Function<java.lang.Integer,​java.lang.Boolean> indicatorValue,
                                  java.util.function.Function<java.lang.Integer,​Inequality> row)
        Add indicator constraints to this model. The function iterates through [0, ... ,count[ and calls the provided functions for each in this interval. The return values of the functions are used to construct an indicator constraint. For a fixed t, if indicatorValue(t) returns true then the created constraint states that if indicatorVariable(t) is 1 (one), then row(t) must be satisfied and is ignored otherwise. Otherwise, row(t) must be satisfied if indicatorVariable(t) is 0 (zero) and is ignored otherwise. All referenced variables and rows must exist.
        Parameters:
        count - How many constraint to add.
        indicatorVariable - Indicator variables.
        indicatorValue - Whether indicator variables should be non-zero or zero for rows to become active. If this is null then none of the variables must be 1 (one) for rows to become active.
        row - The implied rows for the indicator constraints.
        Since:
        43.00
      • setIndicators

        public void setIndicators​(int[] data,
                                  java.util.function.IntFunction<Variable> indicatorVariable,
                                  java.util.function.IntFunction<java.lang.Boolean> indicatorValue,
                                  java.util.function.IntFunction<Inequality> row)
        Add indicator constraints to this model. The function iterates through data and calls the provided functions for each element found. The return values of the functions are used to construct an indicator constraint. For a fixed t, if indicatorValue(t) returns true then the created constraint states that if indicatorVariable(t) is 1 (one), then row(t) must be satisfied and is ignored otherwise. Otherwise, row(t) must be satisfied if indicatorVariable(t) is 0 (zero) and is ignored otherwise. All referenced variables and rows must exist.
        Parameters:
        data - Data for which constraints are created.
        indicatorVariable - Indicator variables.
        indicatorValue - Whether indicator variables should be non-zero or zero for rows to become active. If this is null then none of the variables must be 1 (one) for rows to become active.
        row - The implied rows for the indicator constraints.
        Since:
        43.00
      • setIndicators

        public void setIndicators​(java.util.stream.IntStream data,
                                  java.util.function.IntFunction<Variable> indicatorVariable,
                                  java.util.function.IntFunction<java.lang.Boolean> indicatorValue,
                                  java.util.function.IntFunction<Inequality> row)
        Add indicator constraints to this model. The function iterates through data and calls the provided functions for each element found. The return values of the functions are used to construct an indicator constraint. For a fixed t, if indicatorValue(t) returns true then the created constraint states that if indicatorVariable(t) is 1 (one), then row(t) must be satisfied and is ignored otherwise. Otherwise, row(t) must be satisfied if indicatorVariable(t) is 0 (zero) and is ignored otherwise. All referenced variables and rows must exist.
        Parameters:
        data - Data for which constraints are created.
        indicatorVariable - Indicator variables.
        indicatorValue - Whether indicator variables should be non-zero or zero for rows to become active. If this is null then none of the variables must be 1 (one) for rows to become active.
        row - The implied rows for the indicator constraints.
        Since:
        43.00
      • sortParallelArrays

        public static <T extends java.lang.Comparable<T>> void sortParallelArrays​(T[] mvec,
                                                                                  double[] dvec,
                                                                                  int offset,
                                                                                  int size)
        Sort parallel arrays according to index keys.
        Since:
        43.00
      • sortParallelArrays

        public static <T extends java.lang.Comparable<T>> void sortParallelArrays​(T[] key1,
                                                                                  T[] key2,
                                                                                  double[] dvec,
                                                                                  int offset,
                                                                                  int size)
        Sort parallel arrays according to integer pair keys.
        Since:
        43.00
      • addConstraints

        public <C extends Index> void addConstraints​(int count1,
                                                     int count2,
                                                     java.util.function.BiFunction<java.lang.Integer,​java.lang.Integer,​ConstraintDefinition<C>> makeConstraint)
        Add multiple constraints to this problem. Calls makeConstraint for each element in the cartesian product of [0,count1[, ..., [0,countN[ and adds the constraint that is produced by this function call. A deep copy is made of each constraint, thus modifying the constraint later will not alter the model.
        Type Parameters:
        C - The type of constraints.
        Parameters:
        count1 - Length of dimension 1.
        count2 - Length of dimension 2.
        makeConstraint - Function to generate a constraint.
        Since:
        43.00
      • addConstraints

        public <K1,​K2,​C extends Index> void addConstraints​(java.lang.Iterable<K1> iterable1,
                                                                       java.lang.Iterable<K2> iterable2,
                                                                       java.util.function.BiFunction<K1,​K2,​ConstraintDefinition<C>> makeConstraint)
        Add multiple constraints to this problem. Calls makeConstraint for each element in the cartesian product of the iterables and adds the constraint that is produced by this function call. A deep copy is made of each constraint, thus modifying the constraint later will not alter the model.
        Type Parameters:
        K1 - Data for dimension 1.
        K2 - Data for dimension 2.
        C - The type of constraints.
        Parameters:
        iterable1 - Keys for dimension 1.
        iterable2 - Keys for dimension 2.
        makeConstraint - Function to generate a constraint.
        Since:
        43.00
      • addConstraints

        public <K1,​K2,​C extends Index> void addConstraints​(K1[] array1,
                                                                       K2[] array2,
                                                                       java.util.function.BiFunction<K1,​K2,​ConstraintDefinition<C>> makeConstraint)
        Add multiple constraints to this problem. Calls makeConstraint for each element in the cartesian product of the arrays and adds the constraint that is produced by this function call. A deep copy is made of each constraint, thus modifying the constraint later will not alter the model.
        Type Parameters:
        K1 - Data for dimension 1.
        K2 - Data for dimension 2.
        C - The type of constraints.
        Parameters:
        array1 - Data for dimension 1.
        array2 - Data for dimension 2.
        makeConstraint - Function to generate a constraint.
        Since:
        43.00
      • addConstraints

        public <C extends Index> void addConstraints​(int count1,
                                                     int count2,
                                                     int count3,
                                                     Function3<java.lang.Integer,​java.lang.Integer,​java.lang.Integer,​ConstraintDefinition<C>> makeConstraint)
        Add multiple constraints to this problem. Calls makeConstraint for each element in the cartesian product of [0,count1[, ..., [0,countN[ and adds the constraint that is produced by this function call. A deep copy is made of each constraint, thus modifying the constraint later will not alter the model.
        Type Parameters:
        C - The type of constraints.
        Parameters:
        count1 - Length of dimension 1.
        count2 - Length of dimension 2.
        count3 - Length of dimension 3.
        makeConstraint - Function to generate a constraint.
        Since:
        43.00
      • addConstraints

        public <K1,​K2,​K3,​C extends Index> void addConstraints​(java.lang.Iterable<K1> iterable1,
                                                                                java.lang.Iterable<K2> iterable2,
                                                                                java.lang.Iterable<K3> iterable3,
                                                                                Function3<K1,​K2,​K3,​ConstraintDefinition<C>> makeConstraint)
        Add multiple constraints to this problem. Calls makeConstraint for each element in the cartesian product of the iterables and adds the constraint that is produced by this function call. A deep copy is made of each constraint, thus modifying the constraint later will not alter the model.
        Type Parameters:
        K1 - Data for dimension 1.
        K2 - Data for dimension 2.
        K3 - Data for dimension 3.
        C - The type of constraints.
        Parameters:
        iterable1 - Keys for dimension 1.
        iterable2 - Keys for dimension 2.
        iterable3 - Keys for dimension 3.
        makeConstraint - Function to generate a constraint.
        Since:
        43.00
      • addConstraints

        public <K1,​K2,​K3,​C extends Index> void addConstraints​(K1[] array1,
                                                                                K2[] array2,
                                                                                K3[] array3,
                                                                                Function3<K1,​K2,​K3,​ConstraintDefinition<C>> makeConstraint)
        Add multiple constraints to this problem. Calls makeConstraint for each element in the cartesian product of the arrays and adds the constraint that is produced by this function call. A deep copy is made of each constraint, thus modifying the constraint later will not alter the model.
        Type Parameters:
        K1 - Data for dimension 1.
        K2 - Data for dimension 2.
        K3 - Data for dimension 3.
        C - The type of constraints.
        Parameters:
        array1 - Data for dimension 1.
        array2 - Data for dimension 2.
        array3 - Data for dimension 3.
        makeConstraint - Function to generate a constraint.
        Since:
        43.00
      • addConstraints

        public <C extends Index> void addConstraints​(int count1,
                                                     int count2,
                                                     int count3,
                                                     int count4,
                                                     Function4<java.lang.Integer,​java.lang.Integer,​java.lang.Integer,​java.lang.Integer,​ConstraintDefinition<C>> makeConstraint)
        Add multiple constraints to this problem. Calls makeConstraint for each element in the cartesian product of [0,count1[, ..., [0,countN[ and adds the constraint that is produced by this function call. A deep copy is made of each constraint, thus modifying the constraint later will not alter the model.
        Type Parameters:
        C - The type of constraints.
        Parameters:
        count1 - Length of dimension 1.
        count2 - Length of dimension 2.
        count3 - Length of dimension 3.
        count4 - Length of dimension 4.
        makeConstraint - Function to generate a constraint.
        Since:
        43.00
      • addConstraints

        public <K1,​K2,​K3,​K4,​C extends Index> void addConstraints​(java.lang.Iterable<K1> iterable1,
                                                                                         java.lang.Iterable<K2> iterable2,
                                                                                         java.lang.Iterable<K3> iterable3,
                                                                                         java.lang.Iterable<K4> iterable4,
                                                                                         Function4<K1,​K2,​K3,​K4,​ConstraintDefinition<C>> makeConstraint)
        Add multiple constraints to this problem. Calls makeConstraint for each element in the cartesian product of the iterables and adds the constraint that is produced by this function call. A deep copy is made of each constraint, thus modifying the constraint later will not alter the model.
        Type Parameters:
        K1 - Data for dimension 1.
        K2 - Data for dimension 2.
        K3 - Data for dimension 3.
        K4 - Data for dimension 4.
        C - The type of constraints.
        Parameters:
        iterable1 - Keys for dimension 1.
        iterable2 - Keys for dimension 2.
        iterable3 - Keys for dimension 3.
        iterable4 - Keys for dimension 4.
        makeConstraint - Function to generate a constraint.
        Since:
        43.00
      • addConstraints

        public <K1,​K2,​K3,​K4,​C extends Index> void addConstraints​(K1[] array1,
                                                                                         K2[] array2,
                                                                                         K3[] array3,
                                                                                         K4[] array4,
                                                                                         Function4<K1,​K2,​K3,​K4,​ConstraintDefinition<C>> makeConstraint)
        Add multiple constraints to this problem. Calls makeConstraint for each element in the cartesian product of the arrays and adds the constraint that is produced by this function call. A deep copy is made of each constraint, thus modifying the constraint later will not alter the model.
        Type Parameters:
        K1 - Data for dimension 1.
        K2 - Data for dimension 2.
        K3 - Data for dimension 3.
        K4 - Data for dimension 4.
        C - The type of constraints.
        Parameters:
        array1 - Data for dimension 1.
        array2 - Data for dimension 2.
        array3 - Data for dimension 3.
        array4 - Data for dimension 4.
        makeConstraint - Function to generate a constraint.
        Since:
        43.00
      • addConstraints

        public <C extends Index> void addConstraints​(int count1,
                                                     int count2,
                                                     int count3,
                                                     int count4,
                                                     int count5,
                                                     Function5<java.lang.Integer,​java.lang.Integer,​java.lang.Integer,​java.lang.Integer,​java.lang.Integer,​ConstraintDefinition<C>> makeConstraint)
        Add multiple constraints to this problem. Calls makeConstraint for each element in the cartesian product of [0,count1[, ..., [0,countN[ and adds the constraint that is produced by this function call. A deep copy is made of each constraint, thus modifying the constraint later will not alter the model.
        Type Parameters:
        C - The type of constraints.
        Parameters:
        count1 - Length of dimension 1.
        count2 - Length of dimension 2.
        count3 - Length of dimension 3.
        count4 - Length of dimension 4.
        count5 - Length of dimension 5.
        makeConstraint - Function to generate a constraint.
        Since:
        43.00
      • addConstraints

        public <K1,​K2,​K3,​K4,​K5,​C extends Index> void addConstraints​(java.lang.Iterable<K1> iterable1,
                                                                                                  java.lang.Iterable<K2> iterable2,
                                                                                                  java.lang.Iterable<K3> iterable3,
                                                                                                  java.lang.Iterable<K4> iterable4,
                                                                                                  java.lang.Iterable<K5> iterable5,
                                                                                                  Function5<K1,​K2,​K3,​K4,​K5,​ConstraintDefinition<C>> makeConstraint)
        Add multiple constraints to this problem. Calls makeConstraint for each element in the cartesian product of the iterables and adds the constraint that is produced by this function call. A deep copy is made of each constraint, thus modifying the constraint later will not alter the model.
        Type Parameters:
        K1 - Data for dimension 1.
        K2 - Data for dimension 2.
        K3 - Data for dimension 3.
        K4 - Data for dimension 4.
        K5 - Data for dimension 5.
        C - The type of constraints.
        Parameters:
        iterable1 - Keys for dimension 1.
        iterable2 - Keys for dimension 2.
        iterable3 - Keys for dimension 3.
        iterable4 - Keys for dimension 4.
        iterable5 - Keys for dimension 5.
        makeConstraint - Function to generate a constraint.
        Since:
        43.00
      • addConstraints

        public <K1,​K2,​K3,​K4,​K5,​C extends Index> void addConstraints​(K1[] array1,
                                                                                                  K2[] array2,
                                                                                                  K3[] array3,
                                                                                                  K4[] array4,
                                                                                                  K5[] array5,
                                                                                                  Function5<K1,​K2,​K3,​K4,​K5,​ConstraintDefinition<C>> makeConstraint)
        Add multiple constraints to this problem. Calls makeConstraint for each element in the cartesian product of the arrays and adds the constraint that is produced by this function call. A deep copy is made of each constraint, thus modifying the constraint later will not alter the model.
        Type Parameters:
        K1 - Data for dimension 1.
        K2 - Data for dimension 2.
        K3 - Data for dimension 3.
        K4 - Data for dimension 4.
        K5 - Data for dimension 5.
        C - The type of constraints.
        Parameters:
        array1 - Data for dimension 1.
        array2 - Data for dimension 2.
        array3 - Data for dimension 3.
        array4 - Data for dimension 4.
        array5 - Data for dimension 5.
        makeConstraint - Function to generate a constraint.
        Since:
        43.00
      • buildVariables

        public Variable[] buildVariables​(VariableBuilder.ArrayBuilder builder)
        Create a variable array from a builder.
        Parameters:
        builder - The builder to create variables.
        Returns:
        Created variables.
        Since:
        43.00
      • buildVariables

        public <I> I buildVariables​(VariableBuilder.ArrayBuilder builder,
                                    java.util.function.Supplier<I> makeResult,
                                    Action3<I,​java.lang.Integer,​Variable> addResult)
        Create a variable array from a builder. This is a parametrized version of buildVariables(VariableBuilder.ArrayBuilder).
        Type Parameters:
        I - Type for object that stores the created variables.
        Parameters:
        builder - Builder to create variables.
        makeResult - Function to create the (empty) result.
        addResult - Function to add a variable to the result.
        Returns:
        Result as given by makeResult.
        Since:
        43.00
      • buildVariables

        public <K1> java.util.HashMap<K1,​Variable> buildVariables​(VariableBuilder.MapBuilder<K1> builder)
        Create a variable map from a builder.
        Type Parameters:
        K1 - Data type for dimension 1.
        Parameters:
        builder - The builder to create variables.
        Returns:
        Created Variables.
        Since:
        43.00
      • buildVariables

        public <I,​K1> I buildVariables​(VariableBuilder.MapBuilder<K1> builder,
                                             java.util.function.Supplier<I> makeResult,
                                             Action3<I,​K1,​Variable> addResult)
        Create a variable map from a builder.
        Type Parameters:
        I - Type of result
        K1 - Data type for dimension 1.
        Parameters:
        builder - The builder to create variables.
        makeResult - Function to create an (empty) result.
        addResult - Function to add an element to the result.
        Returns:
        Result as given by makeResult.
        Since:
        43.00
      • addVariables

        public VariableBuilder.VariableArrayBuilder addVariables​(int dim)
        Create an 1 dimensional array of variables. This function returns a builder that generates variables according to a specification. The specification can be modified. In order to actually create the variables, you have to call the returned builder's toArray() function.
           // Create a multi-dimensional array of binary variables
           Variable []  = prob.addColumns(dim)
                                 .withType(com.dashoptimization.objects.ColumnType.Binary)
                                 .toArray();
          
        See VariableBuilder.VariableArrayBuilder for details of how to modify the specification in the builder.
        Parameters:
        dim - Dimension.
        Returns:
        A builder that will create the variables.
        Since:
        43.00
      • addVariables

        public <K1> VariableBuilder.VariableMapBuilder<K1> addVariables​(java.util.Collection<K1> coll1)
        Create an 1 dimensional map of variables. This function returns a builder that generates variables according to a specification. The specification can be modified. In order to actually create the variables, you have to call the returned builder's toMap() function.
           // Create a multi-dimensional array of binary columns
           java.util.HashMap<K1 ,com.dashoptimization.objects.Variable> x = prob.addVariables(coll1 )
                                              .withType(com.dashoptimization.objects.ColumnType.Binary)
                                              .toMap();
          
        See VariableBuilder.VariableMapBuilder for details of how to modify the specification in the builder.
        Type Parameters:
        K1 - Data type for dimension 1.
        Parameters:
        coll1 - Data for dimension 1.
        Returns:
        A builder that will create the columns.
        Since:
        43.00
      • addVariables

        public <K1> VariableBuilder.VariableMapBuilder<K1> addVariables​(K1[] arr1)
        Create an 1 dimensional map of variables. This function returns a builder that generates variables according to a specification. The specification can be modified. In order to actually create the variables, you have to call the returned builder's toMap() function.
           // Create a multi-dimensional array of binary columns
           java.util.HashMap<K1 ,com.dashoptimization.objects.Variable> x = prob.addVariables(coll1 )
                                              .withType(com.dashoptimization.objects.ColumnType.Binary)
                                              .toMap();
          
        See VariableBuilder.VariableMapBuilder for details of how to modify the specification in the builder.
        Type Parameters:
        K1 - Data type for dimension 1.
        Parameters:
        arr1 - Data for the builder.
        Returns:
        A builder that will create the columns.
        Since:
        43.00
      • addVariables

        public <K1> VariableBuilder.VariableMapBuilder<K1> addVariables​(java.util.stream.Stream<K1> strm)
        Create an 1 dimensional map of variables. This function returns a builder that generates variables according to a specification. The specification can be modified. In order to actually create the variables, you have to call the returned builder's toMap() function.
           // Create a multi-dimensional array of binary columns
           java.util.HashMap<K1 ,com.dashoptimization.objects.Variable> x = prob.addVariables(coll1 )
                                              .withType(com.dashoptimization.objects.ColumnType.Binary)
                                              .toMap();
          
        See VariableBuilder.VariableMapBuilder for details of how to modify the specification in the builder.
        Type Parameters:
        K1 - Data type for dimension 1.
        Returns:
        A builder that will create the columns.
        Since:
        43.00
      • addVariable

        public Variable addVariable​(double lb,
                                    double ub,
                                    ColumnType type,
                                    java.lang.String name)
        Add a single variable to this problem.
        Parameters:
        lb - Lower bound for new variable.
        ub - Upper bound for new variable.
        type - Type for new variable.
        name - Name for new variable, can be null.
        Returns:
        The newly created variable.
        Since:
        43.00
      • addVariable

        public Variable addVariable​(double lb,
                                    double ub,
                                    ColumnType type,
                                    double limit,
                                    java.lang.String name)
        Add a single variable to this problem.
        Parameters:
        lb - Lower bound for new variable.
        ub - Upper bound for new variable.
        type - Type for new variable.
        limit - Global limit for the variable. This is ignored unless the variable is semi-continuous, semi-integer or partial integer.
        name - Name for new variable, can be null.
        Returns:
        The newly created variable.
        Since:
        43.00
      • addVariable

        public Variable addVariable​(double lb,
                                    double ub,
                                    ColumnType type)
        Add a single variable to this problem.
        Parameters:
        lb - Lower bound for new variable.
        ub - Upper bound for new variable.
        type - Type for new variable.
        Returns:
        The newly created variable.
        Since:
        43.00
      • addVariable

        public Variable addVariable​(java.lang.String name)
        Add a single variable to this problem. The variable will have default type (continuous) and bounds (0 and infinity).
        Parameters:
        name - Name for new variable.
        Returns:
        The newly created variable.
        Since:
        43.00
      • addVariable

        public Variable addVariable​(ColumnType type)
        Add a single variable to this problem. The variable will have default bounds and no name.
        Parameters:
        type - Type for new variable.
        Returns:
        The newly created variable.
        Since:
        43.00
      • addVariable

        public Variable addVariable​(ColumnType type,
                                    java.lang.String name)
        Add a single variable to this problem. The variable will have default bounds.
        Parameters:
        type - Type for new variable.
        name - Name for new variable.
        Returns:
        The newly created variable.
        Since:
        43.00
      • addVariable

        public Variable addVariable()
        Add a single variable to this problem. This variable will be continuous, have default bounds (0 and infinity) and will not have a name.
        Returns:
        The newly created variable.
        Since:
        43.00
      • buildVariables

        public Variable[][] buildVariables​(VariableBuilder.Array2Builder builder)
        Create a variable array from a builder.
        Parameters:
        builder - The builder to create variables.
        Returns:
        Created variables.
        Since:
        43.00
      • buildVariables

        public <I> I buildVariables​(VariableBuilder.Array2Builder builder,
                                    java.util.function.Supplier<I> makeResult,
                                    Action4<I,​java.lang.Integer,​java.lang.Integer,​Variable> addResult)
        Create a variable array from a builder. This is a parametrized version of buildVariables(VariableBuilder.Array2Builder).
        Type Parameters:
        I - Type for object that stores the created variables.
        Parameters:
        builder - Builder to create variables.
        makeResult - Function to create the (empty) result.
        addResult - Function to add a variable to the result.
        Returns:
        Result as given by makeResult.
        Since:
        43.00
      • buildVariables

        public <K1,​K2> HashMap2<K1,​K2,​Variable> buildVariables​(VariableBuilder.Map2Builder<K1,​K2> builder)
        Create a variable map from a builder.
        Type Parameters:
        K1 - Data type for dimension 1.
        K2 - Data type for dimension 2.
        Parameters:
        builder - The builder to create variables.
        Returns:
        Created Variables.
        Since:
        43.00
      • buildVariables

        public <I,​K1,​K2> I buildVariables​(VariableBuilder.Map2Builder<K1,​K2> builder,
                                                      java.util.function.Supplier<I> makeResult,
                                                      Action4<I,​K1,​K2,​Variable> addResult)
        Create a variable map from a builder.
        Type Parameters:
        I - Type of result
        K1 - Data type for dimension 1.
        K2 - Data type for dimension 2.
        Parameters:
        builder - The builder to create variables.
        makeResult - Function to create an (empty) result.
        addResult - Function to add an element to the result.
        Returns:
        Result as given by makeResult.
        Since:
        43.00
      • addVariables

        public VariableBuilder.VariableArray2Builder addVariables​(int dim1,
                                                                  int dim2)
        Create an 2 dimensional array of variables. This function returns a builder that generates variables according to a specification. The specification can be modified. In order to actually create the variables, you have to call the returned builder's toArray() function.
           // Create a multi-dimensional array of binary variables
           Variable [] [] = prob.addColumns(dim1 ,dim2)
                                 .withType(com.dashoptimization.objects.ColumnType.Binary)
                                 .toArray();
          
        See VariableBuilder.VariableArray2Builder for details of how to modify the specification in the builder.
        Parameters:
        dim1 - Dimension 1.
        dim2 - Dimension 2.
        Returns:
        A builder that will create the variables.
        Since:
        43.00
      • addVariables

        public <K1,​K2> VariableBuilder.VariableMap2Builder<K1,​K2> addVariables​(java.util.Collection<K1> coll1,
                                                                                           java.util.Collection<K2> coll2)
        Create an 2 dimensional map of variables. This function returns a builder that generates variables according to a specification. The specification can be modified. In order to actually create the variables, you have to call the returned builder's toMap() function.
           // Create a multi-dimensional array of binary columns
           com.dashoptimization.maps.HashMap2<K1 ,K2,com.dashoptimization.objects.Variable> x = prob.addVariables(coll1 ,coll2)
                                              .withType(com.dashoptimization.objects.ColumnType.Binary)
                                              .toMap();
          
        See VariableBuilder.VariableMap2Builder for details of how to modify the specification in the builder.
        Type Parameters:
        K1 - Data type for dimension 1.
        K2 - Data type for dimension 2.
        Parameters:
        coll1 - Data for dimension 1.
        coll2 - Data for dimension 2.
        Returns:
        A builder that will create the columns.
        Since:
        43.00
      • addVariables

        public <K1,​K2> VariableBuilder.VariableMap2Builder<K1,​K2> addVariables​(K1[] arr1,
                                                                                           K2[] arr2)
        Create an 2 dimensional map of variables. This function returns a builder that generates variables according to a specification. The specification can be modified. In order to actually create the variables, you have to call the returned builder's toMap() function.
           // Create a multi-dimensional array of binary columns
           com.dashoptimization.maps.HashMap2<K1 ,K2,com.dashoptimization.objects.Variable> x = prob.addVariables(coll1 ,coll2)
                                              .withType(com.dashoptimization.objects.ColumnType.Binary)
                                              .toMap();
          
        See VariableBuilder.VariableMap2Builder for details of how to modify the specification in the builder.
        Type Parameters:
        K1 - Data type for dimension 1.
        K2 - Data type for dimension 2.
        Parameters:
        arr1 - Data for the builder.
        arr2 - Data for the builder.
        Returns:
        A builder that will create the columns.
        Since:
        43.00
      • buildVariables

        public Variable[][][] buildVariables​(VariableBuilder.Array3Builder builder)
        Create a variable array from a builder.
        Parameters:
        builder - The builder to create variables.
        Returns:
        Created variables.
        Since:
        43.00
      • buildVariables

        public <I> I buildVariables​(VariableBuilder.Array3Builder builder,
                                    java.util.function.Supplier<I> makeResult,
                                    Action5<I,​java.lang.Integer,​java.lang.Integer,​java.lang.Integer,​Variable> addResult)
        Create a variable array from a builder. This is a parametrized version of buildVariables(VariableBuilder.Array3Builder).
        Type Parameters:
        I - Type for object that stores the created variables.
        Parameters:
        builder - Builder to create variables.
        makeResult - Function to create the (empty) result.
        addResult - Function to add a variable to the result.
        Returns:
        Result as given by makeResult.
        Since:
        43.00
      • buildVariables

        public <K1,​K2,​K3> HashMap3<K1,​K2,​K3,​Variable> buildVariables​(VariableBuilder.Map3Builder<K1,​K2,​K3> builder)
        Create a variable map from a builder.
        Type Parameters:
        K1 - Data type for dimension 1.
        K2 - Data type for dimension 2.
        K3 - Data type for dimension 3.
        Parameters:
        builder - The builder to create variables.
        Returns:
        Created Variables.
        Since:
        43.00
      • buildVariables

        public <I,​K1,​K2,​K3> I buildVariables​(VariableBuilder.Map3Builder<K1,​K2,​K3> builder,
                                                               java.util.function.Supplier<I> makeResult,
                                                               Action5<I,​K1,​K2,​K3,​Variable> addResult)
        Create a variable map from a builder.
        Type Parameters:
        I - Type of result
        K1 - Data type for dimension 1.
        K2 - Data type for dimension 2.
        K3 - Data type for dimension 3.
        Parameters:
        builder - The builder to create variables.
        makeResult - Function to create an (empty) result.
        addResult - Function to add an element to the result.
        Returns:
        Result as given by makeResult.
        Since:
        43.00
      • addVariables

        public VariableBuilder.VariableArray3Builder addVariables​(int dim1,
                                                                  int dim2,
                                                                  int dim3)
        Create an 3 dimensional array of variables. This function returns a builder that generates variables according to a specification. The specification can be modified. In order to actually create the variables, you have to call the returned builder's toArray() function.
           // Create a multi-dimensional array of binary variables
           Variable [] [] [] = prob.addColumns(dim1 ,dim2 ,dim3)
                                 .withType(com.dashoptimization.objects.ColumnType.Binary)
                                 .toArray();
          
        See VariableBuilder.VariableArray3Builder for details of how to modify the specification in the builder.
        Parameters:
        dim1 - Dimension 1.
        dim2 - Dimension 2.
        dim3 - Dimension 3.
        Returns:
        A builder that will create the variables.
        Since:
        43.00
      • addVariables

        public <K1,​K2,​K3> VariableBuilder.VariableMap3Builder<K1,​K2,​K3> addVariables​(java.util.Collection<K1> coll1,
                                                                                                             java.util.Collection<K2> coll2,
                                                                                                             java.util.Collection<K3> coll3)
        Create an 3 dimensional map of variables. This function returns a builder that generates variables according to a specification. The specification can be modified. In order to actually create the variables, you have to call the returned builder's toMap() function.
           // Create a multi-dimensional array of binary columns
           com.dashoptimization.maps.HashMap3<K1 ,K2 ,K3,com.dashoptimization.objects.Variable> x = prob.addVariables(coll1 ,coll2 ,coll3)
                                              .withType(com.dashoptimization.objects.ColumnType.Binary)
                                              .toMap();
          
        See VariableBuilder.VariableMap3Builder for details of how to modify the specification in the builder.
        Type Parameters:
        K1 - Data type for dimension 1.
        K2 - Data type for dimension 2.
        K3 - Data type for dimension 3.
        Parameters:
        coll1 - Data for dimension 1.
        coll2 - Data for dimension 2.
        coll3 - Data for dimension 3.
        Returns:
        A builder that will create the columns.
        Since:
        43.00
      • addVariables

        public <K1,​K2,​K3> VariableBuilder.VariableMap3Builder<K1,​K2,​K3> addVariables​(K1[] arr1,
                                                                                                             K2[] arr2,
                                                                                                             K3[] arr3)
        Create an 3 dimensional map of variables. This function returns a builder that generates variables according to a specification. The specification can be modified. In order to actually create the variables, you have to call the returned builder's toMap() function.
           // Create a multi-dimensional array of binary columns
           com.dashoptimization.maps.HashMap3<K1 ,K2 ,K3,com.dashoptimization.objects.Variable> x = prob.addVariables(coll1 ,coll2 ,coll3)
                                              .withType(com.dashoptimization.objects.ColumnType.Binary)
                                              .toMap();
          
        See VariableBuilder.VariableMap3Builder for details of how to modify the specification in the builder.
        Type Parameters:
        K1 - Data type for dimension 1.
        K2 - Data type for dimension 2.
        K3 - Data type for dimension 3.
        Parameters:
        arr1 - Data for the builder.
        arr2 - Data for the builder.
        arr3 - Data for the builder.
        Returns:
        A builder that will create the columns.
        Since:
        43.00
      • buildVariables

        public Variable[][][][] buildVariables​(VariableBuilder.Array4Builder builder)
        Create a variable array from a builder.
        Parameters:
        builder - The builder to create variables.
        Returns:
        Created variables.
        Since:
        43.00
      • buildVariables

        public <I> I buildVariables​(VariableBuilder.Array4Builder builder,
                                    java.util.function.Supplier<I> makeResult,
                                    Action6<I,​java.lang.Integer,​java.lang.Integer,​java.lang.Integer,​java.lang.Integer,​Variable> addResult)
        Create a variable array from a builder. This is a parametrized version of buildVariables(VariableBuilder.Array4Builder).
        Type Parameters:
        I - Type for object that stores the created variables.
        Parameters:
        builder - Builder to create variables.
        makeResult - Function to create the (empty) result.
        addResult - Function to add a variable to the result.
        Returns:
        Result as given by makeResult.
        Since:
        43.00
      • buildVariables

        public <K1,​K2,​K3,​K4> HashMap4<K1,​K2,​K3,​K4,​Variable> buildVariables​(VariableBuilder.Map4Builder<K1,​K2,​K3,​K4> builder)
        Create a variable map from a builder.
        Type Parameters:
        K1 - Data type for dimension 1.
        K2 - Data type for dimension 2.
        K3 - Data type for dimension 3.
        K4 - Data type for dimension 4.
        Parameters:
        builder - The builder to create variables.
        Returns:
        Created Variables.
        Since:
        43.00
      • buildVariables

        public <I,​K1,​K2,​K3,​K4> I buildVariables​(VariableBuilder.Map4Builder<K1,​K2,​K3,​K4> builder,
                                                                        java.util.function.Supplier<I> makeResult,
                                                                        Action6<I,​K1,​K2,​K3,​K4,​Variable> addResult)
        Create a variable map from a builder.
        Type Parameters:
        I - Type of result
        K1 - Data type for dimension 1.
        K2 - Data type for dimension 2.
        K3 - Data type for dimension 3.
        K4 - Data type for dimension 4.
        Parameters:
        builder - The builder to create variables.
        makeResult - Function to create an (empty) result.
        addResult - Function to add an element to the result.
        Returns:
        Result as given by makeResult.
        Since:
        43.00
      • addVariables

        public VariableBuilder.VariableArray4Builder addVariables​(int dim1,
                                                                  int dim2,
                                                                  int dim3,
                                                                  int dim4)
        Create an 4 dimensional array of variables. This function returns a builder that generates variables according to a specification. The specification can be modified. In order to actually create the variables, you have to call the returned builder's toArray() function.
           // Create a multi-dimensional array of binary variables
           Variable [] [] [] [] = prob.addColumns(dim1 ,dim2 ,dim3 ,dim4)
                                 .withType(com.dashoptimization.objects.ColumnType.Binary)
                                 .toArray();
          
        See VariableBuilder.VariableArray4Builder for details of how to modify the specification in the builder.
        Parameters:
        dim1 - Dimension 1.
        dim2 - Dimension 2.
        dim3 - Dimension 3.
        dim4 - Dimension 4.
        Returns:
        A builder that will create the variables.
        Since:
        43.00
      • addVariables

        public <K1,​K2,​K3,​K4> VariableBuilder.VariableMap4Builder<K1,​K2,​K3,​K4> addVariables​(java.util.Collection<K1> coll1,
                                                                                                                               java.util.Collection<K2> coll2,
                                                                                                                               java.util.Collection<K3> coll3,
                                                                                                                               java.util.Collection<K4> coll4)
        Create an 4 dimensional map of variables. This function returns a builder that generates variables according to a specification. The specification can be modified. In order to actually create the variables, you have to call the returned builder's toMap() function.
           // Create a multi-dimensional array of binary columns
           com.dashoptimization.maps.HashMap4<K1 ,K2 ,K3 ,K4,com.dashoptimization.objects.Variable> x = prob.addVariables(coll1 ,coll2 ,coll3 ,coll4)
                                              .withType(com.dashoptimization.objects.ColumnType.Binary)
                                              .toMap();
          
        See VariableBuilder.VariableMap4Builder for details of how to modify the specification in the builder.
        Type Parameters:
        K1 - Data type for dimension 1.
        K2 - Data type for dimension 2.
        K3 - Data type for dimension 3.
        K4 - Data type for dimension 4.
        Parameters:
        coll1 - Data for dimension 1.
        coll2 - Data for dimension 2.
        coll3 - Data for dimension 3.
        coll4 - Data for dimension 4.
        Returns:
        A builder that will create the columns.
        Since:
        43.00
      • addVariables

        public <K1,​K2,​K3,​K4> VariableBuilder.VariableMap4Builder<K1,​K2,​K3,​K4> addVariables​(K1[] arr1,
                                                                                                                               K2[] arr2,
                                                                                                                               K3[] arr3,
                                                                                                                               K4[] arr4)
        Create an 4 dimensional map of variables. This function returns a builder that generates variables according to a specification. The specification can be modified. In order to actually create the variables, you have to call the returned builder's toMap() function.
           // Create a multi-dimensional array of binary columns
           com.dashoptimization.maps.HashMap4<K1 ,K2 ,K3 ,K4,com.dashoptimization.objects.Variable> x = prob.addVariables(coll1 ,coll2 ,coll3 ,coll4)
                                              .withType(com.dashoptimization.objects.ColumnType.Binary)
                                              .toMap();
          
        See VariableBuilder.VariableMap4Builder for details of how to modify the specification in the builder.
        Type Parameters:
        K1 - Data type for dimension 1.
        K2 - Data type for dimension 2.
        K3 - Data type for dimension 3.
        K4 - Data type for dimension 4.
        Parameters:
        arr1 - Data for the builder.
        arr2 - Data for the builder.
        arr3 - Data for the builder.
        arr4 - Data for the builder.
        Returns:
        A builder that will create the columns.
        Since:
        43.00
      • buildVariables

        public Variable[][][][][] buildVariables​(VariableBuilder.Array5Builder builder)
        Create a variable array from a builder.
        Parameters:
        builder - The builder to create variables.
        Returns:
        Created variables.
        Since:
        43.00
      • buildVariables

        public <I> I buildVariables​(VariableBuilder.Array5Builder builder,
                                    java.util.function.Supplier<I> makeResult,
                                    Action7<I,​java.lang.Integer,​java.lang.Integer,​java.lang.Integer,​java.lang.Integer,​java.lang.Integer,​Variable> addResult)
        Create a variable array from a builder. This is a parametrized version of buildVariables(VariableBuilder.Array5Builder).
        Type Parameters:
        I - Type for object that stores the created variables.
        Parameters:
        builder - Builder to create variables.
        makeResult - Function to create the (empty) result.
        addResult - Function to add a variable to the result.
        Returns:
        Result as given by makeResult.
        Since:
        43.00
      • buildVariables

        public <K1,​K2,​K3,​K4,​K5> HashMap5<K1,​K2,​K3,​K4,​K5,​Variable> buildVariables​(VariableBuilder.Map5Builder<K1,​K2,​K3,​K4,​K5> builder)
        Create a variable map from a builder.
        Type Parameters:
        K1 - Data type for dimension 1.
        K2 - Data type for dimension 2.
        K3 - Data type for dimension 3.
        K4 - Data type for dimension 4.
        K5 - Data type for dimension 5.
        Parameters:
        builder - The builder to create variables.
        Returns:
        Created Variables.
        Since:
        43.00
      • buildVariables

        public <I,​K1,​K2,​K3,​K4,​K5> I buildVariables​(VariableBuilder.Map5Builder<K1,​K2,​K3,​K4,​K5> builder,
                                                                                 java.util.function.Supplier<I> makeResult,
                                                                                 Action7<I,​K1,​K2,​K3,​K4,​K5,​Variable> addResult)
        Create a variable map from a builder.
        Type Parameters:
        I - Type of result
        K1 - Data type for dimension 1.
        K2 - Data type for dimension 2.
        K3 - Data type for dimension 3.
        K4 - Data type for dimension 4.
        K5 - Data type for dimension 5.
        Parameters:
        builder - The builder to create variables.
        makeResult - Function to create an (empty) result.
        addResult - Function to add an element to the result.
        Returns:
        Result as given by makeResult.
        Since:
        43.00
      • addVariables

        public VariableBuilder.VariableArray5Builder addVariables​(int dim1,
                                                                  int dim2,
                                                                  int dim3,
                                                                  int dim4,
                                                                  int dim5)
        Create an 5 dimensional array of variables. This function returns a builder that generates variables according to a specification. The specification can be modified. In order to actually create the variables, you have to call the returned builder's toArray() function.
           // Create a multi-dimensional array of binary variables
           Variable [] [] [] [] [] = prob.addColumns(dim1 ,dim2 ,dim3 ,dim4 ,dim5)
                                 .withType(com.dashoptimization.objects.ColumnType.Binary)
                                 .toArray();
          
        See VariableBuilder.VariableArray5Builder for details of how to modify the specification in the builder.
        Parameters:
        dim1 - Dimension 1.
        dim2 - Dimension 2.
        dim3 - Dimension 3.
        dim4 - Dimension 4.
        dim5 - Dimension 5.
        Returns:
        A builder that will create the variables.
        Since:
        43.00
      • addVariables

        public <K1,​K2,​K3,​K4,​K5> VariableBuilder.VariableMap5Builder<K1,​K2,​K3,​K4,​K5> addVariables​(java.util.Collection<K1> coll1,
                                                                                                                                                 java.util.Collection<K2> coll2,
                                                                                                                                                 java.util.Collection<K3> coll3,
                                                                                                                                                 java.util.Collection<K4> coll4,
                                                                                                                                                 java.util.Collection<K5> coll5)
        Create an 5 dimensional map of variables. This function returns a builder that generates variables according to a specification. The specification can be modified. In order to actually create the variables, you have to call the returned builder's toMap() function.
           // Create a multi-dimensional array of binary columns
           com.dashoptimization.maps.HashMap5<K1 ,K2 ,K3 ,K4 ,K5,com.dashoptimization.objects.Variable> x = prob.addVariables(coll1 ,coll2 ,coll3 ,coll4 ,coll5)
                                              .withType(com.dashoptimization.objects.ColumnType.Binary)
                                              .toMap();
          
        See VariableBuilder.VariableMap5Builder for details of how to modify the specification in the builder.
        Type Parameters:
        K1 - Data type for dimension 1.
        K2 - Data type for dimension 2.
        K3 - Data type for dimension 3.
        K4 - Data type for dimension 4.
        K5 - Data type for dimension 5.
        Parameters:
        coll1 - Data for dimension 1.
        coll2 - Data for dimension 2.
        coll3 - Data for dimension 3.
        coll4 - Data for dimension 4.
        coll5 - Data for dimension 5.
        Returns:
        A builder that will create the columns.
        Since:
        43.00
      • addVariables

        public <K1,​K2,​K3,​K4,​K5> VariableBuilder.VariableMap5Builder<K1,​K2,​K3,​K4,​K5> addVariables​(K1[] arr1,
                                                                                                                                                 K2[] arr2,
                                                                                                                                                 K3[] arr3,
                                                                                                                                                 K4[] arr4,
                                                                                                                                                 K5[] arr5)
        Create an 5 dimensional map of variables. This function returns a builder that generates variables according to a specification. The specification can be modified. In order to actually create the variables, you have to call the returned builder's toMap() function.
           // Create a multi-dimensional array of binary columns
           com.dashoptimization.maps.HashMap5<K1 ,K2 ,K3 ,K4 ,K5,com.dashoptimization.objects.Variable> x = prob.addVariables(coll1 ,coll2 ,coll3 ,coll4 ,coll5)
                                              .withType(com.dashoptimization.objects.ColumnType.Binary)
                                              .toMap();
          
        See VariableBuilder.VariableMap5Builder for details of how to modify the specification in the builder.
        Type Parameters:
        K1 - Data type for dimension 1.
        K2 - Data type for dimension 2.
        K3 - Data type for dimension 3.
        K4 - Data type for dimension 4.
        K5 - Data type for dimension 5.
        Parameters:
        arr1 - Data for the builder.
        arr2 - Data for the builder.
        arr3 - Data for the builder.
        arr4 - Data for the builder.
        arr5 - Data for the builder.
        Returns:
        A builder that will create the columns.
        Since:
        43.00

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