|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--marf.math.Matrix | +--marf.math.Vector
Algebraic operations on vectors.
NOTE: this class has the same considerations as
marf.math.Matrix
.
$Id: Vector.java,v 1.12 2005/08/13 23:09:39 susan_fan Exp $
Matrix
,
Serialized FormNested Class Summary |
Nested classes inherited from class marf.math.Matrix |
Matrix.Direction |
Field Summary | |
static int |
DEFAULT_VECTOR_LENGTH
Default vector's length is 3 elements. |
Fields inherited from class marf.math.Matrix |
adMatrix, DEFAULT_COLS, DEFAULT_ERROR_DELTA, DEFAULT_ROWS, iCols, iRows |
Constructor Summary | |
Vector()
Constructs a vector of default length of 3. |
|
Vector(double[] padVectorData)
Constructs a vector out of a raw array of doubles. |
|
Vector(double[] pad1DMatrix,
boolean pbTransposed)
Allows having a transposed vector upon consuctrion. |
|
Vector(int piVectorLength)
Constructs a vector with the specified length. |
|
Vector(marf.math.Matrix poMatrix)
Constructs a vector out of a matrix and forces the rows dimension to 1 and "flattens" the matrix to have the number of columns as the same number of elements in the original matrix. |
|
Vector(marf.math.Vector poVector)
Constructs a vector from another vector; a-la copy conctructor. |
Method Summary | |
marf.math.Vector |
add(marf.math.Vector poVector)
V1 = this + V. |
static marf.math.Vector |
add(marf.math.Vector poLHSVector,
marf.math.Vector poRHSVector)
V3 = V1 + V2. |
java.lang.Object |
clone()
Implements Clonable interface. |
static marf.math.Vector |
getCrossProduct(marf.math.Vector poLHSVector,
marf.math.Vector poRHSVector)
Calculates the cross product of two vectors, V3 = V1 x V2. |
static double |
getDotProduct(marf.math.Vector poLHSVector,
marf.math.Vector poRHSVector)
Calculates the dot product of two vectors, d = V1 * V2. |
double |
getElement(int piPosition)
Allows getting the value of vector's element at specified position. |
static marf.math.Vector |
getInnerProduct(marf.math.Vector poLHSVector,
marf.math.Vector poRHSVector)
Calculates an inner product of two vectors, V3 = V1 * V2. |
double |
getLength()
Retrieves the mathematical length of the vector. |
static java.lang.String |
getMARFSourceCodeRevision()
Retrieves class' revision. |
marf.math.Vector |
getUnitVector()
Returns a unit-vector representation of this vector. |
static marf.math.Vector |
i()
Creates a unit-vector "i". |
boolean |
isOrthogonal(marf.math.Vector poVector)
Tells whether this and the parameter vectors are orthogonal or not. |
static marf.math.Vector |
j()
Creates a unit-vector "j". |
static marf.math.Vector |
k()
Creates a unit-vector "k". |
void |
normalize()
Normalizes the vector's components by its length. |
void |
setElement(int piPosition,
double pdValue)
Allows setting the value of vector's element at specified position. |
Methods inherited from class marf.math.Matrix |
add, crop, cutColumn, cutRow, display, divide, divide, equals, equals, exhaustMatrix, extend, extend, getCols, getDeterminant, getElement, getElements, getMatrix2D, getMatrixArray, getRows, inverse, isIdentity, isNearlyIdentity, isNearlyIdentity, isReduced, loadRow, makeIdentity, minus, minus, minusUnary, multiply, multiply, multiply, multiply, multiply, multiply, multiply, rotate, rotate, rotate, rowOperation, rowOperation, rowReduce, scale, scale, scale, setAll, setAll, setAllRandom, setCols, setElement, setMatrix2D, setMatrixArray, setRows, shear, shear, shear, size, toString, translate, translate, translate, transpose |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final int DEFAULT_VECTOR_LENGTH
Constructor Detail |
public Vector()
public Vector(int piVectorLength)
piVectorLength
- require vector lengthpublic Vector(marf.math.Vector poVector)
poVector
- a vector to make a copy ofpublic Vector(marf.math.Matrix poMatrix)
poMatrix
- base matrix to construct the vector frompublic Vector(double[] padVectorData)
padVectorData
- source data for the vectorpublic Vector(double[] pad1DMatrix, boolean pbTransposed)
pad1DMatrix
- vector datapbTransposed
- true
if the transposed vector is desiredMethod Detail |
public final double getElement(int piPosition)
piPosition
- index to get the element from
public void setElement(int piPosition, double pdValue)
piPosition
- index to det the element atpdValue
- the element's valuepublic double getLength()
public marf.math.Vector add(marf.math.Vector poVector)
poVector
- V
public static marf.math.Vector add(marf.math.Vector poLHSVector, marf.math.Vector poRHSVector)
poLHSVector
- V1poRHSVector
- V2
public final marf.math.Vector getUnitVector()
public static marf.math.Vector getInnerProduct(marf.math.Vector poLHSVector, marf.math.Vector poRHSVector)
poLHSVector
- first vector, V1poRHSVector
- second vector, V2
public static marf.math.Vector getCrossProduct(marf.math.Vector poLHSVector, marf.math.Vector poRHSVector)
poLHSVector
- first vector, V1poRHSVector
- second vector, V2
public static double getDotProduct(marf.math.Vector poLHSVector, marf.math.Vector poRHSVector)
poLHSVector
- first vector, V1poRHSVector
- second vector, V2
public boolean isOrthogonal(marf.math.Vector poVector)
poVector
- another vector to compare to
true
if the vectors are orthogonalpublic void normalize()
public static final marf.math.Vector i()
public static final marf.math.Vector j()
public static final marf.math.Vector k()
public java.lang.Object clone()
clone
in class Matrix
Object.clone()
public static java.lang.String getMARFSourceCodeRevision()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |