public class VectorInstance extends Object implements Serializable
| Constructor and Description |
|---|
VectorInstance(Array values,
List<FieldRef> vectorFields)
Constructor
|
VectorInstance(Element vecElement,
List<FieldRef> vectorFields)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
double |
dotProduct(double[] other)
Computes the dot product between this vector instance and the
supplied array of values
|
double |
dotProduct(VectorInstance other)
Computes the dot product between this vector instance and the
argument
|
String |
getID()
Get the ID of this vector instance
|
Array |
getValues()
Get the Array of values encapsulated in this vector instance
|
List<FieldRef> |
getVectorFields()
Get the mining fields that are indexed by this vector instance
|
VectorInstance |
subtract(double[] other)
Subtract the values in the supplied array from this vector instance
|
VectorInstance |
subtract(VectorInstance other)
Subtract the supplied VectorInstance from this one and return the
result as a new VectorInstance
|
public VectorInstance(Array values, List<FieldRef> vectorFields)
values - the Array of values for this vector instancevectorFields - the mining fields indexed by this vector instancepublic String getID()
public Array getValues()
public List<FieldRef> getVectorFields()
public VectorInstance subtract(double[] other) throws Exception
other - an array of valuesException - if something goes wrongpublic VectorInstance subtract(VectorInstance other) throws Exception
other - the vector instance to subtractException - if something goes wrongpublic double dotProduct(VectorInstance other) throws Exception
other - the vector instance to perform the dot product withException - if something goes wrongpublic double dotProduct(double[] other)
throws Exception
other - an array of values to perform the dot product withException - if something goes wrongCopyright © 2016 University of Waikato, Hamilton, NZ. All Rights Reserved.