|
JavaView© v3.95.000 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjv.vecmath.PdMatrix
Linear algebra class for small matrices of doubles.
For methods on large matrices see PnMatrix.
PnMatrix,
Serialized Form| Field Summary | |
double[][] |
m_data
Data array containing the components of the vector. |
| Constructor Summary | |
PdMatrix()
Create a new matrix of zero size. |
|
PdMatrix(double[][] x)
Constructs a matrix having same size and given initial data as given array. |
|
PdMatrix(int aSize)
Create a square matrix with given dimension. |
|
PdMatrix(int iSize,
int jSize)
Create a non-square matrix with given dimensions. |
|
| Method Summary | |
void |
add(PdMatrix m)
|
void |
add(PdMatrix m1,
PdMatrix m2)
|
boolean |
adjoint(PdVector v)
Compute this = v * v^t unsing adjoint(v, v). |
boolean |
adjoint(PdVector v,
PdVector w)
Compute this = v * w^t. |
java.lang.Object |
clone()
Duplicate matrix and data array. |
void |
copy(PdMatrix m)
|
static boolean |
copy(PdMatrix[] dataDest,
int destInd,
PdMatrix[] dataSrc,
int srcInd,
int size)
|
static PdMatrix |
copyNew(PdMatrix mat)
Create a new matrix as clone of argument matrix. |
static PdMatrix[] |
copyNew(PdMatrix[] data)
|
static PdMatrix[] |
copyNew(PdMatrix[] data,
int size)
|
double |
det()
Compute determinant square matrix with dimensions less or equal four. |
double |
det33()
Compute determinant of (3*3) left upper block of matrix. |
static PdMatrix |
expandComponents(PdMatrix mat,
int dim)
Create a bigger matrix such that each original entry expands to a (dim, dim)-diagonal matrix. |
PdVector |
getColumn(int aColumn)
Get column vector of matrix. |
double[][] |
getEntries()
Return a copy of content of matrix as array of arrays of doubles. |
double |
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. |
PdVector |
getRow(int aRow)
Get row vector of matrix. |
int |
getSize()
Get dimension of square matrix, return -1 for non-square matrices. |
boolean |
invert()
Invert a square matrix of dimension less than five by this = inverse(this). |
boolean |
invert(PdMatrix m)
Invert a square matrix of dimension less than five by this = inverse(m). |
boolean |
invert34(PdMatrix m)
Invert the top-left 3x4 square of a matrix44 in place. |
boolean |
invertTopLeft(PdMatrix m,
int aSubSize)
Invert the top-left subSize x subSize square of a matrix m in place and assign full matrix m to this matrix. |
boolean |
isSquare()
Check if matrix is square. |
void |
leftMult(PdMatrix m)
Multiply with square matrix from left of same sizes using this = m*this.
|
void |
leftMult(PdMatrix m,
int size)
Multiply a submatrix of this matrix with a submatrix of the parameter matrix. |
void |
mult(PdMatrix mat1,
PdMatrix mat2)
Multiply two matrices of possibly different sizes using this = mat1*mat2.
|
void |
multScalar(double scalar)
|
void |
multScalar(PdMatrix m,
double scalar)
|
static PdMatrix[] |
realloc(PdMatrix[] data,
int arraySize)
|
static PdMatrix[] |
realloc(PdMatrix[] data,
int arraySize,
int iSize,
int jSize)
|
void |
rightMult(PdMatrix m)
Multiply with square matrix from right of same sizes using this = this*m.
|
void |
rightMult(PdMatrix m,
int size)
Multiply a submatrix of this matrix with a submatrix of the parameter matrix. |
void |
set(double[][] x)
Assign values of array, and adjust length of matrix if different from length of array. |
void |
setColumn(int aColumn,
PdVector aVector)
Set column vector of matrix. |
void |
setColumns(PdVector[] aVector)
Fill matrix with array of column vectors. |
void |
setConstant(double aValue)
Set all matrix entries to a constant value. |
void |
setDiagonal(PdVector diag)
Set diagonal entries of a square matrix to components of a given vector. |
void |
setEntry(int i,
int j,
double value)
Assign value to component of matrix, and possibly enlarge matrix if too small. |
void |
setIdentity()
Initialize square matrix to be identity matrix. |
void |
setRow(int aRow,
PdVector aVector)
Set row vector of matrix. |
void |
setRows(PdVector[] aVector)
Fill matrix with array of row vectors. |
void |
setSize(int size)
Resize square matrix with new dimension (size,size). |
void |
setSize(int iSize,
int jSize)
Resize matrix to new dimension (iSize, jSize). |
void |
sub(PdMatrix m)
|
void |
sub(PdMatrix m1,
PdMatrix m2)
|
java.lang.String |
toShortString()
Create a short string representation of matrix with all instance variables. |
java.lang.String |
toString()
Create a multi-line string representation with detailed information about all instance variables. |
void |
transpose()
Transpose a square matrix by this = transpose(this). |
void |
transpose(PdMatrix m)
Transpose a square matrix by this = transpose(m). |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public double[][] m_data
| Constructor Detail |
public PdMatrix()
public PdMatrix(int aSize)
public PdMatrix(int iSize,
int jSize)
public PdMatrix(double[][] x)
| Method Detail |
public static PdMatrix[] realloc(PdMatrix[] data,
int arraySize,
int iSize,
int jSize)
public static PdMatrix[] realloc(PdMatrix[] data,
int arraySize)
public java.lang.Object clone()
copyNew(PdMatrix).
copyNew(PdMatrix)public static PdMatrix[] copyNew(PdMatrix[] data)
public static PdMatrix[] copyNew(PdMatrix[] data,
int size)
public static PdMatrix copyNew(PdMatrix mat)
public static boolean copy(PdMatrix[] dataDest,
int destInd,
PdMatrix[] dataSrc,
int srcInd,
int size)
public void set(double[][] x)
public int getISize()
public int getJSize()
public int getSize()
public void setSize(int size)
public void setSize(int iSize,
int jSize)
public double[][] getEntries()
public double getEntry(int i,
int j)
public void setEntry(int i,
int j,
double value)
public boolean isSquare()
public void setIdentity()
public void setConstant(double aValue)
public void setDiagonal(PdVector diag)
diag - Vector with diagonal componentspublic PdVector getRow(int aRow)
public void setRow(int aRow,
PdVector aVector)
public PdVector getColumn(int aColumn)
public void setColumn(int aColumn,
PdVector aVector)
public void setRows(PdVector[] aVector)
public void setColumns(PdVector[] aVector)
public void add(PdMatrix m)
public void add(PdMatrix m1,
PdMatrix m2)
public void sub(PdMatrix m)
public void sub(PdMatrix m1,
PdMatrix m2)
public void copy(PdMatrix m)
public void multScalar(double scalar)
public void multScalar(PdMatrix m,
double scalar)
public double det()
public double det33()
public void leftMult(PdMatrix m,
int size)
m - parameter matrixsize - size of square sub matrix affected within this.public void leftMult(PdMatrix m)
this = m*this.
Size of 'this' does not change.
public void rightMult(PdMatrix m,
int size)
m - parameter matrixsize - size of square sub matrix affected within this.public void rightMult(PdMatrix m)
this = this*m.
Size of 'this' does not change.
public void mult(PdMatrix mat1,
PdMatrix mat2)
this = mat1*mat2.
Size of 'this' is adjusted to have number of rows equal to first factor
and number of columns equal to second factor.
public void transpose()
this = transpose(this).
public void transpose(PdMatrix m)
this = transpose(m).
public boolean invert()
this = inverse(this).
public boolean invert(PdMatrix m)
this = inverse(m).
false if error occured, and if arg is singular call this.setIdentity().
public boolean invertTopLeft(PdMatrix m,
int aSubSize)
public boolean invert34(PdMatrix m)
public boolean adjoint(PdVector v)
this = v * v^t unsing adjoint(v, v).
public boolean adjoint(PdVector v,
PdVector w)
public java.lang.String toString()
public java.lang.String toShortString()
public static PdMatrix expandComponents(PdMatrix mat,
int dim)
|
JavaView© v3.95.000 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||