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