groovyx.gpars.extra166y
Class ParallelDoubleArrayWithBounds

java.lang.Object
  extended by groovyx.gpars.extra166y.AbstractParallelAnyArray
      extended by groovyx.gpars.extra166y.AbstractParallelAnyArray.DPap
          extended by groovyx.gpars.extra166y.ParallelDoubleArrayWithDoubleMapping
              extended by groovyx.gpars.extra166y.ParallelDoubleArrayWithFilter
                  extended by groovyx.gpars.extra166y.ParallelDoubleArrayWithBounds
Direct Known Subclasses:
AbstractParallelAnyArray.DUPap

public abstract class ParallelDoubleArrayWithBounds
extends ParallelDoubleArrayWithFilter

A prefix view of ParallelDoubleArray that causes operations to apply only to elements within a given range. Instances of this class may be constructed only via prefix methods of ParallelDoubleArray or its other prefix classes.


Nested Class Summary
 
Nested classes/interfaces inherited from class groovyx.gpars.extra166y.AbstractParallelAnyArray
AbstractParallelAnyArray.AndPredicate<T>, AbstractParallelAnyArray.DDCPap, AbstractParallelAnyArray.DDMPap, AbstractParallelAnyArray.DFDCPap, AbstractParallelAnyArray.DFDMPap, AbstractParallelAnyArray.DFLCPap, AbstractParallelAnyArray.DFLMPap, AbstractParallelAnyArray.DFOCPap<U>, AbstractParallelAnyArray.DFOMPap<U>, AbstractParallelAnyArray.DFPap, AbstractParallelAnyArray.DLCPap, AbstractParallelAnyArray.DLMPap, AbstractParallelAnyArray.DOCPap<U>, AbstractParallelAnyArray.DOMPap<U>, AbstractParallelAnyArray.DPap, AbstractParallelAnyArray.DRDCPap, AbstractParallelAnyArray.DRDMPap, AbstractParallelAnyArray.DRLCPap, AbstractParallelAnyArray.DRLMPap, AbstractParallelAnyArray.DROCPap<U>, AbstractParallelAnyArray.DROMPap<U>, AbstractParallelAnyArray.DRPap, AbstractParallelAnyArray.DUDCPap, AbstractParallelAnyArray.DUDMPap, AbstractParallelAnyArray.DULCPap, AbstractParallelAnyArray.DULMPap, AbstractParallelAnyArray.DUOCPap<U>, AbstractParallelAnyArray.DUOMPap<U>, AbstractParallelAnyArray.DUPap, AbstractParallelAnyArray.FilteredAsDoubleIterator, AbstractParallelAnyArray.FilteredAsLongIterator, AbstractParallelAnyArray.FilteredIterator<U>, AbstractParallelAnyArray.LDCPap, AbstractParallelAnyArray.LDMPap, AbstractParallelAnyArray.LFDCPap, AbstractParallelAnyArray.LFDMPap, AbstractParallelAnyArray.LFLCPap, AbstractParallelAnyArray.LFLMPap, AbstractParallelAnyArray.LFOCPap<U>, AbstractParallelAnyArray.LFOMPap<U>, AbstractParallelAnyArray.LFPap, AbstractParallelAnyArray.LLCPap, AbstractParallelAnyArray.LLMPap, AbstractParallelAnyArray.LOCPap<U>, AbstractParallelAnyArray.LOMPap<U>, AbstractParallelAnyArray.LPap, AbstractParallelAnyArray.LRDCPap, AbstractParallelAnyArray.LRDMPap, AbstractParallelAnyArray.LRLCPap, AbstractParallelAnyArray.LRLMPap, AbstractParallelAnyArray.LROCPap<U>, AbstractParallelAnyArray.LROMPap<U>, AbstractParallelAnyArray.LRPap, AbstractParallelAnyArray.LUDCPap, AbstractParallelAnyArray.LUDMPap, AbstractParallelAnyArray.LULCPap, AbstractParallelAnyArray.LULMPap, AbstractParallelAnyArray.LUOCPap<U>, AbstractParallelAnyArray.LUOMPap<U>, AbstractParallelAnyArray.LUPap, AbstractParallelAnyArray.ODCPap<T>, AbstractParallelAnyArray.ODMPap<T>, AbstractParallelAnyArray.OFDCPap<T>, AbstractParallelAnyArray.OFDMPap<T>, AbstractParallelAnyArray.OFLCPap<T>, AbstractParallelAnyArray.OFLMPap<T>, AbstractParallelAnyArray.OFOCPap<T,U>, AbstractParallelAnyArray.OFOMPap<T,U>, AbstractParallelAnyArray.OFPap<T>, AbstractParallelAnyArray.OLCPap<T>, AbstractParallelAnyArray.OLMPap<T>, AbstractParallelAnyArray.OOCPap<T,U>, AbstractParallelAnyArray.OOMPap<T,U>, AbstractParallelAnyArray.OPap<T>, AbstractParallelAnyArray.ORDCPap<T>, AbstractParallelAnyArray.ORDMPap<T>, AbstractParallelAnyArray.ORLCPap<T>, AbstractParallelAnyArray.ORLMPap<T>, AbstractParallelAnyArray.OROCPap<T,U>, AbstractParallelAnyArray.OROMPap<T,U>, AbstractParallelAnyArray.ORPap<T>, AbstractParallelAnyArray.OUDCPap<T>, AbstractParallelAnyArray.OUDMPap<T>, AbstractParallelAnyArray.OULCPap<T>, AbstractParallelAnyArray.OULMPap<T>, AbstractParallelAnyArray.OUOCPap<T,U>, AbstractParallelAnyArray.OUOMPap<T,U>, AbstractParallelAnyArray.OUPap<T>, AbstractParallelAnyArray.Sequentially<U>, AbstractParallelAnyArray.SequentiallyAsDouble, AbstractParallelAnyArray.SequentiallyAsLong, AbstractParallelAnyArray.UnfilteredAsDoubleIterator, AbstractParallelAnyArray.UnfilteredAsLongIterator, AbstractParallelAnyArray.UnfilteredIterator<U>
 
