

PREV CLASS NEXT CLASS  FRAMES NO FRAMES  
SUMMARY: NESTED  FIELD  CONSTR  METHOD  DETAIL: FIELD  CONSTR  METHOD 
java.lang.Object gov.sandia.cognition.math.matrix.VectorUtil
public class VectorUtil
Utility methods for dealing with vectors.
Constructor Summary  

VectorUtil()

Method Summary  

static void 
assertDimensionalitiesAllEqual(Iterable<? extends Vectorizable> data,
int dimensionality)
Asserts that all of the dimensionalities of the vectors in the given set of data equal the given dimensionality. 
static Vector 
divideByNorm1(Vector input)
Returns a new vector whose elements are the elements of the original vector, divided by the 1norm of the vector (the sum of the absolute values of the elements). 
static void 
divideByNorm1Equals(Vector vector)
Divides all of the given elements of the vector by the 1norm (the sum of the absolute values of the elements. 
static Vector 
interpolateLinear(Vectorizable first,
Vectorizable second,
double percent)
Performs linear interpolation between two vectors. 
static Vector 
interpolateLinear(Vector first,
Vector second,
double percent)
Performs linear interpolation between two vectors. 
static int 
safeGetDimensionality(Vector vector)
Gets the dimensionality of the given vector, if it is not null. 
static int 
safeGetDimensionality(Vectorizable vector)
Gets the dimensionality of the given vector, if it is not null. 
Methods inherited from class java.lang.Object 

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait 
Constructor Detail 

public VectorUtil()
Method Detail 

public static int safeGetDimensionality(Vectorizable vector)
vector
 The vector to get the dimensionality of.
public static int safeGetDimensionality(Vector vector)
vector
 The vector to get the dimensionality of.
public static Vector divideByNorm1(Vector input)
input
 The vector to divide by its 1norm.
public static void divideByNorm1Equals(Vector vector)
vector
 The vector to divide the elements by the 1norm. It is modified by
this method.public static Vector interpolateLinear(Vectorizable first, Vectorizable second, double percent)
first
 The first vector. Sometimes this is referred to as x.second
 The second vector. Sometimes this is referred to as y.percent
 A value between 0.0 and 1.0 to interpolate between the two vectors.
Sometimes this is also referred to as alpha.
public static Vector interpolateLinear(Vector first, Vector second, double percent)
first
 The first vector. Sometimes this is referred to as x.second
 The second vector. Sometimes this is referred to as y.percent
 A value between 0.0 and 1.0 to interpolate between the two vectors.
Sometimes this is also referred to as alpha.
public static void assertDimensionalitiesAllEqual(Iterable<? extends Vectorizable> data, int dimensionality)
data
 A collection of inputoutput pairs.dimensionality
 The dimensionality that all the inputs must have.
DimensionalityMismatchException
 If the dimensionalities are not all equal.


PREV CLASS NEXT CLASS  FRAMES NO FRAMES  
SUMMARY: NESTED  FIELD  CONSTR  METHOD  DETAIL: FIELD  CONSTR  METHOD 