marf.math
Class ComplexMatrix

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

public class ComplexMatrix
extends Matrix

Similarly to Matrix, this class implements nearly identical API but for operations on matrices with complex numbers.

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

Since:
0.3.0.6
Version:
$Revision: 1.12 $
Author:
Serguei Mokhov
See Also:
Matrix, Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class marf.math.Matrix
Matrix.Direction
 
Field Summary
protected  double[] adImaginaryMatrix
          The corresponding imaginary data to the real data array.
 
Fields inherited from class marf.math.Matrix
adMatrix, DEFAULT_COLS, DEFAULT_ERROR_DELTA, DEFAULT_ROWS, iCols, iRows
 
Constructor Summary
ComplexMatrix()
           
ComplexMatrix(ComplexMatrix poMatrix)
           
ComplexMatrix(ComplexNumber[] pao1DMatrix)
           
ComplexMatrix(ComplexNumber[][] paoo2DMatrix)
           
ComplexMatrix(ComplexNumber[] pao1DMatrix, boolean pbTransposed)
           
ComplexMatrix(double[] pad1DMatrix)
          Constructs a complex vector with zero imaginary part.
ComplexMatrix(double[][] padd2DMatrix)
           
ComplexMatrix(double[] pad1DMatrix, boolean pbTransposed)
           
ComplexMatrix(double[] padRealMatrix, double[] padImaginaryMatrix)
          Constructs a complex vector.
ComplexMatrix(int piRows, int piCols)
           
ComplexMatrix(int piRows, int piCols, ComplexNumber poFillValue)
           
ComplexMatrix(int piRows, int piCols, double pdFillValue)
           
ComplexMatrix(Matrix poMatrix)
           
 
Method Summary
static ComplexMatrix add(ComplexMatrix poLHSMatrix, ComplexMatrix poRHSMatrix)
          A convenience wrapper of Matrix.add().
static ComplexMatrix add(ComplexMatrix poLHSMatrix, ComplexNumber pdNum)
           
static ComplexMatrix add(ComplexMatrix poLHSMatrix, double pdNum)
           
static ComplexMatrix add(ComplexMatrix poLHSMatrix, Matrix poRHSMatrix)
           
 ComplexMatrix add(ComplexNumber poNum)
          Adds a complex scalar to the matrix: this = this + Z.
static ComplexMatrix add(Matrix poLHSMatrix, ComplexMatrix poRHSMatrix)
           
protected  Matrix applyAdd(Matrix poLHSMatrix, Matrix poRHSMatrix, int i, int j)
          Overrides the parent to apply complex number addition.
protected  Matrix applyMinus(Matrix poLHSMatrix, Matrix poRHSMatrix, int i, int j)
          Overrides the parent to apply complex number addition.
protected  Matrix applyMultiply(Matrix poLHSMatrix, Matrix poRHSMatrix)
           
protected  Matrix applyMultiply(Matrix poLHSMatrix, Matrix poRHSMatrix, int i, int j)
           
 java.lang.Object clone()
          Implements Clonable interface.
 boolean crop(int piLeft, int piTop, int piRight, int piBottom)
          A general routine that allows arbitrary cropping of a matrix.
static ComplexMatrix divide(ComplexMatrix poLHSMatrix, ComplexMatrix poRHSMatrix)
           
static ComplexMatrix divide(ComplexMatrix poLHSMatrix, Matrix poRHSMatrix)
           
 ComplexMatrix divide(ComplexNumber poNum)
          Divides the matrix by a complex scalar: this = this / Z.
 Matrix divide(double pdNum)
          this = this / d.
static ComplexMatrix divide(Matrix poLHSMatrix, ComplexMatrix poRHSMatrix)
           
 boolean equals(Matrix poMatrix)
          this == M.
 void exhaustMatrix()
          "Destroys" the internal array matrix by setting it to null.
 boolean extend(Matrix poExtensionMatrix, Matrix.Direction poDirection)
          Extends this matrix by another (by gluing two matrices together) given the extension direction.
 ComplexVector getComplexColumn(int piColNum)
           
 ComplexNumber getComplexDeterminant()
          Calculates complex determinant of this matrix using Laplace's formula.
 ComplexNumber getComplexElement(int piRow, int piCol)
          Retrieves complex matrix element's value given row and column.
static ComplexMatrix getComplexMatrix(Matrix poMatrix)
          Converts a real matrix into complex by making a copy.
