public class IntTupleCollections extends Object
IntTuple
instances.result tuple, unless otherwise noted, the behavior
is as follows:
null will
be returned
result tuple is null, then a new
tuple will be created and returned.
result tuple is not null,
then it will be verified that the result tuple has an appropriate
size for the respective operation,
and an IllegalArgumentException will be thrown if
this is not the case.
null elements, and that the size
of all tuples is the same. If this is not the case, the behavior is
unspecified (although in most cases, a NullPointerException
or an IllegalArgumentException will be thrown, respectively)| Modifier and Type | Method and Description |
|---|---|
static MutableIntTuple |
add(Collection<? extends IntTuple> tuples,
MutableIntTuple result)
Computes the component-wise sum of the given collection
of tuples.
|
static List<MutableIntTuple> |
create(int dimensions,
int numElements)
Create the specified number of tuples with the given dimensions
(
size), all initialized to zero, and
return them as a list |
static void |
create(int dimensions,
int numElements,
Collection<? super MutableIntTuple> target)
Create the specified number of tuples with the given dimensions
(
size), all initialized to zero, and place
them into the given target collection |
static List<MutableIntTuple> |
deepCopy(Collection<? extends IntTuple> tuples)
Returns a deep copy of the given collection of tuples.
|
static MutableIntTuple |
max(Collection<? extends IntTuple> tuples,
MutableIntTuple result)
Computes the component-wise maximum of the given collection
of tuples.
|
static MutableIntTuple |
min(Collection<? extends IntTuple> tuples,
MutableIntTuple result)
Computes the component-wise minimum of the given collection
of tuples.
|
public static void create(int dimensions,
int numElements,
Collection<? super MutableIntTuple> target)
size), all initialized to zero, and place
them into the given target collectiondimensions - The dimensions (size)
of the tuples to createnumElements - The number of tuples to createtarget - The target collectionIllegalArgumentException - If the given dimensions are negativepublic static List<MutableIntTuple> create(int dimensions, int numElements)
size), all initialized to zero, and
return them as a listdimensions - The dimensions (size)
of the tuples to createnumElements - The number of tuples to createIllegalArgumentException - If the given dimensions are negativepublic static List<MutableIntTuple> deepCopy(Collection<? extends IntTuple> tuples)
null, then null
will also be added to the target collection.tuples - The input tuplespublic static MutableIntTuple min(Collection<? extends IntTuple> tuples, MutableIntTuple result)
null, then a new tuple with the same
size as the first tuple of the collection
will be created internally. All elements of this tuple will
be initialized with Integer.MAX_VALUE.
tuples - The input tuplesresult - The result tuplenull if the given collection is emptyIllegalArgumentException - If the given result is not
null, and has a size
that is different from that of the input tuples.public static MutableIntTuple max(Collection<? extends IntTuple> tuples, MutableIntTuple result)
null, then a new tuple with the same
size as the first tuple of the collection
will be created internally. All elements of this tuple will
be initialized with Integer.MIN_VALUE.
tuples - The input tuplesresult - The result tuplenull if the given collection is emptyIllegalArgumentException - If the given result is not
null, and has a size
that is different from that of the input tuples.public static MutableIntTuple add(Collection<? extends IntTuple> tuples, MutableIntTuple result)
null, then a new tuple with the same
size as the first tuple of the collection
will be created internally.
tuples - The input tuplesresult - The result tuplenull if the given collection is emptyIllegalArgumentException - If the given result is not
null, and has a size
that is different from that of the input tuples.Copyright © 2015. All Rights Reserved.