Field Summary
 
Fields inherited from class groovyx.gpars.extra166y.AbstractParallelAnyArray.DPap
array
 
Fields inherited from class groovyx.gpars.extra166y.AbstractParallelAnyArray
ex, fence, origin, threshold
 
Constructor Summary
ParallelDoubleArrayWithBounds(jsr166y.ForkJoinPool ex, int origin, int fence, double[] array)
           
 
Method Summary
abstract  int binarySearch(double target)
          Assuming this array is sorted, returns the index of an element equal to given target, or -1 if not present.
abstract  int binarySearch(double target, Ops.DoubleComparator comparator)
          Assuming this array is sorted with respect to the given comparator, returns the index of an element equal to given target, or -1 if not present.
abstract  ParallelDoubleArrayWithBounds cumulate(Ops.DoubleReducer reducer, double base)
          Replaces each element with the running cumulation of applying the given reducer.
abstract  ParallelDoubleArrayWithBounds cumulateSum()
          Replaces each element with the running sum
abstract  int indexOf(double target)
          Returns the index of some element equal to given target, or -1 if not present
abstract  double precumulate(Ops.DoubleReducer reducer, double base)
          Replaces each element with the cumulation of applying the given reducer to all previous values, and returns the total reduction.
abstract  double precumulateSum()
          Replaces each element with its prefix sum
abstract  ParallelDoubleArrayWithBounds sort()
          Sorts the elements, assuming all elements are Comparable.
abstract  ParallelDoubleArrayWithBounds sort(Ops.DoubleComparator cmp)
          Sorts the elements.
abstract  ParallelDoubleArrayWithBounds withBounds(int firstIndex, int upperBound)
          Returns an operation prefix that causes a method to operate only on the elements of the array between firstIndex (inclusive) and upperBound (exclusive).
 
Methods inherited from class groovyx.gpars.extra166y.ParallelDoubleArrayWithFilter
allUniqueElements, dget, hasAllEqualElements, leafTransfer, leafTransferByIndex, replaceWithGeneratedValue, replaceWithMappedIndex, replaceWithMappedIndex, replaceWithMapping, replaceWithMapping, replaceWithMapping, replaceWithValue, withFilter, withFilter, withIndexedFilter
 
Methods inherited from class groovyx.gpars.extra166y.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
 
Methods inherited from class groovyx.gpars.extra166y.AbstractParallelAnyArray.DPap
dgetArray, leafMoveByIndex, leafMoveSelected, lget, oget
 