protected  ComplexNumber getComplexNumber(int iRawOffset)
           
 ComplexVector getComplexRow(int piRowNum)
           
 double[] getImaginaryMatrixArray()
          Allows getting internal array represeting the imaginary matrix data.
 double[][] getMatrix2D()
          Returns internal matrix representation as 2-dimensional array of doubles.
protected  Matrix getNewMatrix()
           
protected  Matrix getNewMatrix(int piRows, int piCols)
           
 double[] getRealMatrixArray()
          Allows getting internal array represeting the real matrix data.
 boolean inverse()
          Matrix inversion.
 boolean isReduced()
          Allows examine if this matrix was row-reduced already.
 void loadColumn(int piColNum, ComplexVector poVector)
           
 void loadRow(int piRowNum, ComplexVector poVector)
           
 boolean makeIdentity()
          Makes current matrix an identity one.
static ComplexMatrix minus(ComplexMatrix poLHSMatrix, ComplexMatrix poRHSMatrix)
           
static ComplexMatrix minus(ComplexMatrix poLHSMatrix, Matrix poRHSMatrix)
           
 ComplexMatrix minus(ComplexNumber poNum)
          Subtracts a complex scalar from the matrix: this = this - Z.
 Matrix minus(double pdNum)
          Subtracts a scalar from the matrix's each element: this = this - N.
 Matrix minus(Matrix poMatrix)
          this = this - M.
static ComplexMatrix minus(Matrix poLHSMatrix, ComplexMatrix poRHSMatrix)
           
 ComplexMatrix multiply(ComplexMatrix poMatrix)
           
static ComplexMatrix multiply(ComplexMatrix poLHSMatrix, ComplexMatrix poRHSMatrix)
           
static ComplexMatrix multiply(ComplexMatrix poMatrix, double pdNum)
           
static ComplexMatrix multiply(ComplexMatrix poLHSMatrix, Matrix poRHSMatrix)
           
 ComplexMatrix multiply(ComplexNumber poNum)
          Multiplies the matrix by a complex scalar: this = this * Z.
static ComplexMatrix multiply(double pdNum, ComplexMatrix poMatrix)
           
static ComplexMatrix multiply(Matrix poLHSMatrix, ComplexMatrix poRHSMatrix)
           
 Vector multiply(Vector poVector)
          V1 = this * V.
static ComplexMatrix pow(ComplexMatrix poMatrix, int piPow)
           
 ComplexMatrix powComplex(int piPow)
           
 Vector rotate(Vector poPointToRotate, double[] padRotateFactors)
          Rotates a vector according to the given axis' factor and angle's degree.
 Vector rotate(Vector poPointToRotate, double pdRotateX, double pdRotateY, double pdRotateZ, double pdRotateAngle)
          Rotates a vector according to the given axis' factor and angle's degree.
 Vector rotate(Vector poPointToRotate, Vector poRotateFactors)
          Rotates a vector according to the given axis' factor and angle's degree.
 boolean rowOperation(ComplexNumber pdA, int piRc, char pcOp, ComplexNumber pdB, int piRp)
          Performs a specified linear row operation given the parameters.
 boolean rowReduce()
          Applies row-reduce operation in this matrix.
 Vector scale(Vector poPointToScale, double[] padScaleFactors)
          Returns a scaled vector.
 Vector scale(Vector poPointToScale, double pdScaleX, double pdScaleY, double pdScaleZ)
          Returns a scaled vector.
 Vector scale(Vector poPointToScale, Vector poScaleFactors)
          Returns a scaled vector.
 void setAll()
          Sets all elements of the matrix to a default of 0.0.
 void setAll(ComplexNumber poFillValue)
           
 void setAllRandom()
          Sets all elements of the matrix at pseudo-random order.
 void setComplexElement(int piRow, int piCol, ComplexNumber poValue)
           
