marf.math
Class ComplexVector

java.lang.Object
  extended by marf.math.Matrix
      extended by marf.math.ComplexMatrix
          extended by marf.math.ComplexVector
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable

public class ComplexVector
extends ComplexMatrix

Algebraic operations on ComplexVectors.

NOTE: this class has the same considerations as marf.math.ComplexMatrix.

$Id: ComplexVector.java,v 1.3 2007/12/18 03:45:42 mokhov Exp $

Since:
0.3.0.6
Version:
$Revision: 1.3 $
Author:
Serguei A. Mokhov
See Also:
ComplexMatrix, Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class marf.math.Matrix
Matrix.Direction
 
Field Summary
static int DEFAULT_VECTOR_LENGTH
          Default ComplexVector's length is 3 elements.
 
Fields inherited from class marf.math.ComplexMatrix
adImaginaryMatrix
 
Fields inherited from class marf.math.Matrix
adMatrix, DEFAULT_COLS, DEFAULT_ERROR_DELTA, DEFAULT_ROWS, iCols, iRows
 
Constructor Summary
ComplexVector()
          Constructs a ComplexVector of default length of 3.
ComplexVector(ComplexVector poComplexVector)
          Constructs a ComplexVector from another ComplexVector; a-la copy conctructor.
ComplexVector(double[] padComplexVectorData)
          Constructs a ComplexVector out of a raw array of doubles.
ComplexVector(double[] pad1DMatrix, boolean pbTransposed)
          Allows having a transposed ComplexVector upon construction.
ComplexVector(int piComplexVectorLength)
          Constructs a ComplexVector with the specified length.
ComplexVector(Matrix poMatrix)
          Constructs a ComplexVector 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.
 
Method Summary
 ComplexVector add(ComplexVector poComplexVector)
          V1 = this + V.
static ComplexVector add(ComplexVector poLHSComplexVector, ComplexVector poRHSComplexVector)
          V3 = V1 + V2.
 java.lang.Object clone()
          Implements Clonable interface.
 ComplexNumber getComplexElement(int piPosition)
           
static ComplexVector getCrossProduct(ComplexVector poLHSComplexVector, ComplexVector poRHSComplexVector)
          Calculates the cross product of two ComplexVectors, V3 = V1 x V2.
static double getDotProduct(ComplexVector poLHSComplexVector, ComplexVector poRHSComplexVector)
          Calculates the dot product of two ComplexVectors, d = V1 * V2.
 double getElement(int piPosition)
          Allows getting the value of ComplexVector's element at specified position.
static ComplexVector getInnerProduct(ComplexVector poLHSComplexVector, ComplexVector poRHSComplexVector)
          Calculates an inner product of two ComplexVectors, V3 = V1 * V2.
 double getLength()
          Retrieves the mathematical length of the ComplexVector.
static java.lang.String getMARFSourceCodeRevision()
          Retrieves class' revision.
 ComplexVector getUnitComplexVector()
          Returns a unit-ComplexVector representation of this ComplexVector.
static ComplexVector i()
          Creates a unit-ComplexVector "i".
 boolean isOrthogonal(ComplexVector poComplexVector)
          Tells whether this and the parameter ComplexVectors are orthogonal or not.
static ComplexVector j()
          Creates a unit-ComplexVector "j".
static ComplexVector k()
          Creates a unit-ComplexVector "k".
 void normalize()
          Normalizes the ComplexVector's components by its length.
 void setElement(int piPosition, double pdValue)
          Allows setting the value of ComplexVector's element at specified position.
 
Methods inherited from class marf.math.ComplexMatrix
add, add, add, add, add, add, applyAdd, applyMinus, applyMultiply, applyMultiply, crop, divide, divide, divide, divide, divide, equals, exhaustMatrix, extend, getComplexColumn, getComplexDeterminant, getComplexElement, getComplexMatrix, getComplexNumber, getComplexRow, getImaginaryMatrixArray, getMatrix2D, getNewMatrix, getNewMatrix, getRealMatrixArray, inverse, isReduced, loadColumn, loadRow, makeIdentity, minus, minus, minus, minus, minus, minus, multiply, multiply, multiply, multiply, multiply, multiply, multiply, multiply, pow, powComplex, rotate, rotate, rotate, rowOperation, rowReduce, scale, scale, scale, setAll, setAll, setAllRandom, setComplexElement, setComplexNumber, setImaginaryMatrixArray, setMatrix2D, setRealMatrixArray, shear, shear, shear, toString, translate, translate, translate, transpose
 
Methods inherited from class marf.math.Matrix
add, add, add, crop, cutColumn, cutFirstColumn, cutFirstRow, cutLastColumn, cutLastRow, cutRow, display, divide, divide, equals, equals, extend, extend, getCols, getColumn, getDeterminant, getElement, getElements, getMatrixArray, getRow, getRows, isIdentity, isNearlyIdentity, isNearlyIdentity, loadColumn, loadRow, minus, minus, minusUnary, multiply, multiply, multiply, multiply, multiply, multiply, pow, pow, rowOperation, rowOperation, setAll, setCols, setElement, setMatrix2D, setMatrixArray, setRows, size
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT_VECTOR_LENGTH