Methods inherited from class groovyx.gpars.extra166y.AbstractParallelAnyArray
allDoubles, allLongs, allObjects, anyIndex, boundsCheck, compoundIndexedOp, compoundIndexedOp, compoundIndexedOp, compoundIndexedOp, compoundIndexedOp, compoundIndexedOp, compoundIndexedOp, compoundIndexedOp, compoundIndexedOp, compoundIndexedOp, compoundIndexedOp, compoundIndexedOp, compoundIndexedOp, compoundIndexedOp, compoundIndexedOp, compoundIndexedOp, compoundIndexedOp, compoundIndexedOp, compoundIndexedOp, compoundIndexedOp, compoundIndexedOp, compoundIndexedOp, compoundIndexedOp, compoundIndexedOp, compoundIndexedOp, compoundIndexedOp, compoundIndexedOp, compoundIndexedOp, compoundIndexedOp, compoundIndexedOp, compoundIndexedOp, compoundIndexedOp, compoundIndexedOp, compoundIndexedOp, compoundIndexedOp, compoundIndexedOp, compoundIndexedOp, compoundIndexedOp, compoundIndexedOp, compoundIndexedOp, compoundIndexedOp, compoundIndexedOp, compoundIndexedOp, compoundIndexedOp, compoundIndexedOp, compoundIndexedOp, compoundIndexedOp, compoundIndexedOp, compoundIndexedOp, compoundIndexedOp, compoundIndexedOp, compoundIndexedOp, compoundIndexedOp, compoundIndexedOp, compoundIndexedOp, compoundIndexedOp, compoundIndexedOp, compoundIndexedOp, compoundIndexedOp, compoundIndexedOp, compoundIndexedOp, compoundIndexedOp, compoundIndexedOp, compoundIndexedOp, compoundIndexedOp, compoundIndexedOp, compoundIndexedOp, compoundIndexedOp, compoundIndexedOp, compoundIndexedOp, compoundIndexedOp, compoundIndexedOp, compoundIndexedOp, compoundIndexedOp, compoundIndexedOp, compoundIndexedOp, compoundIndexedOp, compoundIndexedOp, compoundIndexedOp, compoundIndexedOp, compoundIndexedOp, compoundIndexedSelector, compoundIndexedSelector, compoundIndexedSelector, compoundIndexedSelector, compoundIndexedSelector, compoundIndexedSelector, compoundIndexedSelector, compoundIndexedSelector, compoundIndexedSelector, computeThreshold, getThreshold, hasFilter, hasMap, indexedMapper, indexedMapper, indexedMapper, indexedMapper, indexedMapper, indexedMapper, indexedMapper, indexedMapper, indexedMapper, indexedMapper, indexedMapper, indexedMapper, indexedMapper, indexedMapper, indexedMapper, indexedMapper, indexedMapper, indexedMapper, indexedMapper, indexedMapper, indexedMapper, indexedMapper, indexedMapper, indexedMapper, indexedMapper, indexedMapper, indexedMapper, indexedSelector, indexedSelector, indexedSelector, isEmpty, isSelected, leafApply, leafApply, leafApply, leafBinaryIndexMap, leafBinaryIndexMap, leafBinaryIndexMap, leafCombineInPlace, leafCombineInPlace, leafCombineInPlace, leafCombineInPlace, leafCombineInPlace, leafCombineInPlace, leafFill, leafFill, leafFill, leafGenerate, leafGenerate, leafGenerate, leafIndexMap, leafIndexMap, leafIndexMap, leafIndexSelected, leafReduce, leafReduce, leafReduce, leafTransfer, leafTransfer, leafTransferByIndex, leafTransferByIndex, leafTransform, leafTransform, leafTransform, lgetArray, ogetArray, size
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ParallelDoubleArrayWithBounds

ParallelDoubleArrayWithBounds(jsr166y.ForkJoinPool ex,
                              int origin,
                              int fence,
                              double[] array)
Method Detail

withBounds

public abstract ParallelDoubleArrayWithBounds withBounds(int firstIndex,
                                                         int upperBound)
Returns an operation prefix that causes a method to operate only on the elements of the array between firstIndex (inclusive) and upperBound (exclusive). The bound arguments are relative to the current bounds. For example pa.withBounds(2, 8).withBounds(3, 5) indexes the 5th (= 2+3) and 6th elements of pa. However, indices returned by methods such as indexOf are with respect to the underlying ParallelDoubleArray.

Parameters:
firstIndex - the lower bound (inclusive)
upperBound - the upper bound (exclusive)
Returns:
operation prefix

indexOf

public abstract int indexOf(double target)
Returns the index of some element equal to given target, or -1 if not present

Parameters:
target - the element to search for
Returns:
the index or -1 if not present

binarySearch

public abstract int binarySearch(double target)
Assuming this array is sorted, returns the index of an element equal to given target, or -1 if not present. If the array is not sorted, the results are undefined.

Parameters:
target - the element to search for
Returns:
the index or -1 if not present

binarySearch

public abstract int binarySearch(double target,
                                 Ops.DoubleComparator comparator)
Assuming this array is sorted with respect to the given comparator, returns the index of an element equal to given target, or -1 if not present. If the array is not sorted, the results are undefined.

Parameters:
target - the element to search for
comparator - the comparator
Returns:
the index or -1 if not present

cumulate

public abstract ParallelDoubleArrayWithBounds cumulate(Ops.DoubleReducer reducer,
                                                       double base)
Replaces each element with the running cumulation of applying the given reducer.

Parameters:
reducer - the reducer
base - the result for an empty array
Returns:
this (to simplify use in expressions)

cumulateSum

public abstract ParallelDoubleArrayWithBounds cumulateSum()
Replaces each element with the running sum

Returns:
this (to simplify use in expressions)

precumulate

public abstract double precumulate(Ops.DoubleReducer reducer,
                                   double base)
Replaces each element with the cumulation of applying the given reducer to all previous values, and returns the total reduction.

Parameters:
reducer - the reducer
base - the result for an empty array
Returns:
the total reduction

precumulateSum

public abstract double precumulateSum()
Replaces each element with its prefix sum

Returns:
the total sum

sort

public abstract ParallelDoubleArrayWithBounds sort(Ops.DoubleComparator cmp)
Sorts the elements. Unlike Arrays.sort, this sort does not guarantee that elements with equal keys maintain their relative position in the array.

Parameters:
cmp - the comparator to use
Returns:
this (to simplify use in expressions)

sort

public abstract ParallelDoubleArrayWithBounds sort()
Sorts the elements, assuming all elements are Comparable. Unlike Arrays.sort, this sort does not guarantee that elements with equal keys maintain their relative position in the array.

Returns:
this (to simplify use in expressions)
Throws:
java.lang.ClassCastException - if any element is not Comparable.

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