protected  void setComplexNumber(int iRawOffset, ComplexNumber poNumber)
           
 void setImaginaryMatrixArray(double[] padNewMatrix)
           
 void setMatrix2D(ComplexNumber[][] paoo2DMatrix)
           
 void setRealMatrixArray(double[] padNewMatrix)
           
 Vector shear(Vector poPointToShear, double[] padShearFactors)
          Returns a sheared vector.
 Vector shear(Vector poPointToShear, double pdShearX, double pdShearY, double pdShearZ)
          Returns a sheared vector.
 Vector shear(Vector poPointToShear, Vector poShearFactors)
          Returns a sheared vector.
 java.lang.String toString()
          Textual representation of the matrix.
 Vector translate(Vector poPointToTranslate, double[] padTranslateVals)
          Translates a vector according to the given size.
 Vector translate(Vector poPointToTranslate, double pdTranslateX, double pdTranslateY, double pdTranslateZ)
          Translates a vector according to the given size.
 Vector translate(Vector poPointToTranslate, Vector poTranslateVals)
          Translates a vector according to the given size.
 boolean transpose()
          Matrix 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, getMARFSourceCodeRevision, 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

adImaginaryMatrix

protected double[] adImaginaryMatrix
The corresponding imaginary data to the real data array.

Constructor Detail

ComplexMatrix

public ComplexMatrix()

ComplexMatrix

public ComplexMatrix(int piRows,
                     int piCols)
Parameters:
piRows -
piCols -

ComplexMatrix

public ComplexMatrix(int piRows,
                     int piCols,
                     double pdFillValue)
Parameters:
piRows -
piCols -
pdFillValue -

ComplexMatrix

public ComplexMatrix(int piRows,
                     int piCols,
                     ComplexNumber poFillValue)
Parameters:
piRows -
piCols -
poFillValue -

ComplexMatrix

public ComplexMatrix(Matrix poMatrix)
Parameters:
poMatrix -

ComplexMatrix

public ComplexMatrix(ComplexMatrix poMatrix)
Parameters:
poMatrix -

ComplexMatrix

public ComplexMatrix(double[] pad1DMatrix)
Constructs a complex vector with zero imaginary part.

Parameters:
pad1DMatrix -

ComplexMatrix

public ComplexMatrix(double[] padRealMatrix,
                     double[] padImaginaryMatrix)
Constructs a complex vector.

Parameters:
padRealMatrix -
padImaginaryMatrix -

ComplexMatrix

public ComplexMatrix(ComplexNumber[] pao1DMatrix)

ComplexMatrix

public ComplexMatrix(double[] pad1DMatrix,
                     boolean pbTransposed)
Parameters:
pad1DMatrix -
pbTransposed -

ComplexMatrix

public ComplexMatrix(ComplexNumber[] pao1DMatrix,
                     boolean pbTransposed)
Parameters:
pao1DMatrix -
pbTransposed -

ComplexMatrix

public ComplexMatrix(double[][] padd2DMatrix)
Parameters:
padd2DMatrix -

ComplexMatrix

public ComplexMatrix(ComplexNumber[][] paoo2DMatrix)
Parameters:
paoo2DMatrix -
Method Detail

add

public ComplexMatrix add(ComplexNumber poNum)
Adds a complex scalar to the matrix: this = this + Z.

Parameters:
poNum - the scalar Z
Returns:
new value of this matrix

applyAdd

protected Matrix applyAdd(Matrix poLHSMatrix,
                          Matrix poRHSMatrix,
                          int i,
                          int j)
Overrides the parent to apply complex number addition.

Overrides:
applyAdd in class Matrix
See Also:
Matrix.applyAdd(marf.math.Matrix, marf.math.Matrix, int, int)

add

public static ComplexMatrix add(ComplexMatrix poLHSMatrix,
                                ComplexMatrix poRHSMatrix)
A convenience wrapper of Matrix.add().

Parameters:
poLHSMatrix -
poRHSMatrix -
Returns:
See Also:
Matrix.add(Matrix, Matrix)

add

public static ComplexMatrix add(Matrix poLHSMatrix,
                                ComplexMatrix poRHSMatrix)
Parameters:
poLHSMatrix -
poRHSMatrix -
Returns:

add

public static ComplexMatrix add(ComplexMatrix poLHSMatrix,
                                Matrix poRHSMatrix)
Parameters:
poLHSMatrix -
poRHSMatrix -
Returns:

minus

public static ComplexMatrix minus(ComplexMatrix poLHSMatrix,
                                  ComplexMatrix poRHSMatrix)
Parameters:
poLHSMatrix -
poRHSMatrix -
Returns:

minus

public static ComplexMatrix minus(Matrix poLHSMatrix,
                                  ComplexMatrix poRHSMatrix)
Parameters:
poLHSMatrix -
poRHSMatrix -
Returns:

