org.codehaus.gpars

groovyx.gpars.extra166y
[Java] Class ParallelArrayWithDoubleMapping

java.lang.Object
  groovyx.gpars.extra166y.AbstractParallelAnyArray.OPap
      groovyx.gpars.extra166y.ParallelArrayWithDoubleMapping

public abstract class ParallelArrayWithDoubleMapping
extends OPap

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.


Constructor Summary
ParallelArrayWithDoubleMapping(ForkJoinPool ex, int origin, int fence, java.lang.Object[] array)

 
Method Summary
ParallelDoubleArray all()

Returns a new ParallelDoubleArray holding mappings.

void apply(DoubleProcedure procedure)

Applies the given procedure.

double max()

Returns the maximum element, or -Double.MAX_VALUE if empty.

double max(DoubleComparator comparator)

Returns the maximum element, or -Double.MAX_VALUE if empty.

double min()

Returns the minimum element, or Double.MAX_VALUE if empty.

double min(DoubleComparator comparator)

Returns the minimum element, or Double.MAX_VALUE if empty.

double reduce(DoubleReducer reducer, double base)

Returns reduction of mapped elements.

java.lang.Iterable 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.

double sum()

Returns the sum of elements.

SummaryStatistics summary(DoubleComparator comparator)

Returns summary statistics.

SummaryStatistics summary()

Returns summary statistics, using natural comparator.

