| Modifier and Type | Field and Description |
|---|---|
float[] |
_data |
int[] |
_indices |
boolean |
_useBinSearch |
static int |
MIN_LENGTH_FOR_NONSPARSE_ARRAY
Don't make arrays sparse unless they exceed this length.
|
static float |
NO_BINSEARCH_THRESHOLD
If the sparse array exceeds this threshold, make the array non-sparse.
|
| Constructor and Description |
|---|
IndexedFloatArray() |
IndexedFloatArray(float[] values,
int size) |
IndexedFloatArray(int n) |
IndexedFloatArray(int[] indices) |
IndexedFloatArray(int[] indices,
float[] values) |
IndexedFloatArray(int[] indices,
float[] values,
boolean isOptimize) |
| Modifier and Type | Method and Description |
|---|---|
void |
add(int index,
float delta) |
void |
addTo(float[] dest) |
void |
clear() |
Object |
clone() |
void |
copyFrom(IndexedFloatArray rhs) |
void |
copyTo(float[] dest,
int destPos) |
float |
get(int n) |
int |
getAddr(int index) |
float |
getLazy(int n) |
float |
getProb(int loc) |
int[] |
getTranslations(float probThreshold) |
PriorityQueue<tl.lin.data.pair.PairOfFloatInt> |
getTranslationsWithProbs(float probThreshold) |
List<tl.lin.data.pair.PairOfFloatInt> |
getTranslationsWithProbsAsList(float probThreshold) |
int |
getWord(int loc) |
float |
innerProduct(IndexedFloatArray rhs) |
int |
maxKey() |
void |
minusEquals(IndexedFloatArray rhs) |
void |
normalize_variationalBayes(float alpha) |
void |
normalize() |
void |
normalize(float alpha) |
void |
optimizeSpeed()
If sparse array meets the load criteria, optimize it so that it no longer uses
a bin search.
|
void |
plusEquals(IndexedFloatArray rhs) |
void |
plusEqualsMismatchSize(IndexedFloatArray rhs) |
void |
readFields(DataInput in) |
void |
set(int index,
float value) |
int |
size() |
void |
timesEquals(float rhs) |
String |
toString() |
String |
toString(boolean brackets) |
void |
write(DataOutput out) |
public static final float NO_BINSEARCH_THRESHOLD
public static final int MIN_LENGTH_FOR_NONSPARSE_ARRAY
public float[] _data
public int[] _indices
public boolean _useBinSearch
public IndexedFloatArray()
public IndexedFloatArray(int[] indices,
float[] values)
public IndexedFloatArray(int[] indices,
float[] values,
boolean isOptimize)
public IndexedFloatArray(float[] values,
int size)
public IndexedFloatArray(int[] indices)
public IndexedFloatArray(int n)
public void readFields(DataInput in) throws IOException
readFields in interface org.apache.hadoop.io.WritableIOExceptionpublic void write(DataOutput out) throws IOException
write in interface org.apache.hadoop.io.WritableIOExceptionpublic int maxKey()
public void optimizeSpeed()
public void copyTo(float[] dest,
int destPos)
public void copyFrom(IndexedFloatArray rhs)
public void addTo(float[] dest)
public int size()
public int getWord(int loc)
public float getProb(int loc)
public final float get(int n)
public final float getLazy(int n)
public int[] getTranslations(float probThreshold)
public PriorityQueue<tl.lin.data.pair.PairOfFloatInt> getTranslationsWithProbs(float probThreshold)
public List<tl.lin.data.pair.PairOfFloatInt> getTranslationsWithProbsAsList(float probThreshold)
public final void set(int index,
float value)
public final void add(int index,
float delta)
public int getAddr(int index)
index - the index of the searched termpublic void clear()
public void plusEqualsMismatchSize(IndexedFloatArray rhs)
public void plusEquals(IndexedFloatArray rhs)
public void minusEquals(IndexedFloatArray rhs)
public void timesEquals(float rhs)
public void normalize()
public void normalize(float alpha)
public void normalize_variationalBayes(float alpha)
public float innerProduct(IndexedFloatArray rhs)
public String toString(boolean brackets)
Copyright © 2015. All rights reserved.