minus

public static ComplexMatrix minus(ComplexMatrix poLHSMatrix,
                                  Matrix poRHSMatrix)
Parameters:
poLHSMatrix -
poRHSMatrix -
Returns:

multiply

public static ComplexMatrix multiply(ComplexMatrix poLHSMatrix,
                                     ComplexMatrix poRHSMatrix)
Parameters:
poLHSMatrix -
poRHSMatrix -
Returns:

multiply

public static ComplexMatrix multiply(Matrix poLHSMatrix,
                                     ComplexMatrix poRHSMatrix)
Parameters:
poLHSMatrix -
poRHSMatrix -
Returns:

multiply

public static ComplexMatrix multiply(ComplexMatrix poLHSMatrix,
                                     Matrix poRHSMatrix)
Parameters:
poLHSMatrix -
poRHSMatrix -
Returns:

divide

public static ComplexMatrix divide(ComplexMatrix poLHSMatrix,
                                   ComplexMatrix poRHSMatrix)
Parameters:
poLHSMatrix -
poRHSMatrix -
Returns:

divide

public static ComplexMatrix divide(Matrix poLHSMatrix,
                                   ComplexMatrix poRHSMatrix)
Parameters:
poLHSMatrix -
poRHSMatrix -
Returns:

divide

public static ComplexMatrix divide(ComplexMatrix poLHSMatrix,
                                   Matrix poRHSMatrix)
Parameters:
poLHSMatrix -
poRHSMatrix -
Returns:

add

public static ComplexMatrix add(ComplexMatrix poLHSMatrix,
                                double pdNum)
Parameters:
poLHSMatrix -
pdNum -
Returns:

add

public static ComplexMatrix add(ComplexMatrix poLHSMatrix,
                                ComplexNumber pdNum)
Parameters:
poLHSMatrix -
pdNum -
Returns:

multiply

public static ComplexMatrix multiply(ComplexMatrix poMatrix,
                                     double pdNum)
Parameters:
poMatrix -
pdNum -
Returns:

multiply

public static ComplexMatrix multiply(double pdNum,
                                     ComplexMatrix poMatrix)
Parameters:
pdNum -
poMatrix -
Returns:

pow

public static ComplexMatrix pow(ComplexMatrix poMatrix,
                                int piPow)
Parameters:
poMatrix -
piPow -
Returns:

powComplex

public ComplexMatrix powComplex(int piPow)
Parameters:
piPow -
Returns:

applyMinus

protected Matrix applyMinus(Matrix poLHSMatrix,
                            Matrix poRHSMatrix,
                            int i,
                            int j)
Overrides the parent to apply complex number addition.

Overrides:
applyMinus in class Matrix
See Also:
Matrix.applyAdd(marf.math.Matrix, marf.math.Matrix, int, int)

applyMultiply

protected Matrix applyMultiply(Matrix poLHSMatrix,
                               Matrix poRHSMatrix,
                               int i,
                               int j)
Overrides:
applyMultiply in class Matrix

applyMultiply

protected Matrix applyMultiply(Matrix poLHSMatrix,
                               Matrix poRHSMatrix)
Overrides:
applyMultiply in class Matrix

getComplexMatrix

public static ComplexMatrix getComplexMatrix(Matrix poMatrix)
Converts a real matrix into complex by making a copy. If the parameter is already a complex matrix; then just cast it and return it.

Parameters:
poMatrix -
Returns:

minus

public ComplexMatrix minus(ComplexNumber poNum)
Subtracts a complex scalar from the matrix: this = this - Z.

Parameters:
poNum - the scalar Z
Returns:
new value of this matrix

multiply

public ComplexMatrix multiply(ComplexNumber poNum)
Multiplies the matrix by a complex scalar: this = this * Z.

Parameters:
poNum - the scalar Z
Returns:
new value of this matrix

divide

public ComplexMatrix divide(ComplexNumber poNum)
Divides the matrix by a complex scalar: this = this / Z.

Parameters:
poNum - the scalar Z
Returns:
new value of this matrix

getComplexNumber

protected ComplexNumber getComplexNumber(int iRawOffset)
Parameters:
iRawOffset -
Returns:

setComplexNumber

protected void setComplexNumber(int iRawOffset,
                                ComplexNumber poNumber)
Parameters:
iRawOffset -
poNumber -

clone

