ValueRange Module
Creates a value range, restricts the range with a minimum, increment, maximum or value set, and calculates with two value ranges.
Nested modules
| Modules | Description |
|
Creates an increment from the positive values of a ValueUnit, removing multiples of a smaller value, and restricts and calculates with increments. Raises a solver exception for an empty increment. |
|
|
Creates an inclusive or exclusive maximum from a single value, compares and restricts maximums, and rounds a maximum down to a multiple of an increment. Raises a solver exception when the ValueUnit does not hold a single value. |
|
|
Calculates the minimum and the maximum of the product, quotient, sum or difference of two ranges from the limits and signs of both ranges. Raises a DivideByZeroException for a division by a range with zero as an inclusive limit. For example, <1N..3N] * <4N..5N> = <4N..15N>, where an angle bracket marks an exclusive limit and a square bracket an inclusive limit. |
|
|
Creates an inclusive or exclusive minimum from a single value, compares and restricts minimums, and rounds a minimum up to a multiple of an increment. Raises a solver exception when the ValueUnit does not hold a single value. |
|
|
Holds the operators to calculate with two value ranges, on all values or on minimum, increment and maximum only, and to restrict a range. |
|
|
Creates a minimum, maximum, increment or value set property of a variable, and converts a property to a value range or to text. |
|
|
Creates a sorted set of values, intersects, prunes and calculates with value sets, and expands a minimum, increment and maximum to a value set. Raises a solver exception for an empty set. |
Functions and values
| Function or value |
Description
|
||
Full Usage:
allSameUnitGroup vr
Parameters:
ValueRange
-
The ValueRange
Returns: bool
True if all ValueUnits belong to the same ValueUnit.Group
|
Check whether all
|
||
Full Usage:
apply unr nonZero fMin fMax fMinMax fIncr fMinIncr fIncrMax fMinIncrMax fValueSet _arg1
Parameters:
'a
-
Constant for Unrestricted
nonZero : 'a
-
Constant for NonZeroNoneNegative
fMin : Minimum -> 'a
-
The function to apply to a Minimum
fMax : Maximum -> 'a
-
The function to apply to a Maximum
fMinMax : Minimum * Maximum -> 'a
-
The function to apply to a MinMax
fIncr : Increment -> 'a
-
The function to apply to an Increment
fMinIncr : Minimum * Increment -> 'a
-
The function to apply to a MinIncr
fIncrMax : Increment * Maximum -> 'a
-
The function to apply to an IncrMax
fMinIncrMax : Minimum * Increment * Maximum -> 'a
-
The function to apply to a MinIncrMax
fValueSet : ValueSet -> 'a
-
The function to apply to a ValueSet
_arg1 : ValueRange
Returns: 'a
The result of applying the function to the ValueRange
Type parameters: 'a |
Apply a function to a
|
||
Full Usage:
applyExpr y expr
Parameters:
ValueRange
-
The ValueRange to apply to
expr : ValueRange
-
The ValueRange to apply
Returns: ValueRange
The resulting (restricted) ValueRange
|
Set a
Example
val min: obj
val incr: obj
val max: obj
val vr1: obj
union case Option.Some: Value: 'T -> Option<'T>
union case Option.None: Option<'T>
val vr2: obj
|
||
Full Usage:
applyValueUnit f vr
Parameters:
ValueUnit -> 'a option
-
The function to apply to the ValueUnit
vr : ValueRange
-
The ValueRange
Returns: 'a option
The mapped ValueRange
Type parameters: 'a |
Map a function to the ValueUnit of a
|
||
Full Usage:
calc onlyMinIncrMax op (vr1, vr2)
Parameters:
bool
-
Whether only the minimum, increment and maximum should be calculated
op : ValueUnit -> ValueUnit -> ValueUnit
-
The infix operator
vr1 : ValueRange
-
The first ValueRange
vr2 : ValueRange
-
The second ValueRange
Returns: ValueRange
The resulting ValueRange
|
Applies an infix operator
Example
val vs1: obj
val vs2: obj
val vr1: obj
union case Option.None: Option<'T>
union case Option.Some: Value: 'T -> Option<'T>
val vr2: obj
|
||
|
Count the number of values in a Only when value range is a ValueSet there can be a count.
|
||
Full Usage:
contains vu vr
Parameters:
ValueUnit
-
The ValueUnit (value)
vr : ValueRange
-
The ValueRange
Returns: bool
|
Checks whether a value is in a
Example
val min: obj option
union case Option.Some: Value: 'T -> Option<'T>
val vr: obj
union case Option.None: Option<'T>
val vu: obj
val incr: obj option
|
||
Full Usage:
convertToUnit u
Parameters:
Unit
-
The unit to convert to
Returns: ValueRange -> ValueRange
|
Convert the unit of a
|
||
Full Usage:
create min incr max vs
Parameters:
Minimum option
-
Optional Minimum
incr : Increment option
-
Optional Increment
max : Maximum option
-
Optional Maximum
vs : ValueSet option
-
Optional ValueSet
Returns: ValueRange
A ValueRange
|
Create a ValueRange depending on the values of min, incr and max.
Example
val min: obj option
union case Option.Some: Value: 'T -> Option<'T>
val max: obj option
val incr: 'a option
union case Option.None: Option<'T>
val vs: 'a option
|
||
|
Create a ValueRange with a Minimum, Increment and a Maximum.
|
||
|
|||
|
Create a Maximum Range that is either inclusive or exclusive.
|
||
|
Create a Minimum Range that is either inclusive or exclusive.
|
||
|
|||
Full Usage:
createMinMax min minIncl max maxIncl
Parameters:
ValueUnit
-
The minimum
minIncl : bool
-
Whether the minimum is inclusive
max : ValueUnit
-
The maximum
maxIncl : bool
-
Whether the maximum is inclusive
Returns: ValueRange
|
Create a
|
||
|
|||
Full Usage:
diffWith vr1 vr2
Parameters:
ValueRange
-
The first ValueRange
vr2 : ValueRange
-
The second ValueRange
Returns: Set<Property>
The difference between the two ValueRanges
|
Get the difference between two
Example
val min: obj
val incr: obj
val max: obj
val vr1: obj
union case Option.Some: Value: 'T -> Option<'T>
union case Option.None: Option<'T>
val vr2: obj
|
||
|
|||
Full Usage:
eqsUnitGroup vr1 vr2
Parameters:
ValueRange
-
The first ValueRange
vr2 : ValueRange
-
The second ValueRange
Returns: bool
True if both ValueRanges have the same ValueUnit.Group
|
Check whether two
|
||
Full Usage:
filter minOpt incrOpt maxOpt arg4
Parameters:
Minimum option
-
The optional minimum
incrOpt : Increment option
-
The optional increment
maxOpt : Maximum option
-
The optional maximum
arg3 : ValueSet
Returns: ValueSet
A ValueSet that contains the values that are between min and max
and that are a multiple of incr.
|
Filter a set of
Example
val vs: obj
union case Option.Some: Value: 'T -> Option<'T>
union case Option.None: Option<'T>
|
||
|
Get an optional Increment in a ValueRange
|
||
|
Get the indices of the values in a ValueRange vr1 that are also in a ValueRange vr2.
|
||
|
Get an optional Maximum in a ValueRange
|
||
|
Get an optional Minimum in a ValueRange
|
||
Full Usage:
getMinIncrMaxOrValueSet vr
Parameters:
ValueRange
Returns: Minimum option * Increment option * Maximum option * ValueSet option
|
Get all of min, incr, max and valSet in a ValueRange as a tuple
|
||
Full Usage:
getUnit vr
Parameters:
ValueRange
-
The ValueRange
Returns: Unit option
The unit of the ValueRange or None
|
Get the unit of a
|
||
|
Get an optional ValueSet in a ValueRange
|
||
|
Create an Note that the resulting max is always inclusive and smaller than or equal to the original max and is a multiple of incr.
Example
val incr: obj
val max: obj
|
||
Full Usage:
increaseIncrement maxCount incrs vr
Parameters:
RationalX
-
The maximum count
incrs : Increment list
-
The increment list
vr : ValueRange
-
The ValueRange
Returns: ValueRange
The resulting (more restrictive) ValueRange
|
Try and increase the increment of a A ValueRange that already holds at most maxCount values is left as it is. When there is no increment in the list that can be used to increase the increment of the ValueRange to the maximum count, the largest possible increment is used.
Example
val min: obj
val max: obj
val incr: obj
val incrs: obj list
Multiple items
module List from Microsoft.FSharp.Collections -------------------- type List<'T> = | op_Nil | op_ColonColon of Head: 'T * Tail: 'T list interface IReadOnlyList<'T> interface IReadOnlyCollection<'T> interface IEnumerable interface IEnumerable<'T> member GetReverseIndex: rank: int * offset: int -> int member GetSlice: startIndex: int option * endIndex: int option -> 'T list static member Cons: head: 'T * tail: 'T list -> 'T list member Head: 'T member IsEmpty: bool member Item: index: int -> 'T with get ... val map: mapping: ('T -> 'U) -> list: 'T list -> 'U list
val i: obj
val vr: obj
union case Option.Some: Value: 'T -> Option<'T>
union case Option.None: Option<'T>
|
||
Full Usage:
isBetweenMinMax min max br
Parameters:
Minimum option
-
The optional minimum
max : Maximum option
-
The optional maximum
br : BigRational
-
The BigRational to check
Returns: bool
True if br is between min and max
|
Checks whether a
Example
val min: obj option
union case Option.Some: Value: 'T -> Option<'T>
val max: obj option
val br: obj
val max: 'a option
union case Option.None: Option<'T>
|
||
|
|||
Full Usage:
isMultipleOfIncr incrOpt br
Parameters:
Increment option
-
br : BigRational
-
Returns: bool
|
Checks whether a
Example
val incr: obj option
union case Option.Some: Value: 'T -> Option<'T>
val br: obj
val incr: 'a option
union case Option.None: Option<'T>
|
||
|
|
||
|
|
||
Full Usage:
map fMin fMax fMinMax fIncr fMinIncr fIncrMax fMinIncrMax fValueSet vr
Parameters:
Minimum -> Minimum
-
The function to apply to a Minimum
fMax : Maximum -> Maximum
-
The function to apply to a Maximum
fMinMax : Minimum * Maximum -> Minimum * Maximum
-
The function to apply to a MinMax
fIncr : Increment -> Increment
-
The function to apply to an Increment
fMinIncr : Minimum * Increment -> Minimum * Increment
-
The function to apply to a MinIncr
fIncrMax : Increment * Maximum -> Increment * Maximum
-
The function to apply to an IncrMax
fMinIncrMax : Minimum * Increment * Maximum -> Minimum * Increment * Maximum
-
The function to apply to a MinIncrMax
fValueSet : ValueSet -> ValueSet
-
The function to apply to a ValueSet
vr : ValueRange
-
The ValueRange
Returns: ValueRange
The mapped ValueRange
|
Map a function over a
|
||
Full Usage:
mapValueUnit f vr
Parameters:
ValueUnit -> ValueUnit
-
The function to apply to the ValueUnit
vr : ValueRange
-
The ValueRange
Returns: ValueRange
The mapped ValueRange
|
Map a function to the ValueUnit of a
|
||
|
|||
|
Create a Note that the resulting max is always inclusive and smaller than or equal to the original max.
Example
val incr: obj
val max: obj
|
||
|
|||
|
Checks whether
Example
val min: obj
val max: obj
|
||
|
Get the count of a ValueRange with a Minimum, Increment and a Maximum. The Minimum and Maximum are restricted to multiples of the Increment. Therefore, they will also be inclusive.
Example
val min: obj
val max: obj
val incr: obj
|
||
|
Create a
|
||
|
Create a Note that the resulting min is always inclusive and greater than or equal to the original min and is a multiple of incr.
Example
val min: obj
val incr: obj
|
||
|
|||
|
Create a
|
||
|
Create a Note that the resulting min is always inclusive and greater than or equal to the original min.
Example
val incr: obj
val min: obj
|
||
|
Checks whether Note that inclusivity or exclusivity of a minimum and maximum must be accounted for.
Example
val min: obj
val max: obj
|
||
Full Usage:
nonZeroAndPositive vr
Parameters:
ValueRange
-
The ValueRange
Returns: ValueRange
The resulting (more restrictive) non zero and non negative ValueRange
|
Make a ValueRange non zero and non negative. I.e., with at least a minimum that excludes zero.
|
||
|
A ValueRange that contains only non-zero, positive values.
|
||
Full Usage:
pickIndices indices vr
Parameters:
int array
vr : ValueRange
Returns: ValueRange
|
Pick the values at the given indices from a ValueRange vr.
|
||
|
Create a string (to print) representation of a ValueRange by supplying the optional min, incr and max of the ValueRange. Exact true prints exact BigRationals, when false print as floating numbers
|
||
|
Prune, limit the number of values, in a
Only a
|
||
Full Usage:
setIncr newIncr vr
Parameters:
Increment
-
The new increment
vr : ValueRange
-
The ValueRange
Returns: ValueRange
The resulting (more restrictive) ValueRange
|
Apply a new newIncr to a The resulting increment is the least common multiple of the new and the previous increment, so it holds only the values that lie on both. The resulting ValueRange will be equal or more restrictive than the original.
Example
val min: obj option
union case Option.Some: Value: 'T -> Option<'T>
val incr: obj option
val vr: obj
union case Option.None: Option<'T>
val newIncr: obj
|
||
Full Usage:
setMax newMax vr
Parameters:
Maximum
-
The new Maximum
vr : ValueRange
-
The ValueRange
Returns: ValueRange
The resulting (more restrictive) ValueRange
|
Apply a new
If maximum cannot be set the original
Example
val max: obj option
union case Option.Some: Value: 'T -> Option<'T>
val vr: obj
union case Option.None: Option<'T>
val newMax: obj
|
||
|
Set the maximum value of a ValueRange to a ValueSet with only the maximum value.
|
||
|
Set the median value of a ValueRange to a ValueSet with only the median value.
|
||
Full Usage:
setMin newMin vr
Parameters:
Minimum
-
The new Minimum
vr : ValueRange
-
The ValueRange
Returns: ValueRange
The resulting (more restrictive) ValueRange
|
Apply a new A new minimum can only be set if it is larger than the previous minimum. Also, when an increment is set, the new minimum must be a multiple of the increment. When a new minimum cannot be set, the original ValueRange is returned.
Example
val min: obj option
union case Option.Some: Value: 'T -> Option<'T>
val incr: obj option
val vr: obj
union case Option.None: Option<'T>
val newMin: obj
|
||
|
Set the minimum value of a ValueRange to a ValueSet with only the minimum value.
|
||
Full Usage:
setUnit unt vr
Parameters:
Unit
-
The unit to set
vr : ValueRange
-
The ValueRange
Returns: ValueRange
The ValueRange with the new unit
|
Set the unit of a
|
||
Full Usage:
setValueSet newVs vr
Parameters:
ValueSet
-
The new ValueSet
vr : ValueRange
-
The ValueRange
Returns: ValueRange
The resulting (more restrictive) ValueRange
|
Apply a new The resulting ValueRange will be equal or more restrictive than the original. This means that if the new ValueSet is empty, the original ValueRange is returned. If the new ValueSet contains values the result will be an intersection of the original ValueRange and the new ValueSet.
Example
val vs: obj
val vr: obj
union case Option.None: Option<'T>
union case Option.Some: Value: 'T -> Option<'T>
val newVs: obj
|
||
|
|||
|
Create a set of
Example
val min: obj
val incr: obj
val max: obj
val vr: obj
union case Option.Some: Value: 'T -> Option<'T>
union case Option.None: Option<'T>
|
||
|
|||
Full Usage:
tryToValueSet maxCount vr
Parameters:
int
vr : ValueRange
Returns: ValueSet option
|
The values of a range as one list, when it is a list, or a min, increment and max of fewer than maxCount values.
|
||
|
An Unrestricted ValueRange.
|
||
Full Usage:
valueSetIsSubsetOf vr2 vr1
Parameters:
ValueRange
-
The second ValueRange
vr1 : ValueRange
-
The first ValueRange
Returns: bool
|
Checks whether a
Only checks whether the
Example
val vs1: obj
val vs2: obj
val vr1: obj
union case Option.None: Option<'T>
union case Option.Some: Value: 'T -> Option<'T>
val vr2: obj
|
GenPRES