| Modifier and Type | Field and Description |
|---|---|
| private int | |
| pack-priv static final long | |
| pack-priv double[] |
| Access | Constructor and Description |
|---|---|
| public | GVector(int
the number of elements in this GVector. length)Constructs a new GVector of the specified length with all vector elements initialized to 0. |
| public | GVector(double[]
the values for the new GVector. vector)Constructs a new GVector from the specified array elements. |
| public | |
| public | |
| public | |
| public | |
| public | |
| public | |
| public | GVector(double[]
The array from which the values will be copied. vector, int The number of values copied from the array. length)Constructs a new GVector of the specified length and initializes it by copying the specified number of elements from the specified array. |
| Modifier and Type | Method and Description |
|---|---|
| public final void | |
| public final void | |
| public final double | |
| public Object | Returns: a clone of this instance.Overrides java. |
| public final double | |
| public boolean | epsilonEquals(GVector
The vector to be compared to this vector v1, double the threshold value epsilon)Returns true if the L-infinite distance between this vector and vector v1 is less than or equal to the epsilon parameter, otherwise returns false. |
| public boolean | |
| public boolean | Returns: true or falseThe object with which the comparison is made. o1)Overrides java. |
| public final double | Returns: the value at the indexed elementthe index of the element to retrieve (zero indexed) index)Retrieves the value at the specified index value of this vector. |
| public final int | |
| public int | Returns: the integer hash code valueOverrides java. |
| public final void | interpolate(GVector v1, GVector v2, float alpha)
Deprecated
Use interpolate(GVector, GVector, double) instead
|
| public final void | |
| public final void | interpolate(GVector
the first vector v1, GVector the second vector v2, double the alpha interpolation parameter alpha)Linearly interpolates between vectors v1 and v2 and places the result into this tuple: this = (1-alpha)*v1 + alpha*v2. |
| public final void | interpolate(GVector
the first vector v1, double the alpha interpolation parameter alpha)Linearly interpolates between this vector and vector v1 and places the result into this tuple: this = (1-alpha)*this + alpha*v1. |
| public final void | LUDBackSolve(GMatrix
The matrix into which the lower and upper decompostions
have been placed LU, GVector The b vector in the equation (LU)*x = b b, GVector The row permuations that were necessary to
produce the LU matrix parameter permutation)LU Decomposition Back Solve; this method takes the LU matrix and the permutation vector produced by the GMatrix method LUD and solves the equation (LU)*x = b by placing the solution vector x into this vector. |
| public final void | |
| public final void | |
| public final void | |
| public final double | Returns: length of this vectorReturns the square root of the sum of the squares of this vector (its length in n-dimensional space). |
| public final void | |
| public final void | |
| public final double | Returns: length squared of this vectorReturns the sum of the squares of this vector (its length squared in n-dimensional space). |
| public final void | |
| public final void | |
| public final void | |
| public final void | set(double[]
the source array vector)Sets the value of this vector to the values found in the array parameter. |
| public final void | |
| public final void | |
| public final void | |
| public final void | |
| public final void | |
| public final void | |
| public final void | setElement(int
the index if the element to modify (zero indexed) index, double the new vector element value value)Modifies the value at the specified index of this vector. |
| public final void | setSize(int
number of desired elements in this vector length)Changes the size of this vector dynamically. |
| public final void | |
| public final void | |
| public final void | SVDBackSolve(GMatrix
The U matrix produced by the GMatrix method SVD U, GMatrix The W matrix produced by the GMatrix method SVD W, GMatrix The V matrix produced by the GMatrix method SVD V, GVector The b vector in the linear equation Ax = b b)Solves for x in Ax = b, where x is this vector (nx1), A is mxn, b is mx1, and A = U*W*transpose(V); U,W,V must be precomputed and can be found by taking the singular value decomposition (SVD) of A using the method SVD found in the GMatrix class. |
| public String | Returns: the String representationOverrides java. |
| public final void |
| length | back to summary |
|---|---|
| private int length | |
| serialVersionUID | back to summary |
|---|---|
| pack-priv static final long serialVersionUID | |
| values | back to summary |
|---|---|
| pack-priv double[] values | |
| GVector | back to summary |
|---|---|
| public GVector(int length) Constructs a new GVector of the specified length with all vector elements initialized to 0.
| |
| GVector | back to summary |
|---|---|
| public GVector(double[] vector) Constructs a new GVector from the specified array elements. The length of this GVector is set to the length of the specified array. The array elements are copied into this new GVector.
| |
| GVector | back to summary |
|---|---|
| public GVector(GVector vector) Constructs a new GVector from the specified vector. The vector elements are copied into this new GVector.
| |
| GVector | back to summary |
|---|---|
| public GVector(Tuple2f tuple) Constructs a new GVector and copies the initial values from the specified tuple.
| |
| GVector | back to summary |
|---|---|
| public GVector(Tuple3f tuple) Constructs a new GVector and copies the initial values from the specified tuple.
| |
| GVector | back to summary |
|---|---|
| public GVector(Tuple3d tuple) Constructs a new GVector and copies the initial values from the specified tuple.
| |
| GVector | back to summary |
|---|---|
| public GVector(Tuple4f tuple) Constructs a new GVector and copies the initial values from the specified tuple.
| |
| GVector | back to summary |
|---|---|
| public GVector(Tuple4d tuple) Constructs a new GVector and copies the initial values from the specified tuple.
| |
| GVector | back to summary |
|---|---|
| public GVector(double[] vector, int length) Constructs a new GVector of the specified length and
initializes it by copying the specified number of elements from
the specified array. The array must contain at least
| |
| add | back to summary |
|---|---|
| public final void add(GVector vector) Sets the value of this vector to sum of itself and the specified vector
| |
| add | back to summary |
|---|---|
| public final void add(GVector vector1, GVector vector2) Sets the value of this vector to the vector sum of vectors vector1 and vector2. | |
| angle | back to summary |
|---|---|
| public final double angle(GVector v1) Returns the (n-space) angle in radians between this vector and the vector parameter; the return value is constrained to the range [0,PI].
| |
| clone | back to summary |
|---|---|
| public Object clone() Overrides java. Creates a new object of the same class as this object.
| |
| dot | back to summary |
|---|---|
| public final double dot(GVector v1) Returns the dot product of this vector and vector v1.
| |
| epsilonEquals | back to summary |
|---|---|
| public boolean epsilonEquals(GVector v1, double epsilon) Returns true if the L-infinite distance between this vector and vector v1 is less than or equal to the epsilon parameter, otherwise returns false. The L-infinite distance is equal to MAX[abs(x1-x2), abs(y1-y2), . . . ].
| |
| equals | back to summary |
|---|---|
| public boolean equals(GVector vector1) Returns true if all of the data members of GVector vector1 are equal to the corresponding data members in this GVector.
| |
| equals | back to summary |
|---|---|
| public boolean equals(Object o1) Overrides java. Returns true if the Object o1 is of type GMatrix and all of the data members of o1 are equal to the corresponding data members in this GMatrix.
| |
| getElement | back to summary |
|---|---|
| public final double getElement(int index) Retrieves the value at the specified index value of this vector.
| |
| getSize | back to summary |
|---|---|
| public final int getSize() Returns the number of elements in this vector.
| |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Returns a hash code value based on the data values in this object. Two different GVector objects with identical data values (i.e., GVector.equals returns true) will return the same hash number. Two GVector objects with different data members may return the same hash value, although this is not likely.
| |
| interpolate | back to summary |
|---|---|
| public final void interpolate(GVector v1, GVector v2, float alpha)
Deprecated Use interpolate(GVector, GVector, double) instead | |
| interpolate | back to summary |
|---|---|
| public final void interpolate(GVector v1, float alpha)
Deprecated Use interpolate(GVector, double) instead | |
| interpolate | back to summary |
|---|---|
| public final void interpolate(GVector v1, GVector v2, double alpha) Linearly interpolates between vectors v1 and v2 and places the result into this tuple: this = (1-alpha)*v1 + alpha*v2. | |
| interpolate | back to summary |
|---|---|
| public final void interpolate(GVector v1, double alpha) Linearly interpolates between this vector and vector v1 and places the result into this tuple: this = (1-alpha)*this + alpha*v1.
| |
| LUDBackSolve | back to summary |
|---|---|
| public final void LUDBackSolve(GMatrix LU, GVector b, GVector permutation) LU Decomposition Back Solve; this method takes the LU matrix and the permutation vector produced by the GMatrix method LUD and solves the equation (LU)*x = b by placing the solution vector x into this vector. This vector should be the same length or longer than b. | |
| mul | back to summary |
|---|---|
| public final void mul(GMatrix m1, GVector v1) Multiplies matrix m1 times Vector v1 and places the result into this vector (this = m1*v1). | |
| mul | back to summary |
|---|---|
| public final void mul(GVector v1, GMatrix m1) Multiplies the transpose of vector v1 (ie, v1 becomes a row vector with respect to the multiplication) times matrix m1 and places the result into this vector (this = transpose(v1)*m1). The result is technically a row vector, but the GVector class only knows about column vectors, and so the result is stored as a column vector. | |
| negate | back to summary |
|---|---|
| public final void negate() Negates the value of this vector: this = -this. | |
| norm | back to summary |
|---|---|
| public final double norm() Returns the square root of the sum of the squares of this vector (its length in n-dimensional space).
| |
| normalize | back to summary |
|---|---|
| public final void normalize(GVector v1) Sets the value of this vector to the normalization of vector v1.
| |
| normalize | back to summary |
|---|---|
| public final void normalize() Normalizes this vector in place. | |
| normSquared | back to summary |
|---|---|
| public final double normSquared() Returns the sum of the squares of this vector (its length squared in n-dimensional space).
| |
| scale | back to summary |
|---|---|
| public final void scale(double s, GVector v1) Sets the value of this vector to the scalar multiplication of the scale factor with the vector v1.
| |
| scale | back to summary |
|---|---|
| public final void scale(double s) Scales this vector by the scale factor s.
| |
| scaleAdd | back to summary |
|---|---|
| public final void scaleAdd(double s, GVector v1, GVector v2) Sets the value of this vector to the scalar multiplication by s of vector v1 plus vector v2 (this = s*v1 + v2). | |
| set | back to summary |
|---|---|
| public final void set(double[] vector) Sets the value of this vector to the values found in the array parameter. The array should be at least equal in length to the number of elements in the vector.
| |
| set | back to summary |
|---|---|
| public final void set(GVector vector) Sets the value of this vector to the values found in vector vector.
| |
| set | back to summary |
|---|---|
| public final void set(Tuple2f tuple) Sets the value of this vector to the values in tuple
| |
| set | back to summary |
|---|---|
| public final void set(Tuple3f tuple) Sets the value of this vector to the values in tuple
| |
| set | back to summary |
|---|---|
| public final void set(Tuple3d tuple) Sets the value of this vector to the values in tuple
| |
| set | back to summary |
|---|---|
| public final void set(Tuple4f tuple) Sets the value of this vector to the values in tuple
| |
| set | back to summary |
|---|---|
| public final void set(Tuple4d tuple) Sets the value of this vector to the values in tuple
| |
| setElement | back to summary |
|---|---|
| public final void setElement(int index, double value) Modifies the value at the specified index of this vector.
| |
| setSize | back to summary |
|---|---|
| public final void setSize(int length) Changes the size of this vector dynamically. If the size is increased no data values will be lost. If the size is decreased, only those data values whose vector positions were eliminated will be lost.
| |
| sub | back to summary |
|---|---|
| public final void sub(GVector vector) Sets the value of this vector to the vector difference of itself and vector (this = this - vector).
| |
| sub | back to summary |
|---|---|
| public final void sub(GVector vector1, GVector vector2) Sets the value of this vector to the vector difference of vectors vector1 and vector2 (this = vector1 - vector2). | |
| SVDBackSolve | back to summary |
|---|---|
| public final void SVDBackSolve(GMatrix U, GMatrix W, GMatrix V, GVector b) Solves for x in Ax = b, where x is this vector (nx1), A is mxn, b is mx1, and A = U*W*transpose(V); U,W,V must be precomputed and can be found by taking the singular value decomposition (SVD) of A using the method SVD found in the GMatrix class. | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Returns a string that contains the values of this GVector.
| |
| zero | back to summary |
|---|---|
| public final void zero() Sets all the values in this vector to zero. | |