public java.lang.Object clone()
Description copied from class: Matrix
Implements Clonable interface. Creates a deep copy of the object by cloning the internal matrix array.

Overrides:
clone in class Matrix
Returns:
object copy of this matrix
See Also:
Matrix.clone()

crop

public boolean crop(int piLeft,
                    int piTop,
                    int piRight,
                    int piBottom)
Description copied from class: Matrix
A general routine that allows arbitrary cropping of a matrix. The cropping rectangle specified by the parameters is (left, top) - (right, bottom) -- anything inside is kept including the borders, all of the outside is thrown out.

Overrides:
crop in class Matrix
Parameters:
piLeft - left index border to crop after
piTop - top index border to crop after
piRight - right index border to crop after
piBottom - bottom index border to crop after
Returns:
true if the cropping was successful
See Also:
Matrix.crop(int, int, int, int)

getNewMatrix

protected Matrix getNewMatrix()
Overrides:
getNewMatrix in class Matrix
Returns:

getNewMatrix

protected Matrix getNewMatrix(int piRows,
                              int piCols)
Overrides:
getNewMatrix in class Matrix
Returns:

divide

public Matrix divide(double pdNum)
Description copied from class: Matrix
this = this / d.

Overrides:
divide in class Matrix
Parameters:
pdNum - d

equals

public boolean equals(Matrix poMatrix)
Description copied from class: Matrix
this == M.

Overrides:
equals in class Matrix
Parameters:
poMatrix - M
Returns:
true if this and parameter matrices are equal
See Also:
Matrix.equals(marf.math.Matrix)

exhaustMatrix

public void exhaustMatrix()
Description copied from class: Matrix
"Destroys" the internal array matrix by setting it to null. Also, the garbage collector is hinted to collect as soon as it can with System.gc(). If called very often, may actually slowdown the system during the garbage collection runs. The cardinality of the matrix is not affected and a new instance of it is not created; use setMatrixArray() to set the new matrix data.

Overrides:
exhaustMatrix in class Matrix
See Also:
Matrix.exhaustMatrix()

extend

public boolean extend(Matrix poExtensionMatrix,
                      Matrix.Direction poDirection)
Description copied from class: Matrix
Extends this matrix by another (by gluing two matrices together) given the extension direction. NOTICE, if doubling the same matrix, make a copy for the argument instead.

Overrides:
extend in class Matrix
Parameters:
poExtensionMatrix - the matrix to extend the current by
poDirection - in which direction the extension should happen
Returns:
true if the operation was successful
See Also:
Matrix.extend(marf.math.Matrix, marf.math.Matrix.Direction)

getMatrix2D

public double[][] getMatrix2D()
Description copied from class: Matrix
Returns internal matrix representation as 2-dimensional array of doubles.

Overrides:
getMatrix2D in class Matrix
Returns:
2-dimensional array of doubles

getRealMatrixArray

public final double[] getRealMatrixArray()
Allows getting internal array represeting the real matrix data. It is equivalent to getMatrixArray().

Returns:
inner array of doubles
See Also:
Matrix.getMatrixArray()

getImaginaryMatrixArray

public final double[] getImaginaryMatrixArray()
Allows getting internal array represeting the imaginary matrix data. It is equivalent to getMatrixArray().

Returns:
inner array of doubles

getComplexElement

public final ComplexNumber getComplexElement(int piRow,
                                             int piCol)
Retrieves complex matrix element's value given row and column.

Parameters:
piRow - row index of the element
piCol - column index of the element
Returns:
element's value
Throws:
java.lang.ArrayIndexOutOfBoundsException - if at least one of the indices is out of range

getComplexDeterminant

public final ComplexNumber getComplexDeterminant()
Calculates complex determinant of this matrix using Laplace's formula. Also, det(0) = 0, i.e. a square matrix of 0x0 has a determinant of zero. See this for details.

Returns:
the determinant value

inverse

public boolean inverse()
Description copied from class: Matrix
Matrix inversion.

Overrides:
inverse in class Matrix
Returns:
true if matrix was possible to invert, false otherwise

isReduced

public boolean isReduced()
Description copied from class: Matrix
Allows examine if this matrix was row-reduced already.

Overrides:
isReduced in class Matrix
Returns:
true if the matrix if row-reduced
See Also:
Matrix.isReduced()

loadColumn

public void loadColumn(int piColNum,
                       ComplexVector poVector)
