jv.vecmath

Interface PdMatrixIf

• Method Summary

Methods
Modifier and Type Method and Description
void addEntry(int i, int j, double inc)
Add value to component of matrix, and possibly enlarge matrix if too small.
void clear()
Set all elements of the matrix to 0.
double getEntry(int i, int j)
Get the component of matrix.
int getNumCols()
Get number of columns of matrix.
int getNumRows()
Get number of rows of matrix.
boolean isSquare()
Check if matrix is square.
PdVector leftMultMatrix(PdVector out, PdVector in)
Multiply this matrix with vector and fill output vector, out = this*in.
Compute left^T*this*right.
void multScalar(double scalar)
Multiply all matrix components with scalar.
PdVector rightMultMatrix(PdVector out, PdVector in)
Multiply this matrix with vector and fill output vector, out = in*this.
void setEntry(int i, int j, double value)
Assign value to component of matrix, and possibly enlarge matrix if too small.
void transpose()
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.

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.

PdVector right)
Compute left^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.