public static final int DEFAULT_VECTOR_LENGTH
Default ComplexVector's length is 3 elements.

See Also:
Constant Field Values
Constructor Detail

ComplexVector

public ComplexVector()
Constructs a ComplexVector of default length of 3.


ComplexVector

public ComplexVector(int piComplexVectorLength)
Constructs a ComplexVector with the specified length.

Parameters:
piComplexVectorLength - require ComplexVector length

ComplexVector

public ComplexVector(ComplexVector poComplexVector)
Constructs a ComplexVector from another ComplexVector; a-la copy conctructor.

Parameters:
poComplexVector - a ComplexVector to make a copy of

ComplexVector

public ComplexVector(Matrix poMatrix)
Constructs a ComplexVector 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.

Parameters:
poMatrix - base matrix to construct the ComplexVector from

ComplexVector

public ComplexVector(double[] padComplexVectorData)
Constructs a ComplexVector out of a raw array of doubles.

Parameters:
padComplexVectorData - source data for the ComplexVector

ComplexVector

public ComplexVector(double[] pad1DMatrix,
                     boolean pbTransposed)
Allows having a transposed ComplexVector upon construction. Useful for example before doing linear operations.

Parameters:
pad1DMatrix - ComplexVector data
pbTransposed - true if the transposed ComplexVector is desired
Method Detail

getElement

public final double getElement(int piPosition)
Allows getting the value of ComplexVector's element at specified position.

Parameters:
piPosition - index to get the element from
Returns:
ComplexVector element's value

getComplexElement

public final ComplexNumber getComplexElement(int piPosition)
Parameters:
piPosition -
Returns:

setElement

public void setElement(int piPosition,
                       double pdValue)
Allows setting the value of ComplexVector's element at specified position.

Parameters:
piPosition - index to det the element at
pdValue - the element's value

getLength

public double getLength()
Retrieves the mathematical length of the ComplexVector.

Returns:
the length value

add

public ComplexVector add(ComplexVector poComplexVector)
V1 = this + V.

Parameters:
poComplexVector - V
Returns:
V1

add

public static ComplexVector add(ComplexVector poLHSComplexVector,
                                ComplexVector poRHSComplexVector)
V3 = V1 + V2.

Parameters:
poLHSComplexVector - V1
poRHSComplexVector - V2
Returns:
V3

getUnitComplexVector

public final ComplexVector getUnitComplexVector()
Returns a unit-ComplexVector representation of this ComplexVector. This ComplexVector remains intact, instead a "unitized" copy is returned.

Returns:
corresponding unit ComplexVector

getInnerProduct

public static ComplexVector getInnerProduct(ComplexVector poLHSComplexVector,
                                            ComplexVector poRHSComplexVector)
Calculates an inner product of two ComplexVectors, V3 = V1 * V2.

Parameters:
poLHSComplexVector - first ComplexVector, V1
poRHSComplexVector - second ComplexVector, V2
Returns:
the inner product ComplexVector of the two, V3

getCrossProduct

public static ComplexVector getCrossProduct(ComplexVector poLHSComplexVector,
                                            ComplexVector poRHSComplexVector)
Calculates the cross product of two ComplexVectors, V3 = V1 x V2. TODO: complete all cases.

Parameters:
poLHSComplexVector - first ComplexVector, V1
poRHSComplexVector - second ComplexVector, V2
Returns:
the cross product, V3

getDotProduct

public static double getDotProduct(ComplexVector poLHSComplexVector,
                                   ComplexVector poRHSComplexVector)
Calculates the dot product of two ComplexVectors, d = V1 * V2.

Parameters:
poLHSComplexVector - first ComplexVector, V1
poRHSComplexVector - second ComplexVector, V2
Returns:
the dot product, d

isOrthogonal

public boolean isOrthogonal(ComplexVector poComplexVector)
Tells whether this and the parameter ComplexVectors are orthogonal or not.

Parameters:
poComplexVector - another ComplexVector to compare to
Returns:
true if the ComplexVectors are orthogonal

normalize

public void normalize()
Normalizes the ComplexVector's components by its length.


i

public static final ComplexVector i()
Creates a unit-ComplexVector "i".

Returns:
a new ComplexVector instante of {1, 0, 0}

j

public static final ComplexVector j()
Creates a unit-ComplexVector "j".

Returns:
a new ComplexVector instante of {0, 1, 0}

k

public static final ComplexVector k()
Creates a unit-ComplexVector "k".

Returns:
a new ComplexVector instante of {0, 0, 1}

clone

public java.lang.Object clone()
Implements Clonable interface. Creates a deep copy of the object by cloning the internal matrix array.

Overrides:
clone in class ComplexMatrix
Returns:
object copy of this ComplexVector
See Also:
Object.clone()

getMARFSourceCodeRevision

public static java.lang.String getMARFSourceCodeRevision()
Retrieves class' revision.

Returns:
revision string


SourceForge Logo