See Also:
Matrix.loadColumn(int, marf.math.Vector)

getComplexColumn

public ComplexVector getComplexColumn(int piColNum)
Parameters:
piColNum -
Returns:

loadRow

public void loadRow(int piRowNum,
                    ComplexVector poVector)
See Also:
Matrix.loadRow(int, marf.math.Vector)

getComplexRow

public ComplexVector getComplexRow(int piRowNum)
Parameters:
piRowNum -
Returns:

makeIdentity

public boolean makeIdentity()
Description copied from class: Matrix
Makes current matrix an identity one.

Overrides:
makeIdentity in class Matrix
Returns:
true if the operation completed successfully
See Also:
Matrix.makeIdentity()

minus

public Matrix minus(double pdNum)
Description copied from class: Matrix
Subtracts a scalar from the matrix's each element: this = this - N.

Overrides:
minus in class Matrix
Parameters:
pdNum - the scalar

minus

public Matrix minus(Matrix poMatrix)
Description copied from class: Matrix
this = this - M.

Overrides:
minus in class Matrix
Parameters:
poMatrix - M
Returns:
a copy of this matrix after subtraction

multiply

public ComplexMatrix multiply(ComplexMatrix poMatrix)
Parameters:
poMatrix -
Returns:
See Also:
Matrix.multiply(marf.math.Matrix)

multiply

public Vector multiply(Vector poVector)
Description copied from class: Matrix
V1 = this * V.

Overrides:
multiply in class Matrix
Parameters:
poVector - V
Returns:
V1

rotate

public Vector rotate(Vector poPointToRotate,
                     double pdRotateX,
                     double pdRotateY,
                     double pdRotateZ,
                     double pdRotateAngle)
Description copied from class: Matrix
Rotates a vector according to the given axis' factor and angle's degree.

Overrides:
rotate in class Matrix
Parameters:
poPointToRotate - the vector of objects to be rotated.
pdRotateX - the X axis rotated factor of double
pdRotateY - the Y axis rotated factor of double
pdRotateZ - the Z axis rotated factor of double
pdRotateAngle - the rotate angle of degree around one axis
Returns:
a rotated Vector

rotate

public Vector rotate(Vector poPointToRotate,
                     double[] padRotateFactors)
Description copied from class: Matrix
Rotates a vector according to the given axis' factor and angle's degree.

Overrides:
rotate in class Matrix
Parameters:
poPointToRotate - the vector of objects to be rotated.
padRotateFactors - the Array of doubles that contains the vector's rotating values
Returns:
a rotated Vector

rotate

public Vector rotate(Vector poPointToRotate,
                     Vector poRotateFactors)
Description copied from class: Matrix
Rotates a vector according to the given axis' factor and angle's degree.

Overrides:
rotate in class Matrix
Parameters:
poPointToRotate - the vector of objects to be rotated
poRotateFactors - the vector of objects that contains the vector's rotating factors
Returns:
a rotated Vector

rowOperation

public boolean rowOperation(ComplexNumber pdA,
                            int piRc,
                            char pcOp,
                            ComplexNumber pdB,
                            int piRp)
Performs a specified linear row operation given the parameters.

Parameters:
pdA - A
piRc - Rc
pcOp - operation ('+' or '-')
pdB - B
piRp - Rb
Returns:
true if the operation was successful

rowReduce

public boolean rowReduce()
Description copied from class: Matrix
Applies row-reduce operation in this matrix.

Overrides:
rowReduce in class Matrix
Returns:
true if the operation was successful
See Also:
Matrix.rowReduce()

scale

public Vector scale(Vector poPointToScale,
                    double pdScaleX,
                    double pdScaleY,
                    double pdScaleZ)
Description copied from class: Matrix
Returns a scaled vector.

Overrides:
scale in class Matrix
Parameters:
poPointToScale - the vector of objects to be scaled.
pdScaleX - the X axis scaled factor of double
pdScaleY - the Y axis scaled factor of double
pdScaleZ - the Z axis scaled factor of double
Returns:
a scaled vector

scale

public Vector scale(Vector poPointToScale,
                    double[] padScaleFactors)
Description copied from class: Matrix
Returns a scaled vector.

Overrides:
scale in class Matrix
Parameters:
poPointToScale - the vector of objects to be scaled.
padScaleFactors - the array of doubles containing the vector's scaling factors
Returns:
a scaled vector

