Package extra166y
Class ParallelArrayWithDoubleMapping<T>
java.lang.Object
extra166y.AbstractParallelAnyArray
extra166y.ParallelArrayWithDoubleMapping<T>
A prefix view of ParallelArray that causes operations to apply
to mappings of elements, not to the elements themselves.
Instances of this class may be constructed only via prefix
methods of ParallelArray or its other prefix classes.
-
Method Summary
Modifier and TypeMethodDescriptionall()
Returns a new ParallelDoubleArray holding mappingsvoid
apply
(Ops.DoubleProcedure procedure) Applies the given proceduredouble
max()
Returns the maximum element, or -Double.MAX_VALUE if emptydouble
max
(Ops.DoubleComparator comparator) Returns the maximum element, or -Double.MAX_VALUE if emptydouble
min()
Returns the minimum element, or Double.MAX_VALUE if emptydouble
min
(Ops.DoubleComparator comparator) Returns the minimum element, or Double.MAX_VALUE if emptydouble
reduce
(Ops.DoubleReducer reducer, double base) Returns reduction of mapped elementsReturns an Iterable view to sequentially step through mapped elements also obeying bound and filter constraints, without performing computations to evaluate them in paralleldouble
sum()
Returns the sum of elementssummary()
Returns summary statistics, using natural comparatorsummary
(Ops.DoubleComparator comparator) Returns summary statisticsabstract ParallelArrayWithDoubleMapping<T>
Returns an operation prefix that causes a method to operate on mappings of this array using the given mapper that accepts as arguments an element's current index and value (as mapped by preceding mappings, if any), and produces a new value.abstract ParallelArrayWithLongMapping<T>
Returns an operation prefix that causes a method to operate on mappings of this array using the given mapper that accepts as arguments an element's current index and value (as mapped by preceding mappings, if any), and produces a new value.abstract <V> ParallelArrayWithMapping<T,
V> withIndexedMapping
(Ops.IntAndDoubleToObject<? extends V> mapper) Returns an operation prefix that causes a method to operate on mappings of this array using the given mapper that accepts as arguments an element's current index and value (as mapped by preceding mappings, if any), and produces a new value.withMapping
(Ops.BinaryDoubleOp combiner, ParallelDoubleArrayWithDoubleMapping other) Returns an operation prefix that causes a method to operate on binary mappings of this array and the other array.withMapping
(Ops.DoubleAndDoubleToLong combiner, ParallelDoubleArrayWithDoubleMapping other) Returns an operation prefix that causes a method to operate on binary mappings of this array and the other array.<V> ParallelArrayWithMapping<T,
V> withMapping
(Ops.DoubleAndDoubleToObject<? extends V> combiner, ParallelDoubleArrayWithDoubleMapping other) Returns an operation prefix that causes a method to operate on binary mappings of this array and the other array.withMapping
(Ops.DoubleAndLongToDouble combiner, ParallelLongArrayWithLongMapping other) Returns an operation prefix that causes a method to operate on binary mappings of this array and the other array.withMapping
(Ops.DoubleAndLongToLong combiner, ParallelLongArrayWithLongMapping other) Returns an operation prefix that causes a method to operate on binary mappings of this array and the other array.<V> ParallelArrayWithMapping<T,
V> withMapping
(Ops.DoubleAndLongToObject<? extends V> combiner, ParallelLongArrayWithLongMapping other) Returns an operation prefix that causes a method to operate on binary mappings of this array and the other array.<V,
W> ParallelArrayWithDoubleMapping<T> withMapping
(Ops.DoubleAndObjectToDouble<? super V> combiner, ParallelArrayWithMapping<W, V> other) Returns an operation prefix that causes a method to operate on binary mappings of this array and the other array.<V,
W> ParallelArrayWithLongMapping<T> withMapping
(Ops.DoubleAndObjectToLong<? super V> combiner, ParallelArrayWithMapping<W, V> other) Returns an operation prefix that causes a method to operate on binary mappings of this array and the other array.<V,
W, X> ParallelArrayWithMapping<T, W> withMapping
(Ops.DoubleAndObjectToObject<? super V, ? extends W> combiner, ParallelArrayWithMapping<X, V> other) Returns an operation prefix that causes a method to operate on binary mappings of this array and the other array.abstract ParallelArrayWithDoubleMapping<T>
Returns an operation prefix that causes a method to operate on mapped elements of the array using the given op.abstract ParallelArrayWithLongMapping<T>
Returns an operation prefix that causes a method to operate on mapped elements of the array using the given op.abstract <U> ParallelArrayWithMapping<T,
U> withMapping
(Ops.DoubleToObject<? extends U> op) Returns an operation prefix that causes a method to operate on mapped elements of the array using the given op.Methods inherited from class extra166y.AbstractParallelAnyArray
anyIndex, isEmpty, size
-
Method Details
-
apply
Applies the given procedure- Parameters:
procedure
- the procedure
-
reduce
Returns reduction of mapped elements- Parameters:
reducer
- the reducerbase
- the result for an empty array- Returns:
- reduction
-
min
public double min()Returns the minimum element, or Double.MAX_VALUE if empty- Returns:
- minimum element, or Double.MAX_VALUE if empty
-
min
Returns the minimum element, or Double.MAX_VALUE if empty- Parameters:
comparator
- the comparator- Returns:
- minimum element, or Double.MAX_VALUE if empty
-
max
public double max()Returns the maximum element, or -Double.MAX_VALUE if empty- Returns:
- maximum element, or -Double.MAX_VALUE if empty
-
max
Returns the maximum element, or -Double.MAX_VALUE if empty- Parameters:
comparator
- the comparator- Returns:
- maximum element, or -Double.MAX_VALUE if empty
-
sum
public double sum()Returns the sum of elements- Returns:
- the sum of elements
-
summary
Returns summary statistics- Parameters:
comparator
- the comparator to use for locating minimum and maximum elements- Returns:
- the summary.
-
summary
Returns summary statistics, using natural comparator- Returns:
- the summary.
-
all
Returns a new ParallelDoubleArray holding mappings- Returns:
- a new ParallelDoubleArray holding mappings
-
withMapping
Returns an operation prefix that causes a method to operate on mapped elements of the array using the given op.- Parameters:
op
- the op- Returns:
- operation prefix
-
withMapping
Returns an operation prefix that causes a method to operate on mapped elements of the array using the given op.- Parameters:
op
- the op- Returns:
- operation prefix
-
withMapping
Returns an operation prefix that causes a method to operate on mapped elements of the array using the given op.- Parameters:
op
- the op- Returns:
- operation prefix
-
withMapping
public <V,W, ParallelArrayWithMapping<T,X> W> withMapping(Ops.DoubleAndObjectToObject<? super V, ? extends W> combiner, ParallelArrayWithMapping<X, V> other) Returns an operation prefix that causes a method to operate on binary mappings of this array and the other array.- Parameters:
combiner
- the combinerother
- the other array- Returns:
- operation prefix
-
withMapping
public <V> ParallelArrayWithMapping<T,V> withMapping(Ops.DoubleAndDoubleToObject<? extends V> combiner, ParallelDoubleArrayWithDoubleMapping other) Returns an operation prefix that causes a method to operate on binary mappings of this array and the other array.- Parameters:
combiner
- the combinerother
- the other array- Returns:
- operation prefix
-
withMapping
public <V> ParallelArrayWithMapping<T,V> withMapping(Ops.DoubleAndLongToObject<? extends V> combiner, ParallelLongArrayWithLongMapping other) Returns an operation prefix that causes a method to operate on binary mappings of this array and the other array.- Parameters:
combiner
- the combinerother
- the other array- Returns:
- operation prefix
-
withMapping
public <V,W> ParallelArrayWithDoubleMapping<T> withMapping(Ops.DoubleAndObjectToDouble<? super V> combiner, ParallelArrayWithMapping<W, V> other) Returns an operation prefix that causes a method to operate on binary mappings of this array and the other array.- Parameters:
combiner
- the combinerother
- the other array- Returns:
- operation prefix
-
withMapping
public ParallelArrayWithDoubleMapping<T> withMapping(Ops.BinaryDoubleOp combiner, ParallelDoubleArrayWithDoubleMapping other) Returns an operation prefix that causes a method to operate on binary mappings of this array and the other array.- Parameters:
combiner
- the combinerother
- the other array- Returns:
- operation prefix
-
withMapping
public ParallelArrayWithDoubleMapping<T> withMapping(Ops.DoubleAndLongToDouble combiner, ParallelLongArrayWithLongMapping other) Returns an operation prefix that causes a method to operate on binary mappings of this array and the other array.- Parameters:
combiner
- the combinerother
- the other array- Returns:
- operation prefix
-
withMapping
public <V,W> ParallelArrayWithLongMapping<T> withMapping(Ops.DoubleAndObjectToLong<? super V> combiner, ParallelArrayWithMapping<W, V> other) Returns an operation prefix that causes a method to operate on binary mappings of this array and the other array.- Parameters:
combiner
- the combinerother
- the other array- Returns:
- operation prefix
-
withMapping
public ParallelArrayWithLongMapping<T> withMapping(Ops.DoubleAndDoubleToLong combiner, ParallelDoubleArrayWithDoubleMapping other) Returns an operation prefix that causes a method to operate on binary mappings of this array and the other array.- Parameters:
combiner
- the combinerother
- the other array- Returns:
- operation prefix
-
withMapping
public ParallelArrayWithLongMapping<T> withMapping(Ops.DoubleAndLongToLong combiner, ParallelLongArrayWithLongMapping other) Returns an operation prefix that causes a method to operate on binary mappings of this array and the other array.- Parameters:
combiner
- the combinerother
- the other array- Returns:
- operation prefix
-
withIndexedMapping
public abstract <V> ParallelArrayWithMapping<T,V> withIndexedMapping(Ops.IntAndDoubleToObject<? extends V> mapper) Returns an operation prefix that causes a method to operate on mappings of this array using the given mapper that accepts as arguments an element's current index and value (as mapped by preceding mappings, if any), and produces a new value.- Parameters:
mapper
- the mapper- Returns:
- operation prefix
-
withIndexedMapping
public abstract ParallelArrayWithDoubleMapping<T> withIndexedMapping(Ops.IntAndDoubleToDouble mapper) Returns an operation prefix that causes a method to operate on mappings of this array using the given mapper that accepts as arguments an element's current index and value (as mapped by preceding mappings, if any), and produces a new value.- Parameters:
mapper
- the mapper- Returns:
- operation prefix
-
withIndexedMapping
Returns an operation prefix that causes a method to operate on mappings of this array using the given mapper that accepts as arguments an element's current index and value (as mapped by preceding mappings, if any), and produces a new value.- Parameters:
mapper
- the mapper- Returns:
- operation prefix
-
sequentially
Returns an Iterable view to sequentially step through mapped elements also obeying bound and filter constraints, without performing computations to evaluate them in parallel- Returns:
- the Iterable view
-