groovyx.gpars.extra166y
Class AbstractParallelAnyArray.OUPap<T>

java.lang.Object
  extended by groovyx.gpars.extra166y.AbstractParallelAnyArray
      extended by groovyx.gpars.extra166y.AbstractParallelAnyArray.OPap<T>
          extended by groovyx.gpars.extra166y.ParallelArrayWithMapping<T,T>
              extended by groovyx.gpars.extra166y.ParallelArrayWithFilter<T>
                  extended by groovyx.gpars.extra166y.ParallelArrayWithBounds<T>
                      extended by groovyx.gpars.extra166y.AbstractParallelAnyArray.OUPap<T>
Direct Known Subclasses:
ParallelArray
Enclosing class:
AbstractParallelAnyArray

static class AbstractParallelAnyArray.OUPap<T>
extends ParallelArrayWithBounds<T>


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.OPap
array
 
Fields inherited from class groovyx.gpars.extra166y.AbstractParallelAnyArray
ex, fence, origin, threshold
 
Constructor Summary
AbstractParallelAnyArray.OUPap(jsr166y.ForkJoinPool ex, int origin, int fence, T[] array)
           
 
Method Summary
 int binarySearch(T target)
          Assuming this array is sorted, returns the index of an element equal to given target, or -1 if not present.
 int binarySearch(T target, java.util.Comparator<? super T> 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.
 ParallelArrayWithBounds<T> cumulate(Ops.Reducer<T> reducer, T base)
          Replaces each element with the running cumulation of applying the given reducer.
 int indexOf(T target)
          Returns the index of some element equal to given target, or -1 if not present
(package private)  void leafApply(int lo, int hi, Ops.Procedure procedure)
           
(package private)  void leafBinaryIndexMap(int l, int h, Ops.IntAndObjectToObject op)
           
(package private)  void leafCombineInPlace(int l, int h, java.lang.Object[] other, int otherOffset, Ops.BinaryOp combiner)
           
(package private)  void leafCombineInPlace(int l, int h, ParallelArrayWithMapping other, int otherOffset, Ops.BinaryOp combiner)
           
(package private)  void leafFill(int l, int h, java.lang.Object value)
           
(package private)  void leafGenerate(int l, int h, Ops.Generator generator)
           
(package private)  void leafIndexMap(int l, int h, Ops.IntToObject op)
           
(package private)  java.lang.Object leafReduce(int lo, int hi, Ops.Reducer reducer, java.lang.Object base)
           
(package private)  void leafTransform(int l, int h, Ops.Op op)
           
 T precumulate(Ops.Reducer<T> reducer, T base)
          Replaces each element with the cumulation of applying the given reducer to all previous values, and returns the total reduction.
 ParallelArrayWithBounds<T> sort()
          Sorts the elements, assuming all elements are Comparable.
 ParallelArrayWithBounds<T> sort(java.util.Comparator<? super T> cmp)
          Sorts the elements.
 ParallelArrayWithBounds<T> withBounds(int lo, int hi)
          Returns an operation prefix that causes a method to operate only on the elements of the array between firstIndex (inclusive) and upperBound (exclusive).
 ParallelArrayWithFilter<T> withFilter(Ops.Predicate<? super T> 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
 ParallelArrayWithFilter<T> withIndexedFilter(Ops.IntAndObjectPredicate<? super T> 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
 ParallelArrayWithDoubleMapping<T> withIndexedMapping(Ops.IntAndObjectToDouble<? super T> 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<T> withIndexedMapping(Ops.IntAndObjectToLong<? super T> 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.
<V> ParallelArrayWithMapping<T,V>
withIndexedMapping(Ops.IntAndObjectToObject<? super T,? 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.
 ParallelArrayWithDoubleMapping<T> withMapping(Ops.ObjectToDouble<? super T> op)
          Returns an operation prefix that causes a method to operate on mapped elements of the array using the given op applied to current op's results
 ParallelArrayWithLongMapping<T> withMapping(Ops.ObjectToLong<? super T> op)
          Returns an operation prefix that causes a method to operate on mapped elements of the array using the given op applied to current op's results
<U> ParallelArrayWithMapping<T,U>
withMapping(Ops.Op<? super T,? extends U> op)
          Returns an operation prefix that causes a method to operate on mapped elements of the array using the given op applied to current op's results
 
Methods inherited from class groovyx.gpars.extra166y.ParallelArrayWithFilter
allNonidenticalElements, allUniqueElements, hasAllEqualElements, hasAllIdenticalElements, leafTransfer, leafTransferByIndex, oget, replaceWithGeneratedValue, replaceWithMappedIndex, replaceWithMappedIndex, replaceWithMapping, replaceWithMapping, replaceWithMapping, replaceWithValue, withFilter
 
Methods inherited from class groovyx.gpars.extra166y.ParallelArrayWithMapping
all, all, any, apply, max, max, min, min, reduce, sequentially, summary, summary, withMapping, withMapping, withMapping, withMapping, withMapping, withMapping, withMapping, withMapping, withMapping
 
Methods inherited from class groovyx.gpars.extra166y.AbstractParallelAnyArray.OPap
dget, leafMoveByIndex, leafMoveSelected, lget, ogetArray
 
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, dgetArray, 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, leafBinaryIndexMap, leafBinaryIndexMap, leafCombineInPlace, leafCombineInPlace, leafCombineInPlace, leafCombineInPlace, leafFill, leafFill, leafGenerate, leafGenerate, leafIndexMap, leafIndexMap, leafIndexSelected, leafReduce, leafReduce, leafTransfer, leafTransfer, leafTransferByIndex, leafTransferByIndex, leafTransform, leafTransform, lgetArray, size
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractParallelAnyArray.OUPap

AbstractParallelAnyArray.OUPap(jsr166y.ForkJoinPool ex,
                               int origin,
                               int fence,
                               T[] array)
Method Detail

withBounds

public ParallelArrayWithBounds<T> withBounds(int lo,
                                             int hi)
Description copied from class: ParallelArrayWithBounds
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 ParallelArray.

Specified by:
withBounds in class ParallelArrayWithBounds<T>
Parameters:
lo - the lower bound (inclusive)
hi - the upper bound (exclusive)
Returns:
operation prefix

withFilter

public ParallelArrayWithFilter<T> withFilter(Ops.Predicate<? super T> selector)
Description copied from class: ParallelArrayWithFilter
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

Specified by:
withFilter in class ParallelArrayWithFilter<T>
Parameters:
selector - the selector
Returns:
operation prefix

withIndexedFilter

public ParallelArrayWithFilter<T> withIndexedFilter(Ops.IntAndObjectPredicate<? super T> selector)
Description copied from class: ParallelArrayWithFilter
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

Specified by:
withIndexedFilter in class ParallelArrayWithFilter<T>
Parameters:
selector - the selector
Returns:
operation prefix

withMapping

public <U> ParallelArrayWithMapping<T,U> withMapping(Ops.Op<? super T,? extends U> op)
Description copied from class: ParallelArrayWithMapping
Returns an operation prefix that causes a method to operate on mapped elements of the array using the given op applied to current op's results

Specified by:
withMapping in class ParallelArrayWithMapping<T,T>
Parameters:
op - the op
Returns:
operation prefix

withMapping

public ParallelArrayWithDoubleMapping<T> withMapping(Ops.ObjectToDouble<? super T> op)
Description copied from class: ParallelArrayWithMapping
Returns an operation prefix that causes a method to operate on mapped elements of the array using the given op applied to current op's results

Specified by:
withMapping in class ParallelArrayWithMapping<T,T>
Parameters:
op - the op
Returns:
operation prefix

withMapping

public ParallelArrayWithLongMapping<T> withMapping(Ops.ObjectToLong<? super T> op)
Description copied from class: ParallelArrayWithMapping
Returns an operation prefix that causes a method to operate on mapped elements of the array using the given op applied to current op's results

Specified by:
withMapping in class ParallelArrayWithMapping<T,T>
Parameters:
op - the op
Returns:
operation prefix

withIndexedMapping

public <V> ParallelArrayWithMapping<T,V> withIndexedMapping(Ops.IntAndObjectToObject<? super T,? extends V> mapper)
Description copied from class: ParallelArrayWithMapping
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.

Specified by:
withIndexedMapping in class ParallelArrayWithMapping<T,T>
Parameters:
mapper - the mapper
Returns:
operation prefix

withIndexedMapping

public ParallelArrayWithDoubleMapping<T> withIndexedMapping(Ops.IntAndObjectToDouble<? super T> mapper)
Description copied from class: ParallelArrayWithMapping
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.

Specified by:
withIndexedMapping in class ParallelArrayWithMapping<T,T>
Parameters:
mapper - the mapper
Returns:
operation prefix

withIndexedMapping

public ParallelArrayWithLongMapping<T> withIndexedMapping(Ops.IntAndObjectToLong<? super T> mapper)
Description copied from class: ParallelArrayWithMapping
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.

Specified by:
withIndexedMapping in class ParallelArrayWithMapping<T,T>
Parameters:
mapper - the mapper
Returns:
operation prefix

indexOf

public int indexOf(T target)
Description copied from class: ParallelArrayWithBounds
Returns the index of some element equal to given target, or -1 if not present

Specified by:
indexOf in class ParallelArrayWithBounds<T>
Parameters:
target - the element to search for
Returns:
the index or -1 if not present

binarySearch

public int binarySearch(T target)
Description copied from class: ParallelArrayWithBounds
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.

Specified by:
binarySearch in class ParallelArrayWithBounds<T>
Parameters:
target - the element to search for
Returns:
the index or -1 if not present

binarySearch

public int binarySearch(T target,
                        java.util.Comparator<? super T> comparator)
Description copied from class: ParallelArrayWithBounds
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.

Specified by:
binarySearch in class ParallelArrayWithBounds<T>
Parameters:
target - the element to search for
comparator - the comparator
Returns:
the index or -1 if not present

cumulate

public ParallelArrayWithBounds<T> cumulate(Ops.Reducer<T> reducer,
                                           T base)
Description copied from class: ParallelArrayWithBounds
Replaces each element with the running cumulation of applying the given reducer.

Specified by:
cumulate in class ParallelArrayWithBounds<T>
Parameters:
reducer - the reducer
base - the result for an empty array
Returns:
this (to simplify use in expressions)

precumulate

public T precumulate(Ops.Reducer<T> reducer,
                     T base)
Description copied from class: ParallelArrayWithBounds
Replaces each element with the cumulation of applying the given reducer to all previous values, and returns the total reduction.

Specified by:
precumulate in class ParallelArrayWithBounds<T>
Parameters:
reducer - the reducer
base - the result for an empty array
Returns:
the total reduction

sort

public ParallelArrayWithBounds<T> sort(java.util.Comparator<? super T> cmp)
Description copied from class: ParallelArrayWithBounds
Sorts the elements. Unlike Arrays.sort, this sort does not guarantee that elements with equal keys maintain their relative position in the array.

Specified by:
sort in class ParallelArrayWithBounds<T>
Parameters:
cmp - the comparator to use
Returns:
this (to simplify use in expressions)

sort

public ParallelArrayWithBounds<T> sort()
Description copied from class: ParallelArrayWithBounds
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.

Specified by:
sort in class ParallelArrayWithBounds<T>
Returns:
this (to simplify use in expressions)

leafApply

final void leafApply(int lo,
                     int hi,
                     Ops.Procedure procedure)
Overrides:
leafApply in class AbstractParallelAnyArray

leafReduce

final java.lang.Object leafReduce(int lo,
                                  int hi,
                                  Ops.Reducer reducer,
                                  java.lang.Object base)
Overrides:
leafReduce in class AbstractParallelAnyArray

leafTransform

final void leafTransform(int l,
                         int h,
                         Ops.Op op)
Overrides:
leafTransform in class AbstractParallelAnyArray

leafIndexMap

final void leafIndexMap(int l,
                        int h,
                        Ops.IntToObject op)
Overrides:
leafIndexMap in class AbstractParallelAnyArray

leafBinaryIndexMap

final void leafBinaryIndexMap(int l,
                              int h,
                              Ops.IntAndObjectToObject op)
Overrides:
leafBinaryIndexMap in class AbstractParallelAnyArray

leafGenerate

final void leafGenerate(int l,
                        int h,
                        Ops.Generator generator)
Overrides:
leafGenerate in class AbstractParallelAnyArray

leafFill

final void leafFill(int l,
                    int h,
                    java.lang.Object value)
Overrides:
leafFill in class AbstractParallelAnyArray

leafCombineInPlace

final void leafCombineInPlace(int l,
                              int h,
                              java.lang.Object[] other,
                              int otherOffset,
                              Ops.BinaryOp combiner)
Overrides:
leafCombineInPlace in class AbstractParallelAnyArray

leafCombineInPlace

final void leafCombineInPlace(int l,
                              int h,
                              ParallelArrayWithMapping other,
                              int otherOffset,
                              Ops.BinaryOp combiner)
Overrides:
leafCombineInPlace in class AbstractParallelAnyArray

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