org.codehaus.gpars

groovyx.gpars.extra166y
[Java] Class ParallelDoubleArrayWithFilter

java.lang.Object
  AbstractParallelAnyArray.DPap
      groovyx.gpars.extra166y.ParallelDoubleArrayWithDoubleMapping
          groovyx.gpars.extra166y.ParallelDoubleArrayWithFilter

public abstract class ParallelDoubleArrayWithFilter
extends ParallelDoubleArrayWithDoubleMapping

A prefix view of ParallelDoubleArray that causes operations to apply only to elements for which a selector returns true. Instances of this class may be constructed only via prefix methods of ParallelDoubleArray or its other prefix classes.


Constructor Summary
ParallelDoubleArrayWithFilter(ForkJoinPool ex, int origin, int fence, double[] array)

 
Method Summary
ParallelDoubleArray allUniqueElements()

Returns a new ParallelDoubleArray containing only unique elements (that is, without any duplicates).

double dget(int i)

boolean hasAllEqualElements(ParallelDoubleArrayWithDoubleMapping other)

Returns true if all elements at the same relative positions of this and other array are equal.

void leafTransfer(int lo, int hi, double[] dest, int offset)

void leafTransferByIndex(int[] indices, int loIdx, int hiIdx, double[] dest, int offset)

ParallelDoubleArrayWithFilter replaceWithGeneratedValue(DoubleGenerator generator)

Replaces elements with results of applying the given generator.

ParallelDoubleArrayWithFilter replaceWithMappedIndex(IntToDouble op)

Replaces elements with the results of applying the given op to their indices

ParallelDoubleArrayWithFilter replaceWithMappedIndex(IntAndDoubleToDouble op)

Replaces elements with the results of applying the given mapping to each index and current element value

ParallelDoubleArrayWithFilter replaceWithMapping(DoubleOp op)

Replaces elements with the results of applying the given op to their current values.

ParallelDoubleArrayWithFilter replaceWithMapping(BinaryDoubleOp combiner, ParallelDoubleArrayWithDoubleMapping other)

Replaces elements with results of applying op(thisElement, otherElement)

ParallelDoubleArrayWithFilter replaceWithMapping(BinaryDoubleOp combiner, double[] other)

Replaces elements with results of applying op(thisElement, otherElement)

ParallelDoubleArrayWithFilter replaceWithValue(double value)

Replaces elements with the given value.

ParallelDoubleArrayWithFilter withFilter(DoublePredicate selector)

Returns an operation prefix that causes a method to operate only on elements for which the current selector (if present) and the given selector returns true

ParallelDoubleArrayWithFilter withFilter(BinaryDoublePredicate selector, ParallelDoubleArrayWithDoubleMapping other)

Returns an operation prefix that causes a method to operate only on elements for which the current selector (if present) and the given binary selector returns true

ParallelDoubleArrayWithFilter withIndexedFilter(IntAndDoublePredicate selector)

Returns an operation prefix that causes a method to operate only on elements for which the current selector (if present) and the given indexed selector returns true

 
Methods inherited from class ParallelDoubleArrayWithDoubleMapping
all, apply, max, max, min, min, reduce, sequentially, sum, summary, summary, withIndexedMapping, withIndexedMapping, withIndexedMapping, withMapping, withMapping, withMapping, withMapping, withMapping, withMapping, withMapping, withMapping, withMapping, withMapping, withMapping, withMapping
 

Constructor Detail

ParallelDoubleArrayWithFilter

ParallelDoubleArrayWithFilter(ForkJoinPool ex, int origin, int fence, double[] array)


 
Method Detail

allUniqueElements

public ParallelDoubleArray allUniqueElements()
Returns a new ParallelDoubleArray containing only unique elements (that is, without any duplicates).
Returns:
the new ParallelDoubleArray


dget

final double dget(int i)


hasAllEqualElements

public boolean hasAllEqualElements(ParallelDoubleArrayWithDoubleMapping other)
Returns true if all elements at the same relative positions of this and other array are equal.
Parameters:
other - the other array
Returns:
true if equal


leafTransfer

final void leafTransfer(int lo, int hi, double[] dest, int offset)


leafTransferByIndex

final void leafTransferByIndex(int[] indices, int loIdx, int hiIdx, double[] dest, int offset)


replaceWithGeneratedValue

public ParallelDoubleArrayWithFilter replaceWithGeneratedValue(DoubleGenerator generator)
Replaces elements with results of applying the given generator.
Parameters:
generator - the generator
Returns:
this (to simplify use in expressions)


replaceWithMappedIndex

public ParallelDoubleArrayWithFilter replaceWithMappedIndex(IntToDouble op)
Replaces elements with the results of applying the given op to their indices
Parameters:
op - the op
Returns:
this (to simplify use in expressions)


replaceWithMappedIndex

public ParallelDoubleArrayWithFilter replaceWithMappedIndex(IntAndDoubleToDouble op)
Replaces elements with the results of applying the given mapping to each index and current element value
Parameters:
op - the op
Returns:
this (to simplify use in expressions)


replaceWithMapping

public ParallelDoubleArrayWithFilter replaceWithMapping(DoubleOp op)
Replaces elements with the results of applying the given op to their current values.
Parameters:
op - the op
Returns:
this (to simplify use in expressions)


replaceWithMapping

public ParallelDoubleArrayWithFilter replaceWithMapping(BinaryDoubleOp combiner, ParallelDoubleArrayWithDoubleMapping other)
Replaces elements with results of applying op(thisElement, otherElement)
Parameters:
other - the other array
combiner - the combiner
Returns:
this (to simplify use in expressions)


replaceWithMapping

public ParallelDoubleArrayWithFilter replaceWithMapping(BinaryDoubleOp combiner, double[] other)
Replaces elements with results of applying op(thisElement, otherElement)
Parameters:
other - the other array
combiner - the combiner
Returns:
this (to simplify use in expressions)


replaceWithValue

public ParallelDoubleArrayWithFilter replaceWithValue(double value)
Replaces elements with the given value.
Parameters:
value - the value
Returns:
this (to simplify use in expressions)


withFilter

public ParallelDoubleArrayWithFilter withFilter(DoublePredicate selector)
Returns an operation prefix that causes a method to operate only on elements for which the current selector (if present) and the given selector returns true
Parameters:
selector - the selector
Returns:
operation prefix


withFilter

public ParallelDoubleArrayWithFilter withFilter(BinaryDoublePredicate selector, ParallelDoubleArrayWithDoubleMapping other)
Returns an operation prefix that causes a method to operate only on elements for which the current selector (if present) and the given binary selector returns true
Parameters:
selector - the selector
Returns:
operation prefix


withIndexedFilter

public ParallelDoubleArrayWithFilter withIndexedFilter(IntAndDoublePredicate selector)
Returns an operation prefix that causes a method to operate only on elements for which the current selector (if present) and the given indexed selector returns true
Parameters:
selector - the selector
Returns:
operation prefix


 

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