|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--cas.Tuple | +--cas.AlgebraicVector
A class representing the abstract entity "n dimensional vector". Data format is double.
Fields inherited from class cas.Tuple |
data |
Constructor Summary | |
AlgebraicVector(AlgebraicVector v)
Copy constructor, create a vector according to the given vector. |
|
AlgebraicVector(double[] data)
Create a vector according to the given double array. |
|
AlgebraicVector(int n)
Create a vector of the given size, with all entries initialized to zero. |
|
AlgebraicVector(int n,
double val)
Create a vector of the given size, with all entries initialized to the given value. |
|
AlgebraicVector(Tuple t)
Create a vector according to the given tuple. |
Method Summary | |
double |
angle(AlgebraicVector v)
Compute the angle between this vector and the given vector. |
double |
dot(AlgebraicVector v)
Computes the dot product between this vector and the given vector. |
void |
normalize()
Normalize this vector, make this vector a unit vector. |
void |
normalize(AlgebraicVector v)
Normalize the given vector and place the result in this vector. |
double |
normL1()
Compute the L1 norm of this vector. |
double |
normL2()
Compute the L2 norm of this vector. |
double |
normL2Squared()
Compute the squared L2 norm of this vector. |
double |
normLinf()
Compute the Linfinity norm of this vector. |
Methods inherited from class cas.Tuple |
add, add, clamp, clamp, div, div, equals, getDimension, interpolate, interpolate, max, min, mul, mul, negate, negate, scale, scale, set, set, set, sub, sub, toString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public AlgebraicVector(int n)
n
- The dimensionality of the point.public AlgebraicVector(int n, double val)
n
- The dimensionality of the vector.val
- The value all point entries.public AlgebraicVector(double[] data)
data
- The vector will contain entries as specified by the given
array.public AlgebraicVector(AlgebraicVector v)
v
- Create a copy of this vector.public AlgebraicVector(Tuple t)
t
- Create the vector according to this tuple.Tuple
Method Detail |
public double angle(AlgebraicVector v)
v
- Compute the angle to this vector.public double dot(AlgebraicVector v)
v
- Compute the dot product with this vector.public double normL2Squared()
public double normL2()
public double normL1()
public double normLinf()
public void normalize()
public void normalize(AlgebraicVector v)
v
- Set the vector to the normalized form of the given vector, v.
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |