public class DoubleTupleCollections extends Object
DoubleTuple
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 MutableDoubleTuple |
add(Collection<? extends DoubleTuple> tuples,
MutableDoubleTuple result)
Computes the component-wise sum of the given collection
of tuples.
|
static MutableDoubleTuple |
arithmeticMean(Collection<? extends DoubleTuple> tuples,
MutableDoubleTuple result)
Computes the component-wise arithmetic mean of the given collection
of
DoubleTuple objects. |
static List<MutableDoubleTuple> |
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 MutableDoubleTuple> 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<MutableDoubleTuple> |
deepCopy(Collection<? extends DoubleTuple> tuples)
Returns a deep copy of the given collection of tuples.
|
static MutableDoubleTuple |
max(Collection<? extends DoubleTuple> tuples,
MutableDoubleTuple result)
Computes the component-wise maximum of the given collection
of tuples.
|
static MutableDoubleTuple |
min(Collection<? extends DoubleTuple> tuples,
MutableDoubleTuple result)
Computes the component-wise minimum of the given collection
of tuples.
|
static List<MutableDoubleTuple> |
normalize(Collection<? extends DoubleTuple> inputs,
List<MutableDoubleTuple> results)
Normalize the given collection of
MutableDoubleTuples. |
static MutableDoubleTuple |
standardDeviation(Collection<? extends DoubleTuple> tuples,
MutableDoubleTuple result)
Returns the component-wise standard deviation of the given collection
of
DoubleTuple objects. |
static MutableDoubleTuple |
standardDeviationFromMean(Collection<? extends DoubleTuple> tuples,
DoubleTuple mean,
MutableDoubleTuple result)
Returns the component-wise standard deviation of the given collection
of
DoubleTuple objects. |
static List<MutableDoubleTuple> |
standardize(Collection<? extends DoubleTuple> inputs,
List<MutableDoubleTuple> results)
Standardize the given input tuples.
|
static MutableDoubleTuple |
variance(Collection<? extends DoubleTuple> tuples,
DoubleTuple mean,
MutableDoubleTuple result)
Computes the component-wise variance of the given collection
of
DoubleTuple objects. |
static MutableDoubleTuple |
variance(Collection<? extends DoubleTuple> tuples,
MutableDoubleTuple result)
Computes the component-wise variance of the given collection
of
DoubleTuple objects. |
public static void create(int dimensions,
int numElements,
Collection<? super MutableDoubleTuple> 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<MutableDoubleTuple> 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<MutableDoubleTuple> deepCopy(Collection<? extends DoubleTuple> tuples)
null, then null
will also be added to the target collection.tuples - The input tuplespublic static MutableDoubleTuple min(Collection<? extends DoubleTuple> tuples, MutableDoubleTuple 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 Double.POSITIVE_INFINITY.
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 MutableDoubleTuple max(Collection<? extends DoubleTuple> tuples, MutableDoubleTuple 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 Double.NEGATIVE_INFINITY.
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 MutableDoubleTuple add(Collection<? extends DoubleTuple> tuples, MutableDoubleTuple 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.public static List<MutableDoubleTuple> standardize(Collection<? extends DoubleTuple> inputs, List<MutableDoubleTuple> results)
null, then a new
list will be created and returned. null, then it must have the
same size as the input collection, otherwise an
IllegalArgumentException will be thrown.null elements, then a
NullPointerException will be thrown. null elements, then a
NullPointerException will be thrown. inputs - The input tuplesresults - The result tuplesIllegalArgumentException - If the result list is not
null and has a size that is different from the size
of the input collectionNullPointerException - If the inputs list is null
or contains null elements, or if the output list is
non-null and contains null elementspublic static List<MutableDoubleTuple> normalize(Collection<? extends DoubleTuple> inputs, List<MutableDoubleTuple> results)
MutableDoubleTuples.null, then a new
list will be created and returned. null, then it must have the
same size as the input collection, otherwise an
IllegalArgumentException will be thrown.null elements, then a
NullPointerException will be thrown. null elements, then a
NullPointerException will be thrown. inputs - The tuples to normalizeresults - The result tuplesIllegalArgumentException - If the result list is not
null and has a size that is different from the size
of the input collectionNullPointerException - If the inputs list is null
or contains null elements, or if the output list is
non-null and contains null elementsDoubleTuples.normalize(DoubleTuple, MutableDoubleTuple)public static MutableDoubleTuple arithmeticMean(Collection<? extends DoubleTuple> tuples, MutableDoubleTuple result)
DoubleTuple objects.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 MutableDoubleTuple variance(Collection<? extends DoubleTuple> tuples, MutableDoubleTuple result)
DoubleTuple objects. The method will compute
the arithmetic mean, and then compute the actual result
with the variance(Collection, DoubleTuple, MutableDoubleTuple)
method.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 MutableDoubleTuple variance(Collection<? extends DoubleTuple> tuples, DoubleTuple mean, MutableDoubleTuple result)
DoubleTuple objects.tuples - The input tuplesmean - The mean, which may have been computed before with
arithmeticMean(java.util.Collection<? extends de.javagl.nd.tuples.d.DoubleTuple>, de.javagl.nd.tuples.d.MutableDoubleTuple)result - 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 MutableDoubleTuple standardDeviation(Collection<? extends DoubleTuple> tuples, MutableDoubleTuple result)
DoubleTuple objects. The method will compute
the arithmetic mean, and then compute the actual result
with the standardDeviationFromMean(java.util.Collection<? extends de.javagl.nd.tuples.d.DoubleTuple>, de.javagl.nd.tuples.d.DoubleTuple, de.javagl.nd.tuples.d.MutableDoubleTuple) method.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 MutableDoubleTuple standardDeviationFromMean(Collection<? extends DoubleTuple> tuples, DoubleTuple mean, MutableDoubleTuple result)
DoubleTuple objects.
The method will compute variance(java.util.Collection<? extends de.javagl.nd.tuples.d.DoubleTuple>, de.javagl.nd.tuples.d.MutableDoubleTuple), and then compute
the actual result with the
DoubleTuples.standardDeviationFromVariance(de.javagl.nd.tuples.d.DoubleTuple, de.javagl.nd.tuples.d.MutableDoubleTuple)
method.tuples - The input tuplesmean - The mean, which may have been computed before with
arithmeticMean(java.util.Collection<? extends de.javagl.nd.tuples.d.DoubleTuple>, de.javagl.nd.tuples.d.MutableDoubleTuple)result - 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.