|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.rubato.math.matrix.Matrix
org.rubato.math.matrix.CMatrix
public class CMatrix
Matrixes over complex numbers.
Constructor Summary | |
---|---|
CMatrix(CMatrix m)
Creates a copy of the complex matrix m . |
|
CMatrix(Complex[] v)
Creates a nx1 complex matrix from the vector v ,
where n is the length of v . |
|
CMatrix(Complex[][] c)
Creates a complex matrix from the two-dimensional array c . |
|
CMatrix(int rows,
int cols)
Creates a complex rows x cols matrix
with all coefficients set to 0. |
|
CMatrix(int rows,
int cols,
Complex value)
Creates a complex rows x cols matrix
with all coefficients set to value . |
|
CMatrix(QMatrix m)
Creates a complex matrix copy of the rational matrix m . |
|
CMatrix(RMatrix m)
Creates a complex matrix copy of the real matrix m . |
|
CMatrix(ZMatrix m)
Creates a complex matrix copy of the integer matrix m . |
|
CMatrix(ZnMatrix m)
Creates a complex matrix copy of the modular integer matrix m . |
Method Summary | |
---|---|
CMatrix |
adjoint()
Returns the adjoint of this matrix. |
CMatrix |
affineDifference()
|
int |
compareTo(Matrix object)
Compares this matrix to object . |
void |
computeRREF()
Compute the reducted row echelon form of this matrix. |
Complex |
determinant()
Returns the determinant of this matrix. |
CMatrix |
difference(CMatrix m)
Returns the difference of this matrix and m . |
Complex |
dotProduct(CMatrix m)
Returns the dot product of this matrix and m ,
provided that both are column matrixes. |
boolean |
equals(java.lang.Object object)
|
Complex |
euclidean()
Returns the Euclidean norm of this matrix. |
Complex |
get(int row,
int col)
Returns the value at index row ,col . |
CMatrix |
getMinorMatrix(int row,
int col)
Returns the matrix containing all rows and all columns of this matrix except row and col . |
CMatrix |
getSubMatrix(int fromRow,
int toRow,
int fromCol,
int toCol)
Returns the submatrix containing all rows from fromRow
to toRow inclusive, and from fromCol to
toCol inclusive. |
static CMatrix |
getUnitMatrix(int size)
Returns the unit complex matrix of the given size . |
CMatrix |
inverse()
Returns the inverse of this matrix, if it exists. |
boolean |
isConstant()
Returns true iff the coefficients of this matrix are equal to a constant value. |
boolean |
isOne(int row,
int col)
Returns true iff the coefficient at row ,col is one. |
boolean |
isRegular()
Returns true iff this matrix is regular. |
boolean |
isUnit()
Returns true iff this is a unit matrix. |
boolean |
isZero()
Returns true iff this is a zero matrix. |
boolean |
isZero(int row,
int col)
Returns true iff the coefficient at row ,col is zero. |
Complex |
minor(int row,
int col)
Returns the minor at row |
CMatrix |
power(int exponent)
Returns this matrix raised to exponent . |
CMatrix |
product(CMatrix m)
Returns the product of this matrix and m . |
Complex[] |
product(Complex[] vector)
Returns the product of this matrix with vector . |
CMatrix |
quadraticForm()
Returns the quadratic form of this matrix. |
int |
rank()
Returns the rank of this matrix. |
CMatrix |
scaled(Complex scalar)
Returns this matrix scaled by scalar . |
void |
set(int row,
int col,
Complex value)
Sets index row ,col to value . |
void |
setColumnCount(int cols)
Resizes this matrix by changing the number of columns. |
void |
setRowCount(int rows)
Resizes this matrix by changing the number of rows. |
void |
setSubMatrix(int row,
int col,
CMatrix m)
Sets the submatrix starting at row ,col
to the matrix m . |
void |
setToElementaryMatrix(Complex value)
Sets all values of this matrix to value . |
void |
setToOne(int row,
int col)
Sets the coefficient at row ,col to one. |
void |
setToUnitMatrix()
Makes this matrix unit square. |
void |
setToZero(int row,
int col)
Sets the coefficient at row ,col to zero. |
void |
setToZeroMatrix()
Sets all coefficients to zero. |
Complex |
sum()
Returns the sum of all the coefficients of this matrix. |
CMatrix |
sum(CMatrix m)
Returns the sum of this matrix and m . |
CMatrix |
taylor(int exponent)
|
java.lang.String |
toString()
Returns a string representation of this matrix. |
CMatrix |
transposed()
Returns the transpose of this matrix. |
Methods inherited from class org.rubato.math.matrix.Matrix |
---|
getColumnCount, getRowCount, isSquare, isZeroColumn, isZeroRow, productPossible, productPossible, sameSize, sameSize |
Methods inherited from class java.lang.Object |
---|
getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public CMatrix(int rows, int cols)
rows
x cols
matrix
with all coefficients set to 0.
public CMatrix(int rows, int cols, Complex value)
rows
x cols
matrix
with all coefficients set to value
.
public CMatrix(CMatrix m)
m
.
public CMatrix(RMatrix m)
m
.
public CMatrix(QMatrix m)
m
.
public CMatrix(ZMatrix m)
m
.
public CMatrix(ZnMatrix m)
m
.
public CMatrix(Complex[] v)
v
,
where n is the length of v
.
public CMatrix(Complex[][] c)
c
.
Method Detail |
---|
public static CMatrix getUnitMatrix(int size)
size
.
public Complex get(int row, int col)
row
,col
.
public void set(int row, int col, Complex value)
row
,col
to value
.
public void setToZero(int row, int col)
Matrix
row
,col
to zero.
setToZero
in class Matrix
public void setToOne(int row, int col)
Matrix
row
,col
to one.
setToOne
in class Matrix
public void setRowCount(int rows)
Matrix
setRowCount
in class Matrix
public void setColumnCount(int cols)
Matrix
setColumnCount
in class Matrix
public void setToZeroMatrix()
Matrix
setToZeroMatrix
in class Matrix
public void setToUnitMatrix()
Matrix
setToUnitMatrix
in class Matrix
public void setToElementaryMatrix(Complex value)
value
.
public CMatrix getSubMatrix(int fromRow, int toRow, int fromCol, int toCol)
fromRow
to toRow
inclusive, and from fromCol
to
toCol
inclusive.
public CMatrix getMinorMatrix(int row, int col)
row
and col
.
public CMatrix transposed()
public CMatrix inverse()
java.lang.ArithmeticException
- if inverse does not existpublic CMatrix adjoint()
public CMatrix affineDifference()
public CMatrix quadraticForm()
public CMatrix scaled(Complex scalar)
scalar
.
public CMatrix power(int exponent)
exponent
.
java.lang.ArithmeticException
- if the matrix is not squarepublic CMatrix taylor(int exponent)
public int rank()
Matrix
rank
in class Matrix
public boolean isConstant()
Matrix
isConstant
in class Matrix
public boolean isZero()
Matrix
isZero
in class Matrix
public boolean isUnit()
Matrix
isUnit
in class Matrix
public boolean isRegular()
Matrix
isRegular
in class Matrix
public boolean isZero(int row, int col)
Matrix
row
,col
is zero.
isZero
in class Matrix
public boolean isOne(int row, int col)
Matrix
row
,col
is one.
isOne
in class Matrix
public Complex dotProduct(CMatrix m)
m
,
provided that both are column matrixes.
public boolean equals(java.lang.Object object)
equals
in class Matrix
public int compareTo(Matrix object)
Matrix
object
.
If object
is a matrix, but not of the same
type, then the strings representation are compared.
compareTo
in interface java.lang.Comparable<Matrix>
compareTo
in class Matrix
public void setSubMatrix(int row, int col, CMatrix m)
row
,col
to the matrix m
.
public void computeRREF()
public CMatrix sum(CMatrix m)
m
.
public CMatrix difference(CMatrix m)
m
.
public CMatrix product(CMatrix m)
m
.
public Complex[] product(Complex[] vector)
vector
.
public Complex determinant()
java.lang.ArithmeticException
- if this matrix is not squarepublic Complex minor(int row, int col)
row,col
.
public Complex euclidean()
public Complex sum()
public java.lang.String toString()
Matrix
toString
in class Matrix
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |