public class LongTupleCollections extends Object
LongTuple
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 MutableLongTuple |
add(Collection<? extends LongTuple> tuples,
MutableLongTuple result)
Computes the component-wise sum of the given collection
of tuples.
|
static List<MutableLongTuple> |
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 MutableLongTuple> 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<MutableLongTuple> |
deepCopy(Collection<? extends LongTuple> tuples)
Returns a deep copy of the given collection of tuples.
|
static MutableLongTuple |
max(Collection<? extends LongTuple> tuples,
MutableLongTuple result)
Computes the component-wise maximum of the given collection
of tuples.
|
static MutableLongTuple |
min(Collection<? extends LongTuple> tuples,
MutableLongTuple result)
Computes the component-wise minimum of the given collection
of tuples.
|
public static void create(int dimensions,
int numElements,
Collection<? super MutableLongTuple> 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<MutableLongTuple> 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<MutableLongTuple> deepCopy(Collection<? extends LongTuple> tuples)
null, then null
will also be added to the target collection.tuples - The input tuplespublic static MutableLongTuple min(Collection<? extends LongTuple> tuples, MutableLongTuple 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 Long.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 MutableLongTuple max(Collection<? extends LongTuple> tuples, MutableLongTuple 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 Long.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 MutableLongTuple add(Collection<? extends LongTuple> tuples, MutableLongTuple 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.