public class LongTuples extends Object
LongTuples.result
tuple as the last parameter. Unless otherwise noted, this tuple will be
returned by the function call. If the given result tuple is
null, then a new tuple will be created and returned.result tuple may be identical
to any of the input tuples.
null| Modifier and Type | Method and Description |
|---|---|
static MutableLongTuple |
add(LongTuple t0,
long value,
MutableLongTuple result)
Add the given value to all elements of the given input
tuples, and store the result in the given result tuple.
|
static MutableLongTuple |
add(LongTuple t0,
LongTuple t1,
MutableLongTuple result)
Add the given input tuples, and store the result in
the given result tuple.
|
static MutableLongTuple |
addScaled(LongTuple t0,
long factor,
LongTuple t1,
MutableLongTuple result)
Computes
t0+factor*t1, and stores the result in the given
result tuple. |
static boolean |
areElementsGreaterThan(LongTuple t,
long value)
Returns whether all elements of the given tuple
are greater than the given value.
|
static boolean |
areElementsGreaterThan(LongTuple t0,
LongTuple t1)
Returns whether one tuple is element-wise
greater than the other.
|
static boolean |
areElementsGreaterThanOrEqual(LongTuple t,
long value)
Returns whether all elements of the given tuple
are greater than or equal to the given value.
|
static boolean |
areElementsGreaterThanOrEqual(LongTuple t0,
LongTuple t1)
Returns whether one tuple is element-wise
greater than or equal to the other.
|
static boolean |
areElementsLessThan(LongTuple t,
long value)
Returns whether all elements of the given tuple
are less than the given value.
|
static boolean |
areElementsLessThan(LongTuple t0,
LongTuple t1)
Returns whether one tuple is element-wise
less than the other
|
static boolean |
areElementsLessThanOrEqual(LongTuple t,
long value)
Returns whether all elements of the given tuple
are less than or equal to the given value.
|
static boolean |
areElementsLessThanOrEqual(LongTuple t0,
LongTuple t1)
Returns whether one tuple is element-wise
less than or equal to the other
|
static List<Long> |
asList(LongTuple t)
Returns a view on the given tuple as an unmodifiable list.
|
static List<Long> |
asList(MutableLongTuple t)
Returns a view on the given tuple as a list that does not
allow structural modifications.
|
static MutableLongTuple |
clamp(LongTuple t,
long min,
long max,
MutableLongTuple result)
Clamp the components of the given tuple to be in the specified range,
and write the result into the given result tuple.
|
static MutableLongTuple |
clamp(LongTuple t,
LongTuple min,
LongTuple max,
MutableLongTuple result)
Clamp the components of the given tuple to be in the specified range,
and write the result into the given result tuple.
|
static Comparator<LongTuple> |
comparator(Order order)
Returns a comparator that compares tuples based on the specified
Order. |
static int |
compareColexicographically(LongTuple t0,
LongTuple t1)
Compares two tuples colexicographically, starting with
the elements of the highest index.
|
static int |
compareLexicographically(LongTuple t0,
LongTuple t1)
Compares two tuples lexicographically, starting with
the elements of the lowest index.
|
static LongTuple |
constant(int size,
long value)
Returns a tuple with the specified size, where each
element is the given value.
|
static MutableLongTuple |
copy(LongTuple other)
Creates a new tuple which is a copy of
the given one.
|
static MutableLongTuple |
create(int size)
Creates a new tuple with the given size.
|
static MutableLongTuple |
divide(LongTuple t0,
LongTuple t1,
MutableLongTuple result)
Divide the elements of the given input tuples, and store
the results in the given result tuple.
|
static long |
dot(LongTuple t0,
LongTuple t1)
Computes the dot product of the given tuples
|
static boolean |
incrementColexicographically(LongTuple t,
LongTuple min,
LongTuple max,
MutableLongTuple result)
Colexicographically increment the given tuple in the given range, and
store the result in the given result tuple.
|
static boolean |
incrementLexicographically(LongTuple t,
LongTuple min,
LongTuple max,
MutableLongTuple result)
Lexicographically increment the given tuple in the given range, and
store the result in the given result tuple.
|
static long |
max(LongTuple t)
Computes the maximum value that occurs in the given tuple,
or
Long.MIN_VALUE if the given tuple has a
size of 0. |
static MutableLongTuple |
max(LongTuple t0,
LongTuple t1,
MutableLongTuple result)
Compute the element-wise maximum of the the given input
tuples, and store the result in the given
result tuple.
|
static long |
min(LongTuple t)
Computes the minimum value that occurs in the given tuple,
or
Long.MAX_VALUE if the given tuple has a
size of 0. |
static MutableLongTuple |
min(LongTuple t0,
LongTuple t1,
MutableLongTuple result)
Compute the element-wise minimum of the the given input
tuples, and store the result in the given
result tuple.
|
static MutableLongTuple |
multiply(LongTuple t0,
long factor,
MutableLongTuple result)
Multiply the given input tuple with the given factor, and
store the result in the given result tuple.
|
static MutableLongTuple |
multiply(LongTuple t0,
LongTuple t1,
MutableLongTuple result)
Multiply the elements of the given input tuples, and store
the results in the given result tuple.
|
static MutableLongTuple |
negate(LongTuple t0,
MutableLongTuple result)
Negates the given tuple, and store the result in the given result tuple.
|
static MutableLongTuple |
of(int x,
int y)
Creates a new
MutableLongTuple with the given values. |
static MutableLongTuple |
of(long... values)
Creates a new tuple with the given values.
|
static MutableLongTuple |
of(long x)
Creates a new
MutableLongTuple with the given value. |
static MutableLongTuple |
of(long x,
long y,
long z)
Creates a new
MutableLongTuple with the given values. |
static MutableLongTuple |
of(long x,
long y,
long z,
long w)
Creates a new
MutableLongTuple with the given values. |
static MutableLongTuple |
reverse(LongTuple t,
MutableLongTuple result)
Reverse the given tuple.
|
static LongTuple |
reversed(LongTuple t)
Creates a new tuple that is a reversed view on the given
tuple.
|
static MutableLongTuple |
reversed(MutableLongTuple t)
Creates a new tuple that is a reversed view on the given
tuple.
|
static void |
set(MutableLongTuple t,
long v)
Set all elements of the given tuple to the given value
|
static MutableLongTuple |
subtract(LongTuple t0,
long value,
MutableLongTuple result)
Subtract the given value from all elements of the given input
tuple, and store the result in the given result tuple.
|
static MutableLongTuple |
subtract(LongTuple t0,
LongTuple t1,
MutableLongTuple result)
Subtract the given input tuples, and store the result in
the given result tuple.
|
static long[] |
toArray(LongTuple t)
Creates a new array from the contents of the given tuple
|
static MutableDoubleTuple |
toDoubleTuple(LongTuple longTuple)
Convert the given
LongTuple into a DoubleTuple |
static String |
toString(LongTuple tuple,
int maxNumLeadingElements,
int maxNumTrailingElements)
Returns a string representation of the given tuple using
toString(LongTuple, Locale, String, int, int) with
the default locale and format. |
static String |
toString(LongTuple tuple,
Locale locale,
String format,
int maxNumLeadingElements,
int maxNumTrailingElements)
Returns a string representation of the given tuple.
|
static MutableLongTuple |
wrap(long... values)
Creates a new tuple that is a view
on the given values.
|
static MutableLongTuple |
wrap(long[] data,
int offset,
int size)
Returns a new tuple that is a view on the
specified portion of the given array
|
static MutableLongTuple |
wrap(LongBuffer buffer)
Returns a new tuple that is a view on the given buffer.
|
static LongTuple |
zero(int size)
Returns a tuple with the specified size, containing
all zeros.
|
public static LongTuple zero(int size)
size - The sizeIllegalArgumentException - If the size is smaller than 0public static LongTuple constant(int size, long value)
size - The sizevalue - The valueIllegalArgumentException - If the size is smaller than 0public static MutableLongTuple create(int size)
size - The size.IllegalArgumentException - If the size is smaller than 0public static MutableLongTuple copy(LongTuple other)
other - The other tuple.NullPointerException - If the other tuple is nullpublic static MutableLongTuple of(long... values)
wrap(long...) may be
used.values - The valuesNullPointerException - If the given array is nullpublic static MutableLongTuple wrap(long... values)
values - The valuesNullPointerException - If the given array is nullpublic static MutableLongTuple wrap(LongBuffer buffer)
buffer - The buffer for the tupleNullPointerException - If the given buffer is nullpublic static MutableLongTuple wrap(long[] data, int offset, int size)
data - The data for the tupleoffset - The offset in the arraysize - The size of the tupleNullPointerException - If the given data array is nullIllegalArgumentException - If the given offset is negative,
or if offset+size >= data.lengthpublic static long[] toArray(LongTuple t)
t - The tuplepublic static List<Long> asList(LongTuple t)
t - The tupleNullPointerException - If the given tuple is nullpublic static List<Long> asList(MutableLongTuple t)
null elements.t - The tupleNullPointerException - If the given tuple is nullpublic static void set(MutableLongTuple t, long v)
t - The tuplev - The valuepublic static MutableLongTuple reverse(LongTuple t, MutableLongTuple result)
t - The input tupleresult - The result tupleIllegalArgumentException - If the given tuples do not
have the same sizepublic static LongTuple reversed(LongTuple t)
t - The tupleNullPointerException - If the given tuple is nullpublic static MutableLongTuple reversed(MutableLongTuple t)
t - The tupleNullPointerException - If the given tuple is nullpublic static MutableLongTuple clamp(LongTuple t, long min, long max, MutableLongTuple result)
t - The input tuplemin - The minimum valuemax - The maximum valueresult - The result tupleIllegalArgumentException - If the given tuples do not
have the same sizepublic static MutableLongTuple clamp(LongTuple t, LongTuple min, LongTuple max, MutableLongTuple result)
t - The input tuplemin - The minimum valuesmax - The maximum valuesresult - The result tupleIllegalArgumentException - If the given tuples do not
have the same sizepublic static MutableLongTuple negate(LongTuple t0, MutableLongTuple result)
t0 - The tuple to negateresult - The tuple that will store the resultpublic static MutableLongTuple add(LongTuple t0, LongTuple t1, MutableLongTuple result)
t0 - The first input tuplet1 - The second input tupleresult - The tuple that will store the resultIllegalArgumentException - If the given tuples do not
have the same sizepublic static MutableLongTuple subtract(LongTuple t0, LongTuple t1, MutableLongTuple result)
t0 - The first input tuplet1 - The second input tupleresult - The tuple that will store the resultIllegalArgumentException - If the given tuples do not
have the same sizepublic static MutableLongTuple multiply(LongTuple t0, LongTuple t1, MutableLongTuple result)
t0 - The first input tuplet1 - The second input tupleresult - The tuple that will store the resultIllegalArgumentException - If the given tuples do not
have the same sizepublic static MutableLongTuple divide(LongTuple t0, LongTuple t1, MutableLongTuple result)
t0 - The first input tuplet1 - The second input tupleresult - The tuple that will store the resultIllegalArgumentException - If the given tuples do not
have the same sizepublic static MutableLongTuple add(LongTuple t0, long value, MutableLongTuple result)
t0 - The first input tuplevalue - The value to addresult - The tuple that will store the resultIllegalArgumentException - If the given tuple do not
have the same size
as the result tuplepublic static MutableLongTuple subtract(LongTuple t0, long value, MutableLongTuple result)
t0 - The first input tuplevalue - The value to addresult - The tuple that will store the resultIllegalArgumentException - If the given tuple do not
have the same size
as the result tuplepublic static MutableLongTuple multiply(LongTuple t0, long factor, MutableLongTuple result)
t0 - The input tuplefactor - The scaling factorresult - The tuple that will store the resultIllegalArgumentException - If the given tuples do not
have the same sizepublic static MutableLongTuple addScaled(LongTuple t0, long factor, LongTuple t1, MutableLongTuple result)
t0+factor*t1, and stores the result in the given
result tuple.t0 - The first input tuplefactor - The scaling factort1 - The second input tupleresult - The tuple that will store the resultIllegalArgumentException - If the given tuples do not
have the same sizepublic static long dot(LongTuple t0, LongTuple t1)
t0 - The first input tuplet1 - The second input tupleIllegalArgumentException - If the given tuples do not
have the same sizepublic static long min(LongTuple t)
Long.MAX_VALUE if the given tuple has a
size of 0.t - The input tuplepublic static long max(LongTuple t)
Long.MIN_VALUE if the given tuple has a
size of 0.t - The input tuplepublic static MutableLongTuple min(LongTuple t0, LongTuple t1, MutableLongTuple result)
t0 - The first input tuplet1 - The second input tupleresult - The tuple that will store the resultIllegalArgumentException - If the given tuples do not
have the same sizepublic static MutableLongTuple max(LongTuple t0, LongTuple t1, MutableLongTuple result)
t0 - The first input tuplet1 - The second input tupleresult - The tuple that will store the resultIllegalArgumentException - If the given tuples do not
have the same sizepublic static int compareLexicographically(LongTuple t0, LongTuple t1)
t0 - The first tuplet1 - The second tupleIllegalArgumentException - If the given tuples do not
have the same sizepublic static int compareColexicographically(LongTuple t0, LongTuple t1)
t0 - The first tuplet1 - The second tupleIllegalArgumentException - If the given tuples do not
have the same sizepublic static Comparator<LongTuple> comparator(Order order)
Order. If the given order is null, then
null will be returned.order - The Orderpublic static boolean areElementsGreaterThan(LongTuple t0, LongTuple t1)
t0 - The first tuplet1 - The second tupleIllegalArgumentException - If the given tuples do not
have the same sizepublic static boolean areElementsGreaterThanOrEqual(LongTuple t0, LongTuple t1)
t0 - The first tuplet1 - The second tupleIllegalArgumentException - If the given tuples do not
have the same sizepublic static boolean areElementsLessThan(LongTuple t0, LongTuple t1)
t0 - The first tuplet1 - The second tupleIllegalArgumentException - If the given tuples do not
have the same sizepublic static boolean areElementsLessThanOrEqual(LongTuple t0, LongTuple t1)
t0 - The first tuplet1 - The second tupleIllegalArgumentException - If the given tuples do not
have the same sizepublic static boolean areElementsGreaterThan(LongTuple t, long value)
t - The tuplevalue - The value to compare topublic static boolean areElementsGreaterThanOrEqual(LongTuple t, long value)
t - The tuplevalue - The value to compare topublic static boolean areElementsLessThan(LongTuple t, long value)
t - The tuplevalue - The value to compare topublic static boolean areElementsLessThanOrEqual(LongTuple t, long value)
t - The tuplevalue - The value to compare topublic static String toString(LongTuple tuple, int maxNumLeadingElements, int maxNumTrailingElements)
toString(LongTuple, Locale, String, int, int) with
the default locale and format.tuple - The tuplemaxNumLeadingElements - The maximum number of leading elementsmaxNumTrailingElements - The maximum number of trailing elementspublic static String toString(LongTuple tuple, Locale locale, String format, int maxNumLeadingElements, int maxNumTrailingElements)
size that is larger than
the sum of the given numbers of leading and trailing elements, then
the string contents will be abbreviated with an ellipsis: "...".toString(t, 3, 1) : (0, 0, 0, ..., 0)toString(t, 2, 0) : (0, 0, ...)toString(t, 0, 2) : (..., 0, 0)toString(t, 9, 9) : (0, 0, 0, 0, 0, 0)tuple - The tuplelocale - The locale. If this is null, then a
canonical string representation of the elements will be used.format - The format. If this is null, then a
canonical string representation of the elements will be used.maxNumLeadingElements - The maximum number of leading elementsmaxNumTrailingElements - The maximum number of trailing elementspublic static MutableDoubleTuple toDoubleTuple(LongTuple longTuple)
LongTuple into a DoubleTuplelongTuple - The LongTupleMutableDoubleTuplepublic static MutableLongTuple of(long x)
MutableLongTuple with the given value.x - The x coordinatepublic static MutableLongTuple of(int x, int y)
MutableLongTuple with the given values.x - The x coordinatey - The y coordinatepublic static MutableLongTuple of(long x, long y, long z)
MutableLongTuple with the given values.x - The x coordinatey - The y coordinatez - The z coordinatepublic static MutableLongTuple of(long x, long y, long z, long w)
MutableLongTuple with the given values.x - The x coordinatey - The y coordinatez - The z coordinatew - The w coordinatepublic static boolean incrementLexicographically(LongTuple t, LongTuple min, LongTuple max, MutableLongTuple result)
greater than
or equal to the values in the given minimum tuple.null (but it
may be identical to the input tuple).t - The input tuplemin - The minimum valuesmax - The maximum valuesresult - The result tuplepublic static boolean incrementColexicographically(LongTuple t, LongTuple min, LongTuple max, MutableLongTuple result)
greater than
or equal to the values in the given minimum tuple.null (but it
may be identical to the input tuple).t - The input tuplemin - The minimum valuesmax - The maximum valuesresult - The result tupleCopyright © 2015. All Rights Reserved.