ParallelArrayWithMapping withIndexedMapping(IntAndDoubleToObject 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.

ParallelArrayWithDoubleMapping withIndexedMapping(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.

ParallelArrayWithLongMapping withIndexedMapping(IntAndDoubleToLong 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.

ParallelArrayWithDoubleMapping withMapping(DoubleOp op)

Returns an operation prefix that causes a method to operate on mapped elements of the array using the given op.

ParallelArrayWithLongMapping withMapping(DoubleToLong op)

Returns an operation prefix that causes a method to operate on mapped elements of the array using the given op.

ParallelArrayWithMapping withMapping(DoubleToObject op)

Returns an operation prefix that causes a method to operate on mapped elements of the array using the given op.

ParallelArrayWithMapping withMapping(DoubleAndObjectToObject combiner, ParallelArrayWithMapping other)

Returns an operation prefix that causes a method to operate on binary mappings of this array and the other array.

ParallelArrayWithMapping withMapping(DoubleAndDoubleToObject combiner, ParallelDoubleArrayWithDoubleMapping other)

Returns an operation prefix that causes a method to operate on binary mappings of this array and the other array.

ParallelArrayWithMapping withMapping(DoubleAndLongToObject combiner, ParallelLongArrayWithLongMapping other)

Returns an operation prefix that causes a method to operate on binary mappings of this array and the other array.

ParallelArrayWithDoubleMapping withMapping(DoubleAndObjectToDouble combiner, ParallelArrayWithMapping other)

Returns an operation prefix that causes a method to operate on binary mappings of this array and the other array.

ParallelArrayWithDoubleMapping withMapping(BinaryDoubleOp combiner, ParallelDoubleArrayWithDoubleMapping other)

Returns an operation prefix that causes a method to operate on binary mappings of this array and the other array.

ParallelArrayWithDoubleMapping withMapping(DoubleAndLongToDouble combiner, ParallelLongArrayWithLongMapping other)

Returns an operation prefix that causes a method to operate on binary mappings of this array and the other array.

ParallelArrayWithLongMapping withMapping(DoubleAndObjectToLong combiner, ParallelArrayWithMapping other)

Returns an operation prefix that causes a method to operate on binary mappings of this array and the other array.

ParallelArrayWithLongMapping withMapping(DoubleAndDoubleToLong combiner, ParallelDoubleArrayWithDoubleMapping other)

Returns an operation prefix that causes a method to operate on binary mappings of this array and the other array.

ParallelArrayWithLongMapping withMapping(DoubleAndLongToLong combiner, ParallelLongArrayWithLongMapping other)

Returns an operation prefix that causes a method to operate on binary mappings of this array and the other array.

 

Constructor Detail

ParallelArrayWithDoubleMapping

ParallelArrayWithDoubleMapping(ForkJoinPool ex, int origin, int fence, java.lang.Object[] array)


 
Method Detail

all

public ParallelDoubleArray all()
Returns a new ParallelDoubleArray holding mappings.
Returns:
a new ParallelDoubleArray holding mappings


apply

public void apply(DoubleProcedure procedure)
Applies the given procedure.
Parameters:
procedure - the procedure


max

public double max()
Returns the maximum element, or -Double.MAX_VALUE if empty.
Returns:
maximum element, or -Double.MAX_VALUE if empty


max

public double max(DoubleComparator comparator)
Returns the maximum element, or -Double.MAX_VALUE if empty.
Parameters:
comparator - the comparator
Returns:
maximum element, or -Double.MAX_VALUE if empty


min

public double min()
Returns the minimum element, or Double.MAX_VALUE if empty.
Returns:
minimum element, or Double.MAX_VALUE if empty


min

public double min(DoubleComparator comparator)
Returns the minimum element, or Double.MAX_VALUE if empty.
Parameters:
comparator - the comparator
Returns:
minimum element, or Double.MAX_VALUE if empty


reduce

public double reduce(DoubleReducer reducer, double base)
Returns reduction of mapped elements.
Parameters:
reducer - the reducer
base - the result for an empty array
Returns:
reduction


sequentially

public java.lang.Iterable 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


sum

public double sum()
Returns the sum of elements.
Returns:
the sum of elements


summary

public SummaryStatistics summary(DoubleComparator comparator)
Returns summary statistics.
Parameters:
comparator - the comparator to use for locating minimum and maximum elements
Returns:
the summary


summary

public SummaryStatistics summary()
Returns summary statistics, using natural comparator.
Returns:
the summary


withIndexedMapping

public ParallelArrayWithMapping withIndexedMapping(IntAndDoubleToObject 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 ParallelArrayWithDoubleMapping withIndexedMapping(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

public ParallelArrayWithLongMapping withIndexedMapping(IntAndDoubleToLong 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


withMapping

public ParallelArrayWithDoubleMapping withMapping(DoubleOp op)
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 ParallelArrayWithLongMapping withMapping(DoubleToLong op)
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 ParallelArrayWithMapping withMapping(DoubleToObject op)
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 ParallelArrayWithMapping withMapping(DoubleAndObjectToObject combiner, ParallelArrayWithMapping other)
Returns an operation prefix that causes a method to operate on binary mappings of this array and the other array.
Parameters:
combiner - the combiner
other - the other array
Returns:
operation prefix


withMapping

public ParallelArrayWithMapping withMapping(DoubleAndDoubleToObject 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 combiner
other - the other array
Returns:
operation prefix


withMapping

public ParallelArrayWithMapping withMapping(DoubleAndLongToObject 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 combiner
other - the other array
Returns:
operation prefix


withMapping

public ParallelArrayWithDoubleMapping withMapping(DoubleAndObjectToDouble combiner, ParallelArrayWithMapping other)
Returns an operation prefix that causes a method to operate on binary mappings of this array and the other array.
Parameters:
combiner - the combiner
other - the other array
Returns:
operation prefix


withMapping

public ParallelArrayWithDoubleMapping withMapping(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 combiner
other - the other array
Returns:
operation prefix


withMapping

public ParallelArrayWithDoubleMapping withMapping(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 combiner
other - the other array
Returns:
operation prefix


withMapping

public ParallelArrayWithLongMapping withMapping(DoubleAndObjectToLong combiner, ParallelArrayWithMapping other)
Returns an operation prefix that causes a method to operate on binary mappings of this array and the other array.
Parameters:
combiner - the combiner
other - the other array
Returns:
operation prefix


withMapping

public ParallelArrayWithLongMapping withMapping(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 combiner
other - the other array
Returns:
operation prefix


withMapping

public ParallelArrayWithLongMapping withMapping(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 combiner
other - the other array
Returns:
operation prefix


 

Copyright © 2008–2013 Václav Pech. All Rights Reserved.