A Reducer that exististentially quantifies a predicate as a reduction over a collection of Cells.
A Reducer that exististentially quantifies a predicate as a reduction over a collection of Cells.
This reducer will return true upon encountering the first value
that is available and meaningful and applying the predicate
p
to that value returns true. Otherwise, returns false.
This reducer is unusual in that it will ignore NonValues, in particular, it will not propogate NM. If the predicate can be satisfied by a value that is available and meaningful elsewhere in the collection, then this reduction should still return true.
This reducer will only traverse the entire collection if it never
encounters an available and meaningful value that satisfies the
predicate p
.
the value type of the column to reduce.
Series.empty[Int, Int].reduce(new Exists[Int](i => true)) == Value(false) Series(1 -> 1, 2 -> 2).reduce(new Exists[Int](i => i < 2)) == Value(true) Series.fromCells[Int, Int](1 -> NA, 2 -> 1).reduce(new Exists[Int](i => i < 2)) == Value(true) Series.fromCells[Int, Int](1 -> NM, 2 -> 1).reduce(new Exists[Int](i => i < 2)) == Value(true)
This reducer will always return precisely Value[Boolean]
,
rather than Cell[Boolean]
. This in constrast to most reducers
that will also return NonValues.
A Reducer that universally quantifies a predicate as a reduction over a collection of Cells.
A Reducer that universally quantifies a predicate as a reduction over a collection of Cells.
This reducer will return false upon encountering the first value
that is not meaningful, or the first value that is available and
meaningful and applying the predicate p
to that value
returns false. Otherwise, returns true.
This reducer does propogate NM, in a sense, but the result is
Value(false)
rather than NM
. Unavailable values (NA) are
treated as the vaccuous case, so they will in count as a counter
example to the quantification.
This reducer will only traverse the entire collection if it never
encounters a not meaningful value or a meaningful value that does
not satisfy the predicate p
.
the value type of the column to reduce.
Series.empty[Int, Int].reduce(new ForAll[Int](i => false)) == Value(true) Series(1 -> 1, 2 -> 2).reduce(new ForAll[Int](i => i < 3)) == Value(true) Series(1 -> 1, 2 -> 2).reduce(new ForAll[Int](i => i < 2)) == Value(false) Series.fromCells[Int, Int](1 -> NA) .reduce(new ForAll[Int](i => false)) == Value(true) Series.fromCells[Int, Int](1 -> 1, 2 -> NM).reduce(new ForAll[Int](i => i < 2)) == Value(false)
This reducer will always return precisely Value[Boolean]
,
rather than Cell[Boolean]
. This in constrast to most reducers
that will also return NonValues.
A low level trait for implementing reductions.
Returns a Reducer that exististentially quantifies a predicate as a reduction over a collection of Cells.
Returns a Reducer that exististentially quantifies a predicate as a reduction over a collection of Cells.
This reducer will return true upon encountering the first value
that is available and meaningful and applying the predicate
p
to that value returns true. Otherwise, returns false.
This reducer is unusual in that it will ignore NonValues, in particular, it will not propogate NM. If the predicate can be satisfied by a value that is available and meaningful elsewhere in the collection, then this reduction should still return true.
This reducer will only traverse the entire collection if it never
encounters an available and meaningful value that satisfies the
predicate p
.
the value type of the column to reduce.
the predicate to apply to the values of the column.
a Reducer that exististentially quantifies a predicate.
Series.empty[Int, Int].reduce(Exists[Int](i => true)) == Value(false) Series(1 -> 1, 2 -> 2).reduce(Exists[Int](i => i < 2)) == Value(true) Series.fromCells[Int, Int](1 -> NA, 2 -> 1).reduce(Exists[Int](i => i < 2)) == Value(true) Series.fromCells[Int, Int](1 -> NM, 2 -> 1).reduce(Exists[Int](i => i < 2)) == Value(true)
Returns a Reducer that universally quantifies a predicate as a reduction over a collection of Cells.
Returns a Reducer that universally quantifies a predicate as a reduction over a collection of Cells.
This reducer will return false upon encountering the first value
that is not meaningful, or the first value that is available and
meaningful and applying the predicate p
to that value
returns false. Otherwise, returns true.
This reducer does propogate NM, in a sense, but the result is
Value(false)
rather than NM
. Unavailable values (NA) are
treated as the vaccuous case, so they will in count as a counter
example to the quantification.
This reducer will only traverse the entire collection if it never
encounters a not meaningful value or a meaningful value that does
not satisfy the predicate p
.
the value type of the column to reduce.
the predicate to apply to the values of the column.
a Reducer that universally quantifies a predicate.
Series.empty[Int, Int].reduce(ForAll[Int](i => false)) == Value(true) Series(1 -> 1, 2 -> 2).reduce(ForAll[Int](i => i < 3)) == Value(true) Series(1 -> 1, 2 -> 2).reduce(ForAll[Int](i => i < 2)) == Value(false) Series.fromCells[Int, Int](1 -> NA) .reduce(ForAll[Int](i => false)) == Value(true) Series.fromCells[Int, Int](1 -> 1, 2 -> NM).reduce(ForAll[Int](i => i < 2)) == Value(false)