VariableBuilder.VariableArrayBuilder
- java.lang.Object
-
- com.dashoptimization.VariableBuilder.VariableArrayBuilder
-
- Enclosing class:
- VariableBuilder
public static final class VariableBuilder.VariableArrayBuilder extends java.lang.Object
Build a 1-dimensional array of variables.- Since:
- 43.00
-
-
Constructor Summary
Constructor Description VariableArrayBuilder(int dim, XpressProblem prob)
Create a builder that will create a 1-dimensional array of variables with the specified dimensions.
-
Method Summary
Modifier and Type Method Description Variable[]
toArray()
Create variables as specified by this builder.<I> I
toArray(java.util.function.Supplier<I> makeResult, Action3<I,java.lang.Integer,Variable> addResult)
Create variables as specified by this builder.VariableBuilder.VariableArrayBuilder
withLB(double newLb)
Set a constant lower bound for all variables.VariableBuilder.VariableArrayBuilder
withLB(double[] newLb)
Set a lower bound that is given by an array.VariableBuilder.VariableArrayBuilder
withLB(java.util.function.IntFunction<java.lang.Double> newLb)
Set a lower bound that depends on the index.VariableBuilder.VariableArrayBuilder
withLimit(double newLimit)
Set a constant limit for all variables.VariableBuilder.VariableArrayBuilder
withLimit(double[] newLimit)
Set a limit that is given by an array.VariableBuilder.VariableArrayBuilder
withLimit(java.util.function.IntFunction<java.lang.Double> newLimit)
Set a limit that depends on the index.VariableBuilder.VariableArrayBuilder
withName(java.lang.String newName)
Set a constant name for all variables.VariableBuilder.VariableArrayBuilder
withName(java.lang.String[] newName)
Set a name bound that is given by an array.VariableBuilder.VariableArrayBuilder
withName(java.util.function.IntFunction<java.lang.String> newName)
Set a name that depends on the index.VariableBuilder.VariableArrayBuilder
withType(ColumnType newType)
Set the type for all variables.VariableBuilder.VariableArrayBuilder
withType(ColumnType[] newType)
Set a type that is given by an array.VariableBuilder.VariableArrayBuilder
withType(java.util.function.IntFunction<ColumnType> newType)
Set a type that depends on the index.VariableBuilder.VariableArrayBuilder
withUB(double newUb)
Set a constant upper bound for all variables.VariableBuilder.VariableArrayBuilder
withUB(double[] newUb)
Set an upper bound that is given by an array.VariableBuilder.VariableArrayBuilder
withUB(java.util.function.IntFunction<java.lang.Double> newUb)
Set a upper bound that depends on the index.
-
-
-
Constructor Detail
-
VariableArrayBuilder
public VariableArrayBuilder(int dim, XpressProblem prob)
Create a builder that will create a 1-dimensional array of variables with the specified dimensions.- Parameters:
-
dim
- Dimension. -
prob
- The problem for which to create variables. - Since:
- 43.00
-
-
Method Detail
-
withLB
public VariableBuilder.VariableArrayBuilder withLB(java.util.function.IntFunction<java.lang.Double> newLb)
Set a lower bound that depends on the index.- Parameters:
-
newLb
- The lower bound for all variables created by this builder. - Returns:
- Always returns this instance.
- Since:
- 43.00
-
withLB
public VariableBuilder.VariableArrayBuilder withLB(double newLb)
Set a constant lower bound for all variables.- Parameters:
-
newLb
- The lower bound for all variables created by this builder. - Returns:
- Always returns this instance.
- Since:
- 43.00
-
withLB
public VariableBuilder.VariableArrayBuilder withLB(double[] newLb)
Set a lower bound that is given by an array. The dimension(s) of the passed array must match the dimension(s) that were passed to the constructor.- Parameters:
-
newLb
- Lower bounds for the individual variables. - Returns:
- Always returns this instance.
- Since:
- 43.00
-
withUB
public VariableBuilder.VariableArrayBuilder withUB(java.util.function.IntFunction<java.lang.Double> newUb)
Set a upper bound that depends on the index.- Parameters:
-
newUb
- The upper bound for all variables created by this builder. - Returns:
- Always returns this instance.
- Since:
- 43.00
-
withUB
public VariableBuilder.VariableArrayBuilder withUB(double newUb)
Set a constant upper bound for all variables.- Parameters:
-
newUb
- The upper bound for all variables created by this builder. - Returns:
- Always returns this instance.
- Since:
- 43.00
-
withUB
public VariableBuilder.VariableArrayBuilder withUB(double[] newUb)
Set an upper bound that is given by an array. The dimension(s) of the passed array must match the dimension(s) that were passed to the constructor.- Parameters:
-
newUb
- Upper bounds for the individual variables. - Returns:
- Always returns this instance.
- Since:
- 43.00
-
withLimit
public VariableBuilder.VariableArrayBuilder withLimit(java.util.function.IntFunction<java.lang.Double> newLimit)
Set a limit that depends on the index. A limit specifies the bounds for semi-continuous/integer variables and the limit for partial integer variables. It does not apply to variables of other types.- Parameters:
-
newLimit
- The limit for all variables created by this builder. - Returns:
- Always returns this instance.
- Since:
- 43.00
-
withLimit
public VariableBuilder.VariableArrayBuilder withLimit(double newLimit)
Set a constant limit for all variables. A limit specifies the bounds for semi-continuous/integer variables and the limit for partial integer variables. It does not apply to variables of other types.- Parameters:
-
newLimit
- The limit for all variables created by this builder. - Returns:
- Always returns this instance.
- Since:
- 43.00
-
withLimit
public VariableBuilder.VariableArrayBuilder withLimit(double[] newLimit)
Set a limit that is given by an array. The dimension(s) of the passed array must match the dimension(s) that were passed to the constructor.- Parameters:
-
newLimit
- Limits for the individual variables. - Returns:
- Always returns this instance.
- Since:
- 43.00
-
withName
public VariableBuilder.VariableArrayBuilder withName(java.util.function.IntFunction<java.lang.String> newName)
Set a name that depends on the index.- Parameters:
-
newName
- The name for all variables created by this builder. - Returns:
- Always returns this instance.
- Since:
- 43.00
-
withName
public VariableBuilder.VariableArrayBuilder withName(java.lang.String newName)
Set a constant name for all variables.- Parameters:
-
newName
- The name for all variables created by this builder. This must benull
or a format string that will be invoked with the index as argument. - Returns:
- Always returns this instance.
- Since:
- 43.00
-
withName
public VariableBuilder.VariableArrayBuilder withName(java.lang.String[] newName)
Set a name bound that is given by an array. The dimension(s) of the passed array must match the dimension(s) that were passed to the constructor.- Parameters:
-
newName
- Names for the individual variables. - Returns:
- Always returns this instance.
- Since:
- 43.00
-
withType
public VariableBuilder.VariableArrayBuilder withType(java.util.function.IntFunction<ColumnType> newType)
Set a type that depends on the index.- Parameters:
-
newType
- The type for all variables created by this builder. - Returns:
- Always returns this instance.
- Since:
- 43.00
-
withType
public VariableBuilder.VariableArrayBuilder withType(ColumnType newType)
Set the type for all variables.- Parameters:
-
newType
- The type for all variables created by this builder. - Returns:
- Always returns this instance.
- Since:
- 43.00
-
withType
public VariableBuilder.VariableArrayBuilder withType(ColumnType[] newType)
Set a type that is given by an array. The dimension(s) of the passed array must match the dimension(s) that were passed to the constructor.- Parameters:
-
newType
- Types for the individual variables. - Returns:
- Always returns this instance.
- Since:
- 43.00
-
toArray
public Variable[] toArray()
Create variables as specified by this builder.Used in these examples:
- Polygon
- PolygonMap
- PolygonMapDelta
- PolygonMultiMap
- PolygonMultiMapDelta
- PolygonVecMap
- PolygonVecMapDelta
- TSP
- Since:
- 43.00
-
toArray
public <I> I toArray(java.util.function.Supplier<I> makeResult, Action3<I,java.lang.Integer,Variable> addResult)
Create variables as specified by this builder.Used in these examples:
- Polygon
- PolygonMap
- PolygonMapDelta
- PolygonMultiMap
- PolygonMultiMapDelta
- PolygonVecMap
- PolygonVecMapDelta
- TSP
- Type Parameters:
-
I
- Type of return value. - Parameters:
-
makeResult
- A function to create the (empty) return value. -
addResult
- A function to add a value to the result. - Returns:
- The array of variables.
- Since:
- 43.00
-
-
© 2001-2025 Fair Isaac Corporation. All rights reserved. This documentation is the property of Fair Isaac Corporation (“FICO”). Receipt or possession of this documentation does not convey rights to disclose, reproduce, make derivative works, use, or allow others to use it except solely for internal evaluation purposes to determine whether to purchase a license to the software described in this documentation, or as otherwise set forth in a written software license agreement between you and FICO (or a FICO affiliate). Use of this documentation and the software described in it must conform strictly to the foregoing permitted uses, and no other use is permitted.