|
|||||||||
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.QMatrix
public class QMatrix
Matrixes over rational numbers.
Constructor Summary | |
---|---|
QMatrix(int rows,
int cols)
Creates a rational rows x cols matrix
with all coefficients set to 0. |
|
QMatrix(int rows,
int cols,
Rational value)
Creates a rational rows x cols matrix
with all coefficients set to value . |
|
QMatrix(QMatrix m)
Creates a copy of the rational matrix m . |
|
QMatrix(Rational[] v)
Creates a nx1 rational matrix from the vector v ,
where n is the length of v . |
|
QMatrix(Rational[][] c)
Creates a rational matrix from the two-dimensional array c . |
|
QMatrix(ZMatrix m)
Creates a rational matrix copy of the integer matrix m . |
|
QMatrix(ZnMatrix m)
Creates a rational matrix copy of the modular integer matrix m . |
Method Summary | |
---|---|
QMatrix |
adjoint()
Returns the adjoint of this matrix. |
QMatrix |
affineDifference()
|
int |
compareTo(Matrix object)
Compares this matrix to object . |
void |
computeRREF()
Compute the reducted row echelon form of this matrix. |
Rational |
determinant()
Returns the determinant of this matrix. |
QMatrix |
difference(QMatrix m)
Returns the difference of this matrix and m . |
Rational |
dotProduct(QMatrix m)
|
boolean |
equals(java.lang.Object object)
|
Rational |
euclidean()
Returns the Euclidean norm of this matrix. |
Rational |
get(int row,
int col)
Returns the value at index row ,col . |
QMatrix |
getMinorMatrix(int row,
int col)
Returns the matrix containing all rows and all columns of this matrix except row and col . |
QMatrix |
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 QMatrix |
getUnitMatrix(int size)
Returns the unit complex matrix of the given size . |
QMatrix |
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. |
Rational |
minor(int row,
int col)
Returns the minor at row |
QMatrix |
power(int exponent)
Returns this matrix raised to exponent . |
QMatrix |
product(QMatrix m)
Returns the product of this matrix and m . |
Rational[] |
product(Rational[] vector)
Returns the product of this matrix with vector . |
QMatrix |
quadraticForm()
Returns the quadratic form of this matrix. |
int |
rank()
Returns the rank of this matrix. |
QMatrix |
scaled(Rational scalar)
Returns this matrix scaled by scalar . |
void |
set(int row,
int col,
Rational 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,
QMatrix m)
Sets the submatrix starting at row ,col
to the matrix m . |
void |
setToElementaryMatrix(Rational 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. |
Rational |
sum()
Returns the 1-norm of this matrix. |
QMatrix |
sum(QMatrix m)
Returns the sum of this matrix and m . |
QMatrix |
taylor(int exponent)
|
java.lang.String |
toString()
Returns a string representation of this matrix. |
QMatrix |
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 QMatrix(int rows, int cols)
rows
x cols
matrix
with all coefficients set to 0.
public QMatrix(int rows, int cols, Rational value)
rows
x cols
matrix
with all coefficients set to value
.
public QMatrix(QMatrix m)
m
.
public QMatrix(ZMatrix m)
m
.
public QMatrix(ZnMatrix m)
m
.
public QMatrix(Rational[] v)
v
,
where n is the length of v
.
public QMatrix(Rational[][] c)
c
.
Method Detail |
---|
public static QMatrix getUnitMatrix(int size)
size
.
public Rational get(int row, int col)
row
,col
.
public void set(int row, int col, Rational 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(Rational value)
value
.
public QMatrix getSubMatrix(int fromRow, int toRow, int fromCol, int toCol)
fromRow
to toRow
inclusive, and from fromCol
to
toCol
inclusive.
public QMatrix getMinorMatrix(int row, int col)
row
and col
.
public QMatrix transposed()
public QMatrix inverse()
java.lang.ArithmeticException
- if inverse does not existpublic QMatrix adjoint()
public QMatrix affineDifference()
public QMatrix quadraticForm()
public QMatrix scaled(Rational scalar)
scalar
.
public QMatrix power(int exponent)
exponent
.
java.lang.ArithmeticException
- if the matrix is not squarepublic QMatrix 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 Rational dotProduct(QMatrix m)
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, QMatrix m)
row
,col
to the matrix m
.
public void computeRREF()
public QMatrix sum(QMatrix m)
m
.
public QMatrix difference(QMatrix m)
m
.
public QMatrix product(QMatrix m)
m
.
public Rational[] product(Rational[] vector)
vector
.
public Rational determinant()
java.lang.ArithmeticException
- if this matrix is not squarepublic Rational minor(int row, int col)
row,col
.
public Rational euclidean()
public Rational 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 |