|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object DPJRuntime.DPJPartitionDouble<region R>
T
- The type of an element of an array in the partitionR
- The region of a cell of an array in the partitionpublic class DPJPartitionDouble<region R>
The DPJPartition
class, specialized to double
.
The DPJPartitionDouble
class represents an array of DPJArrayDouble
objects that partition another DPJArrayDouble
(called
the root array). Each DPJArrayDouble
in the partition is
a contiguous subsection of the root array, and all are mutually
disjoint. The DPJArrayDouble
s in the partition are called
segments of the root array.
For example, if the root array has index space [0,10]
,
then a partition might have segments with index spaces [0,5]
and [6,10]
.
Field Summary | |
---|---|
int |
length
Number of segments in the partition |
Constructor Summary | |
---|---|
DPJPartitionDouble(DPJArrayDouble<R> A,
int idx)
Partitions an array A into two segments at index idx . |
|
DPJPartitionDouble(DPJArrayDouble<R> A,
int[]<RI> idxs)
Partitions an array A into
idxs.length+1 segments using the indices in
idxs as the split points. |
|
DPJPartitionDouble(DPJArrayDouble<R> A,
int idx,
boolean exclude)
Partitions an array A into two segments at idx ,
optionally excluding the element at idx . |
Method Summary | ||
---|---|---|
DPJArrayDouble<this : [idx] : *> |
get(int idx)
Returns segment idx of the partition. |
|
static
|
stridedPartition(DPJArrayDouble<R> A,
int stride)
Creates a partition using stride stride . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public final int length
Constructor Detail |
---|
public DPJPartitionDouble(DPJArrayDouble<R> A, int idx) writes this : [?]
A
into two segments at index idx
. If A
has n
elements, then the first
segment consists of elements 0
through idx-1
,
and the second segment consists of elements idx
through
n-1
.
Throws ArrayIndexOutOfBoundsException
if
idx
is not in [0,n-1]
.
A
- The array to partitionidx
- The partition indexpublic DPJPartitionDouble(DPJArrayDouble<R> A, int idx, boolean exclude) writes this : [?]
A
into two segments at idx
,
optionally excluding the element at idx
. If A
has n
elements, then the first segment is always [0,idx-1]
. The second segment is either [idx,n-1]
(if
exclude
is false) or [idx+1,n-1]
(if exclude
is true).
Throws ArrayIndexOutOfBoundsException
if
idx
is not in [0,n-1]
.
A
- The array to partitionidx
- The partition indexexclude
- Whether to exclude the element at
idx
from the segmentspublic <region RI> DPJPartitionDouble(DPJArrayDouble<R> A, int[]<RI> idxs) reads RI writes this : [?]
A
into
idxs.length+1
segments using the indices in
idxs
as the split points. If A
has
index space [0,n-1]
, then the segments are
[0,idxs[0]-1]
, [idxs[0],idxs[1]-1]
,
..., [idxs[idxs.length-1]-1,n-1]
.
Throws ArrayOutOfBoundsException
if the indices
are not monotonically increasing, or if any index is out of
bounds for A
.
RI
- The region of array idxs
A
- The array to partitionidxs
- The split pointsMethod Detail |
---|
public static <region R> DPJPartitionDouble<R> stridedPartition(DPJArrayDouble<R> A, int stride) pure
stride
. For example,
partitioning a 10-element array with stride 2 creates a
partition with 5 segments, each of length 2.
T
- The type of the array to partitionR
- The region of the array to partitionA
- The array to partitionstride
- The stride at which to partition
A
with stride stride
public DPJArrayDouble<this : [idx] : *> get(int idx) reads this : [idx]
idx
of the partition.
Throws ArrayIndexOutOfBoundsException
if idx
is not a valid segment index.
idx
- Index of the segment to get
idx
of the partition
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |