public class SortedLongsArithmetic extends Object implements SortedLongs
Modifier and Type | Field and Description |
---|---|
int |
n |
double |
oneOverVStep |
long |
v0 |
long |
vStep |
Constructor and Description |
---|
SortedLongsArithmetic(long v0,
long vStep,
int n) |
Modifier and Type | Method and Description |
---|---|
static BigInteger |
big(int x) |
static BigInteger |
big(long x) |
ContinuousIndex |
continuousIndexOf(long x)
The continuous index at which x falls in this sequence.
|
void |
continuousIndexOf(long x,
ContinuousIndex result)
The continuous index at which x falls in this sequence.
|
ContinuousIndexArray |
continuousIndicesIn(SortedLongs xs)
Like continuousIndicesOf, but in reverse: for each v in this sequence,
the continuous index at which v falls in xs.
|
ContinuousIndexArray |
continuousIndicesOf(Longs xs)
For each x in xs, the continuous index at which x falls in this
sequence.
|
void |
continuousIndicesOf(Longs xs,
ContinuousIndexArray result)
For each x in xs, the continuous index at which x falls in this
sequence.
|
ContinuousIndexArray |
continuousIndicesOf(SortedLongs xs)
For each x in xs, the continuous index at which x falls in this
sequence.
|
void |
continuousIndicesOf(SortedLongs xs,
ContinuousIndexArray result)
For each x in xs, the continuous index at which x falls in this
sequence.
|
long[] |
copyOf() |
long[] |
copyOf(int i,
int c) |
void |
copyTo(int i,
long[] dest,
int iDest,
int c) |
void |
copyTo(int i,
LongBuffer dest,
int c) |
void |
copyTo(LongBuffer dest) |
long |
first() |
int |
indexAfter(long x)
Smallest index whose value is greater than x
|
int |
indexAtOrAfter(long x)
Smallest index whose value is greater than or equal to x
|
int |
indexAtOrBefore(long x)
Largest index whose value is less than or equal to x
|
int |
indexBefore(long x)
Largest index whose value is less than x
|
int |
indexNearest(long x)
Index of the value closest to x.
|
int |
indexOf(long x)
Follows the convention of
Arrays.binarySearch(long[], long) :
If x is contained in this sequence, returns the index of x
Otherwise, returns (-insertionPoint - 1)
|
boolean |
isEmpty() |
long |
last() |
int |
n()
Length of the sequence
|
long |
v(int i)
Value at index i
|
public final long v0
public final long vStep
public final int n
public final double oneOverVStep
public SortedLongsArithmetic(long v0, long vStep, int n)
IllegalArgumentException
- if
vStep
is non-positive, or
n
is negative, or
(v0 + (n-1)*vStep)
is greater than Long.MAX_VALUE
public static BigInteger big(long x)
public static BigInteger big(int x)
public long v(int i)
Longs
public int n()
Longs
public void copyTo(int i, long[] dest, int iDest, int c)
public void copyTo(int i, LongBuffer dest, int c)
public void copyTo(LongBuffer dest)
public int indexOf(long x)
SortedLongs
Arrays.binarySearch(long[], long)
:
x
is contained in this sequence, returns the index of x
indexOf
in interface SortedLongs
Arrays.binarySearch(long[], long)
public int indexNearest(long x)
SortedLongs
indexNearest
in interface SortedLongs
public int indexBefore(long x)
SortedLongs
indexBefore
in interface SortedLongs
public int indexAfter(long x)
SortedLongs
indexAfter
in interface SortedLongs
public int indexAtOrBefore(long x)
SortedLongs
indexAtOrBefore
in interface SortedLongs
public int indexAtOrAfter(long x)
SortedLongs
indexAtOrAfter
in interface SortedLongs
public void continuousIndexOf(long x, ContinuousIndex result)
SortedLongs
continuousIndexOf
in interface SortedLongs
ContinuousIndex
public ContinuousIndex continuousIndexOf(long x)
SortedLongs
continuousIndexOf
in interface SortedLongs
ContinuousIndex
public void continuousIndicesOf(Longs xs, ContinuousIndexArray result)
SortedLongs
continuousIndicesOf
in interface SortedLongs
ContinuousIndexArray
public ContinuousIndexArray continuousIndicesOf(Longs xs)
SortedLongs
continuousIndicesOf
in interface SortedLongs
com.metsci.tracks.ContinuousIndexArray
public void continuousIndicesOf(SortedLongs xs, ContinuousIndexArray result)
SortedLongs
SortedLongs.continuousIndicesOf(Longs, ContinuousIndexArray)
in some implementations.continuousIndicesOf
in interface SortedLongs
ContinuousIndexArray
public ContinuousIndexArray continuousIndicesOf(SortedLongs xs)
SortedLongs
SortedLongs.continuousIndicesOf(Longs)
in some implementations.continuousIndicesOf
in interface SortedLongs
ContinuousIndexArray
public ContinuousIndexArray continuousIndicesIn(SortedLongs xs)
Copyright © 2016 Metron, Inc.. All rights reserved.