public class MultidimensionalFloatFV extends FloatFV implements Serializable, Cloneable, FeatureVector
| Modifier and Type | Field and Description | 
|---|---|
int[] | 
nbins
Array containing the number of bins in each dimension 
 | 
values| Constructor and Description | 
|---|
MultidimensionalFloatFV()
Construct an empty feature vector 
 | 
MultidimensionalFloatFV(float[][] values)
Construct from 2-dimensional array 
 | 
MultidimensionalFloatFV(float[][][] values)
Construct from 3-dimensional array 
 | 
MultidimensionalFloatFV(float[] values,
                       int... nbins)
Construct from flattened values array and dimensions 
 | 
MultidimensionalFloatFV(int... nbins)
Construct empty FV with given dimensions 
 | 
| Modifier and Type | Method and Description | 
|---|---|
String | 
asciiHeader()
Header for ascii input. 
 | 
MultidimensionalDoubleFV | 
asDoubleFV()
Convert the FV to a DoubleFV representation 
 | 
byte[] | 
binaryHeader()
Header for binary input. 
 | 
MultidimensionalFloatFV | 
clone()  | 
double | 
compare(MultidimensionalFloatFV h,
       FloatFVComparison method)
Compare this FV to another with the given method. 
 | 
float | 
get(int... coords)
Get the element at the given n-dimensional coordinate 
 | 
float | 
get(int x)
Get the element at the given flat index 
 | 
int[] | 
getCoordinates(int index)
Given an index, calculate the coordinate which would map to that index using  
getIndex(int...) | 
int | 
getIndex(int... coords)
Convert the given coordinate into a flat index value 
 | 
float[] | 
getVector()
Get the underlying flat-vector representation 
 | 
void | 
readASCII(Scanner in)
Read internal state from in. 
 | 
void | 
readBinary(DataInput in)
Read internal state from in. 
 | 
void | 
set(float value,
   int... coords)
Set the the element at the given n-dimensional coordinate 
 | 
String | 
toString()  | 
void | 
writeASCII(PrintWriter out)
Write the content of this as ascii to out. 
 | 
void | 
writeBinary(DataOutput out)
Write the content of this as binary to out. 
 | 
asDoubleVector, compare, concatenate, concatenate, equals, getAsDouble, hashCode, length, newInstance, normaliseFV, normaliseFV, normaliseFV, normaliseFV, setFromDouble, subvector, subvectorfinalize, getClass, notify, notifyAll, wait, wait, waitasDoubleVector, getAsDouble, length, newInstance, normaliseFV, normaliseFV, normaliseFV, normaliseFV, setFromDoublepublic int[] nbins
public MultidimensionalFloatFV()
public MultidimensionalFloatFV(int... nbins)
nbins - the number of bins in each dimensionpublic MultidimensionalFloatFV(float[] values, int... nbins)
values - the flat array of valuesnbins - the number of bins in each dimensionpublic MultidimensionalFloatFV(float[][] values)
values - the 2d arraypublic MultidimensionalFloatFV(float[][][] values)
values - the 3d arraypublic float[] getVector()
getVector in interface FeatureVectorgetVector in class ArrayFeatureVector<float[]>public float get(int x)
public int getIndex(int... coords)
coords - the coordinatepublic void set(float value, int... coords)
value - the value to setcoords - the coordinatespublic float get(int... coords)
coords - the coordinatespublic MultidimensionalFloatFV clone()
public MultidimensionalDoubleFV asDoubleFV()
asDoubleFV in interface FeatureVectorasDoubleFV in class FloatFVpublic double compare(MultidimensionalFloatFV h, FloatFVComparison method)
h - the feature to compare against.method - the method to compare with.public void writeBinary(DataOutput out) throws IOException
WriteableBinarywriteBinary in interface WriteableBinarywriteBinary in class FloatFVout - sink to write toIOException - an error writing to outpublic void writeASCII(PrintWriter out) throws IOException
WriteableASCIIwriteASCII in interface WriteableASCIIwriteASCII in class FloatFVout - sink to write toIOException - an error writing to outpublic void readBinary(DataInput in) throws IOException
ReadableBinaryreadBinary in interface ReadableBinaryreadBinary in class FloatFVin - source to read from.IOException - an error reading inputpublic void readASCII(Scanner in) throws IOException
ReadableASCIIreadASCII in interface ReadableASCIIreadASCII in class FloatFVin - source to read from.IOException - an error reading inputpublic byte[] binaryHeader()
ReadableBinarybinaryHeader in interface ReadableBinarybinaryHeader in interface WriteableBinarybinaryHeader in class FloatFVpublic String asciiHeader()
ReadableASCIIasciiHeader in interface ReadableASCIIasciiHeader in interface WriteableASCIIasciiHeader in class FloatFVpublic int[] getCoordinates(int index)
getIndex(int...)index -