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