jv.vecmath
Interface PdMatrixIf
-
- All Known Implementing Classes:
- PdMatrix, PnMassMatrix, PnSparseMatrix, PnStiffAniso, PnStiffConformal, PnStiffDiriConforming, PnStiffDiriNonConforming, PnStiffMatrix, PnStiffSpring
public interface PdMatrixIfBasic interface to matrices enables simultaneous use of full and sparse matrices.Beta version.
- See Also:
PdMatrix- Author:
- Konrad Polthier, Christoph von Tycowicz
- Version:
- 20.03.10, 1.00 revised (kp)
20.03.10, 1.00 created (kp, cvt)
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method and Description voidaddEntry(int i, int j, double inc)Add value to component of matrix, and possibly enlarge matrix if too small.voidclear()Set all elements of the matrix to 0.doublegetEntry(int i, int j)Get the component of matrix.intgetNumCols()Get number of columns of matrix.intgetNumRows()Get number of rows of matrix.booleanisSquare()Check if matrix is square.PdVectorleftMultMatrix(PdVector out, PdVector in)Multiply this matrix with vector and fill output vector,out = this*in.doublemultQuadratic(PdVector left, PdVector right)Computeleft^T*this*right.voidmultScalar(double scalar)Multiply all matrix components with scalar.PdVectorrightMultMatrix(PdVector out, PdVector in)Multiply this matrix with vector and fill output vector,out = in*this.voidsetEntry(int i, int j, double value)Assign value to component of matrix, and possibly enlarge matrix if too small.voidtranspose()Transpose a square matrix,this = transpose(this).
-
-
-
Method Detail
-
getNumCols
int getNumCols()
Get number of columns of matrix.
-
getNumRows
int getNumRows()
Get number of rows of matrix.
-
getEntry
double getEntry(int i, int j)Get the component of matrix.
-
setEntry
void setEntry(int i, int j, double value)Assign value to component of matrix, and possibly enlarge matrix if too small.
-
addEntry
void addEntry(int i, int j, double inc)Add value to component of matrix, and possibly enlarge matrix if too small.
-
multScalar
void multScalar(double scalar)
Multiply all matrix components with scalar.
-
leftMultMatrix
PdVector leftMultMatrix(PdVector out, PdVector in)
Multiply this matrix with vector and fill output vector,out = this*in.. Matrix need not be square. Input vector must have same size as number of columns of this matrix. Method modifies size of output vector to number of rows of this matrix. If output vector is null then it is created.
-
rightMultMatrix
PdVector rightMultMatrix(PdVector out, PdVector in)
Multiply this matrix with vector and fill output vector,out = in*this.. Matrix need not be square. Input vector must have same size as number of rows of this matrix. Method modifies size of output vector to number of columns of this matrix. If output vector is null then it is created.
-
multQuadratic
double multQuadratic(PdVector left, PdVector right)
Computeleft^T*this*right. The matrix is interpreted as a quadratic form.- Parameters:
left- The left argument.right- The right argument.- Returns:
left^T*this*right.
-
isSquare
boolean isSquare()
Check if matrix is square.
-
transpose
void transpose()
Transpose a square matrix,this = transpose(this).
-
clear
void clear()
Set all elements of the matrix to 0.
-
-
"