scale

public Vector scale(Vector poPointToScale,
                    Vector poScaleFactors)
Description copied from class: Matrix
Returns a scaled vector.

Overrides:
scale in class Matrix
Parameters:
poPointToScale - the vector of objects to be scaled.
poScaleFactors - the vector of objects containing the vector's scaling factors
Returns:
a scaled vector

setAll

public void setAll()
Description copied from class: Matrix
Sets all elements of the matrix to a default of 0.0.

Overrides:
setAll in class Matrix
See Also:
Matrix.setAll()

setAll

public void setAll(ComplexNumber poFillValue)
See Also:
Matrix.setAll(double)

setAllRandom

public void setAllRandom()
Description copied from class: Matrix
Sets all elements of the matrix at pseudo-random order. Used primarily for testing. The range of the values is [- Double.MAX_VALUE / 2, Double.MAX_VALUE / 2].

Overrides:
setAllRandom in class Matrix
See Also:
Matrix.setAllRandom()

setComplexElement

public void setComplexElement(int piRow,
                              int piCol,
                              ComplexNumber poValue)
See Also:
Matrix.setElement(int, int, double)

setMatrix2D

public void setMatrix2D(ComplexNumber[][] paoo2DMatrix)
Parameters:
paoo2DMatrix -

setRealMatrixArray

public void setRealMatrixArray(double[] padNewMatrix)
Parameters:
padNewMatrix -
See Also:
Matrix.setMatrixArray(double[])

setImaginaryMatrixArray

public void setImaginaryMatrixArray(double[] padNewMatrix)
Parameters:
padNewMatrix -

shear

public Vector shear(Vector poPointToShear,
                    double pdShearX,
                    double pdShearY,
                    double pdShearZ)
Description copied from class: Matrix
Returns a sheared vector.

Overrides:
shear in class Matrix
Parameters:
poPointToShear - the vector of objects to be sheared
pdShearX - the X axis sheared factor of double
pdShearY - the Y axis sheared factor of double
pdShearZ - the Z axis sheared factor of double
Returns:
a sheared vector

shear

public Vector shear(Vector poPointToShear,
                    double[] padShearFactors)
Description copied from class: Matrix
Returns a sheared vector.

Overrides:
shear in class Matrix
Parameters:
poPointToShear - the vector of objects to be sheared
padShearFactors - the array of doubles containing the vector's shearing factors
Returns:
a sheared vector

shear

public Vector shear(Vector poPointToShear,
                    Vector poShearFactors)
Description copied from class: Matrix
Returns a sheared vector.

Overrides:
shear in class Matrix
Parameters:
poPointToShear - the vector of objects to be sheared.
poShearFactors - the vector of objects containing the vector's shearing factors
Returns:
a sheared vector

toString

public java.lang.String toString()
Description copied from class: Matrix
Textual representation of the matrix.

Overrides:
toString in class Matrix
Returns:
String representation

translate

public Vector translate(Vector poPointToTranslate,
                        double pdTranslateX,
                        double pdTranslateY,
                        double pdTranslateZ)
Description copied from class: Matrix
Translates a vector according to the given size.

Overrides:
translate in class Matrix
Parameters:
poPointToTranslate - the vector of objects to be translated.
pdTranslateX - the X axis translated factor of double
pdTranslateY - the Y axis translated factor of double
pdTranslateZ - the Z axis translated factor of double
Returns:
a translated Vector

translate

public Vector translate(Vector poPointToTranslate,
                        double[] padTranslateVals)
Description copied from class: Matrix
Translates a vector according to the given size.

Overrides:
translate in class Matrix
Parameters:
poPointToTranslate - the vector of objects to be translated.
padTranslateVals - the Array of doubles that contains the vector's translating values
Returns:
a translated Vector

translate

public Vector translate(Vector poPointToTranslate,
                        Vector poTranslateVals)
Description copied from class: Matrix
Translates a vector according to the given size.

Overrides:
translate in class Matrix
Parameters:
poPointToTranslate - the vector of objects to be translated.
poTranslateVals - the vector of objects that contains the vector's translating values
Returns:
a translated Vector

transpose

public boolean transpose()
Description copied from class: Matrix
Matrix transpose.

Overrides:
transpose in class Matrix
Returns:
true if matrix was transposed, false otherwise


SourceForge Logo