|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectmaspack.matrix.MatrixObject
maspack.matrix.Matrix3dObject
Base class for 3 x 3 matrices in which the elements are stored as explicit fields. A primary motivation for such objects is computational speed.
Field Summary | |
double |
m00
Matrix element (0,0) |
double |
m01
Matrix element (0,1) |
double |
m02
Matrix element (0,2) |
double |
m10
Matrix element (1,0) |
double |
m11
Matrix element (1,1) |
double |
m12
Matrix element (1,2) |
double |
m20
Matrix element (2,0) |
double |
m21
Matrix element (2,1) |
double |
m22
Matrix element (2,2) |
Constructor Summary | |
Matrix3dObject()
|
Method Summary | |
int |
colSize()
Returns the number of columns in this matrix (which is always 3). |
double |
determinant()
Returns the determinant of this matrix |
boolean |
epsilonEquals(Matrix3dObject M1,
double epsilon)
Returns true if the elements of this matrix equal those of matrix M1 within a
prescribed tolerance epsilon . |
boolean |
equals(Matrix3dObject M1)
Returns true if the elements of this matrix exactly equal those of matrix M1 . |
double |
frobeniusNorm()
Returns the Frobenius norm of this matrix. |
void |
get(double[] values)
Copies the elements of this matrix into an array of doubles. The elements are stored using row-major order, so that element (i,j) is stored at
location i*colSize()+j . |
double |
get(int i,
int j)
Gets a single element of this matrix. |
void |
getColumn(int j,
double[] values)
Copies a column of this matrix into an array of doubles. |
void |
getColumn(int j,
Vector3d col)
Copies a column of this matrix into a 3-vector. |
void |
getRow(int i,
double[] values)
Copies a row of this matrix into an array of doubles. |
void |
getRow(int i,
Vector3d row)
Copies a row of this matrix into a 3-vector. |
double |
infinityNorm()
Returns the infinity norm of this matrix. |
boolean |
invert()
Inverts this matrix in place, returning false if the matrix is detected to be singular. |
void |
mul(Vector3d vr)
Multiplies this matrix by the column vector vr and places the result back into vr. |
void |
mul(Vector3d vr,
Vector3d v1)
Multiplies this matrix by the column vector v1 and places the result in the vector vr. |
boolean |
mulInverse(Vector3d vr)
Multiplies the column vector vr by the inverse of this matrix and places the result back in vr. |
boolean |
mulInverse(Vector3d vr,
Vector3d v1)
Multiplies the column vector v1 by the inverse of this matrix and places the result in vr. |
boolean |
mulInverseTranspose(Vector3d vr)
Multiplies the column vector vr by the inverse transpose of this matrix and places the result back in vr. |
boolean |
mulInverseTranspose(Vector3d vr,
Vector3d v1)
Multiplies the column vector v1 by the inverse transpose of this matrix and places the result in vr. |
void |
mulTranspose(Vector3d vr)
Multiplies the transpose of this matrix by the vector vr and places the result back in vr. |
void |
mulTranspose(Vector3d vr,
Vector3d v1)
Multiplies the transpose of this matrix by the vector v1 and places the result in vr. |
void |
negate()
Negates this matrix in place. |
double |
oneNorm()
Returns the 1 norm of this matrix. |
int |
rowSize()
Returns the number of rows in this matrix (which is always 3). |
void |
set(double[] vals)
Sets the elements of this matrix from an array of doubles. The elements in the array should be stored using row-major order, so that element (i,j) is stored at location
i*colSize()+j . |
void |
set(int i,
int j,
double value)
Sets a single element of this matrix. |
void |
set(Matrix3dObject M)
Sets the values of this matrix to those of matrix M. |
void |
setColumn(int j,
double[] values)
Sets a column of this matrix from an array of doubles. |
void |
setColumn(int j,
Vector3d col)
Sets a column of this matrix to the specified 3-vector. |
void |
setIdentity()
Sets this matrix to the identity. |
void |
setRow(int i,
double[] values)
Set a row of this matrix from an array of doubles. |
void |
setRow(int i,
Vector3d row)
Sets a row of this matrix to the specified 3-vector. |
void |
transpose()
Transposes this matrix in place. |
Methods inherited from class maspack.matrix.MatrixObject |
epsilonEquals, equals, equals, get, getColumn, getRow, isFixedSize, scan, set, set, setColumn, setRow, setSize, toString, toString, toString |
Methods inherited from class java.lang.Object |
getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public double m00
public double m01
public double m02
public double m10
public double m11
public double m12
public double m20
public double m21
public double m22
Constructor Detail |
public Matrix3dObject()
Method Detail |
public final int rowSize()
rowSize
in class MatrixObject
public final int colSize()
colSize
in class MatrixObject
public double get(int i, int j)
get
in class MatrixObject
i
- element row indexj
- element column index
public void get(double[] values)
(i,j)
is stored at
location i*colSize()+j
.
get
in class MatrixObject
values
- array into which values are copiedpublic void getColumn(int j, double[] values)
getColumn
in class MatrixObject
j
- column indexvalues
- array into which the column is copiedpublic void getColumn(int j, Vector3d col)
j
- column indexcol
- 3-vector into which the column is copiedpublic void getRow(int i, double[] values)
getRow
in class MatrixObject
i
- row indexvalues
- array into which the row is copiedpublic void getRow(int i, Vector3d row)
i
- row indexrow
- 3-vector into which the row is copiedpublic final void set(int i, int j, double value)
set
in class MatrixObject
i
- element row indexj
- element column indexvalue
- element valuepublic void set(double[] vals)
(i,j)
is stored at location
i*colSize()+j
.
set
in class MatrixObject
vals
- array from which values are copiedpublic void setColumn(int j, double[] values)
setColumn
in class MatrixObject
j
- column indexvalues
- array from which column values are copiedpublic void setColumn(int j, Vector3d col)
j
- column indexcol
- 3-vector from which the column is copiedpublic void setRow(int i, double[] values)
setRow
in class MatrixObject
i
- row indexvalues
- array from which the row is copiedpublic void setRow(int i, Vector3d row)
i
- row indexrow
- 3-vector from which the row is copiedpublic void set(Matrix3dObject M)
M
- matrix whose values are to be copiedpublic void mul(Vector3d vr, Vector3d v1)
vr = M v1
vr
- result vectorv1
- vector to multiply bypublic void mul(Vector3d vr)
vr = M vr
vr
- vector to multiply (in place)public void mulTranspose(Vector3d vr, Vector3d v1)
vr = v1 M
vr
- result vectorv1
- vector to multiply bypublic void mulTranspose(Vector3d vr)
vr = vr M
vr
- vector to multiply by (in place)public boolean mulInverse(Vector3d vr, Vector3d v1)
vr
- result vectorv1
- vector to multiply by
public boolean mulInverse(Vector3d vr)
vr
- vector to multiply by (in place)
public boolean mulInverseTranspose(Vector3d vr, Vector3d v1)
vr
- result vectorv1
- vector to multiply by
public boolean mulInverseTranspose(Vector3d vr)
vr
- vector to multiply by (in place)
public void negate()
public void transpose()
public void setIdentity()
public boolean epsilonEquals(Matrix3dObject M1, double epsilon)
M1
within a
prescribed tolerance epsilon
.
M1
- matrix to compare withepsilon
- comparison tolerance
public boolean equals(Matrix3dObject M1)
M1
.
M1
- matrix to compare with
public double infinityNorm()
infinityNorm
in class MatrixObject
public double oneNorm()
oneNorm
in class MatrixObject
public double frobeniusNorm()
frobeniusNorm
in class MatrixObject
public boolean invert()
public double determinant() throws ImproperSizeException
determinant
in class MatrixObject
ImproperSizeException
- if the matrix is not square
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |