public class PcMatrix
extends java.lang.Object
implements java.io.Serializable
PdMatrix
,
Serialized FormModifier and Type | Field and Description |
---|---|
PuComplex[][] |
m_data
Data array containing the components of the vector.
|
Constructor and Description |
---|
PcMatrix()
Create a new matrix of zero size.
|
PcMatrix(int aSize)
Create a square matrix with given dimension.
|
PcMatrix(int iSize,
int jSize)
Create a non-square matrix with given dimensions.
|
Modifier and Type | Method and Description |
---|---|
PcMatrix |
add(PcMatrix m) |
PcMatrix |
add(PcMatrix m1,
PcMatrix m2) |
PuComplex[] |
aEigenvector(PuComplex l)
Matrix must be 2x2.
|
java.lang.Object |
clone()
Duplicate matrix and data array.
|
PcMatrix |
copy(PcMatrix m) |
static PcMatrix |
copyNew(PcMatrix mat)
Create a new matrix as clone of argument matrix.
|
PuComplex |
determinant()
Computes the determinant of the matrix.
|
PuComplex[] |
eigenvalues()
Compute the eigenvalues of a 2x2 matrix.
|
PuComplex |
getEntry(int i,
int j)
Get the component of matrix.
|
int |
getISize()
Get number of rows of matrix.
|
int |
getJSize()
Get number of columns of matrix.
|
int |
getSize()
Get dimension of square matrix, return -1 for non-square matrices.
|
PcMatrix |
inverse()
Computes the inverse of 'this'
|
boolean |
isSquare()
Check if matrix is square.
|
PcMatrix |
leftMult(PcMatrix m)
Multiply with square matrix from left of same sizes using
this = m*this . |
PuComplex |
minor(int i,
int j)
Computes the determinant of the matrix obtained by
deleting 'i'th row and 'j'th column.
|
PcMatrix |
minorMatrix(int row,
int col)
Computes the matrix obtained by deleting row 'row' and column 'col'.
|
PcMatrix |
mult(PcMatrix m1,
PcMatrix m2)
Multiply two matrices of possibly different sizes using
this = m1*m2 . |
static PcMatrix |
multNew(PcMatrix m1,
PcMatrix m2)
Return product of two matrices
m1*m2 . |
PcMatrix |
multScalar(PcMatrix m,
PuComplex scalar) |
PcMatrix |
multScalar(PuComplex scalar) |
PcMatrix |
rightMult(PcMatrix m)
Multiply with square matrix from right of same sizes using
this = this*m . |
PcMatrix |
setConstant(PuComplex aValue)
Set all matrix entries to a constant value.
|
void |
setEntry(int i,
int j,
PuComplex value)
Assign value to component of matrix, and possibly enlarge matrix if too small.
|
PcMatrix |
setIdentity()
Initialize square matrix to be identity matrix.
|
void |
setSize(int aSize)
Set dimension of square matrix.
|
void |
setSize(int iSize,
int jSize)
Set dimension of non-square matrix.
|
PcMatrix |
sub(PcMatrix m) |
PcMatrix |
sub(PcMatrix m1,
PcMatrix m2) |
java.lang.String |
toShortString()
Deprecated.
use toString()
|
java.lang.String |
toString()
Create a string representation of matrix.
|
PcMatrix |
transpose()
Transpose a square matrix by
this = transpose(this) . |
public PuComplex[][] m_data
public PcMatrix()
public PcMatrix(int aSize)
public PcMatrix(int iSize, int jSize)
public java.lang.Object clone()
copyNew(PcMatrix)
.clone
in class java.lang.Object
copyNew(PcMatrix)
public static PcMatrix copyNew(PcMatrix mat)
public int getISize()
public int getJSize()
public int getSize()
public void setSize(int aSize)
public void setSize(int iSize, int jSize)
public PuComplex getEntry(int i, int j)
public void setEntry(int i, int j, PuComplex value)
public boolean isSquare()
public PcMatrix setIdentity()
public PcMatrix setConstant(PuComplex aValue)
public PcMatrix leftMult(PcMatrix m)
this = m*this
.
Size of 'this' does not change.public PcMatrix rightMult(PcMatrix m)
this = this*m
.
Size of 'this' does not change.public PcMatrix mult(PcMatrix m1, PcMatrix m2)
this = m1*m2
.
Size of 'this' is adjusted to have number of rows equal to first factor
and number of columns equal to second factor.public static PcMatrix multNew(PcMatrix m1, PcMatrix m2)
m1*m2
.public PcMatrix transpose()
this = transpose(this)
.public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toShortString()
public PuComplex[] eigenvalues()
public PcMatrix minorMatrix(int row, int col)
public PuComplex minor(int i, int j)
public PuComplex determinant()
public PcMatrix inverse()
"