|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectmaspack.matrix.MatrixObject
maspack.matrix.Matrix4dObject
maspack.matrix.Matrix4d
A general 4 x 4 matrix with the elements stored as explicit fields.
Field Summary |
Fields inherited from class maspack.matrix.Matrix4dObject |
m00, m01, m02, m03, m10, m11, m12, m13, m20, m21, m22, m23, m30, m31, m32, m33 |
Constructor Summary | |
Matrix4d()
Creates a matrix and initializes it to zero. |
|
Matrix4d(double[] vals)
Creates a matrix and initializes its elements from an array of values. |
|
Matrix4d(MatrixObject M)
Creates a matrix and initializes its elements to those of the matrix M. |
Method Summary | |
void |
add(Matrix4dObject M1)
Adds this matrix to M1 and places the result in this matrix. |
void |
add(Matrix4dObject M1,
Matrix4dObject M2)
Adds matrix M1 to M2 and places the result in this matrix. |
boolean |
invert(Matrix4dObject M)
Inverts the matrix M and places the result in this matrix, return false if M is detected to be singular. The inverse is computed using an LU decomposition with partial pivoting. |
void |
mul(Matrix4dObject M1)
Multiplies this matrix by M1 and places the result in this matrix. |
void |
mul(Matrix4dObject M1,
Matrix4dObject M2)
Multiplies matrix M1 by M2 and places the result in this matrix. |
void |
mulInverse(Matrix4dObject M1)
Multiplies this matrix by the inverse of M1 and places the result in this matrix. |
boolean |
mulInverseBoth(Matrix4dObject M1,
Matrix4dObject M2)
Multiplies the inverse of matrix M1 by the inverse of M2 and places the result in this matrix. |
boolean |
mulInverseLeft(Matrix4dObject M1,
Matrix4dObject M2)
Multiplies the inverse of matrix M1 by M2 and places the result in this matrix. |
boolean |
mulInverseRight(Matrix4dObject M1,
Matrix4dObject M2)
Multiplies matrix M1 by the inverse of M2 and places the result in this matrix. |
void |
mulTranspose(Matrix4dObject M1)
Multiplies this matrix by the transpose of M1 and places the result in this matrix. |
void |
mulTransposeBoth(Matrix4dObject M1,
Matrix4dObject M2)
Multiplies the transpose of matrix M1 by the transpose of M2 and places the result in this matrix. |
void |
mulTransposeLeft(Matrix4dObject M1,
Matrix4dObject M2)
Multiplies the transpose of matrix M1 by M2 and places the result in this matrix. |
void |
mulTransposeRight(Matrix4dObject M1,
Matrix4dObject M2)
Multiplies matrix M1 by the transpose of M2 and places the result in this matrix. |
void |
negate(Matrix4dObject M1)
Sets this matrix to the negative of M1. |
void |
scale(double s)
Scales the elements of this matrix by s . |
void |
scale(double s,
Matrix4dObject M1)
Scales the elements of matrix M1 by s and places
the results in this matrix. |
void |
setDiagonal(double[] vals)
Sets this matrix to a diagonal matrix whose values are specified by the array vals. |
void |
setDiagonal(Vector4d diag)
Sets this matrix to a diagonal matrix whose values are specified by diag. |
void |
setRandom()
Sets the elements of this matrix to uniformly distributed random values in the range -0.5 (inclusive) to 0.5 (exclusive). |
void |
setRandom(double lower,
double upper)
Sets the elements of this matrix to uniformly distributed random values in a specified range. |
void |
setRandom(double lower,
double upper,
java.util.Random generator)
Sets the elements of this matrix to uniformly distributed random values in a specified range, using a supplied random number generator. |
void |
setZero()
Sets the elements of this matrix to zero. |
void |
sub(Matrix4dObject M1)
Subtracts this matrix from M1 and places the result in this matrix. |
void |
sub(Matrix4dObject M1,
Matrix4dObject M2)
Subtracts matrix M1 from M2 and places the result in this matrix. |
void |
transpose(Matrix4dObject M1)
Takes the transpose of matrix M1 and places the result in this matrix. |
Methods inherited from class maspack.matrix.Matrix4dObject |
colSize, determinant, epsilonEquals, equals, frobeniusNorm, get, get, getColumn, getColumn, getRow, getRow, infinityNorm, invert, mul, mul, mulInverse, mulInverse, mulInverseTranspose, mulInverseTranspose, mulTranspose, mulTranspose, negate, oneNorm, rowSize, set, set, set, setColumn, setColumn, setIdentity, setRow, setRow, transpose |
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 |
Constructor Detail |
public Matrix4d()
public Matrix4d(double[] vals)
vals
- element values for the matrix, with element (i,j)
stored at location i*4+j
public Matrix4d(MatrixObject M)
M
- matrix object to be copied.Method Detail |
public void mul(Matrix4dObject M1)
public void mul(Matrix4dObject M1, Matrix4dObject M2)
public void mulTranspose(Matrix4dObject M1)
public void mulTransposeLeft(Matrix4dObject M1, Matrix4dObject M2)
public void mulTransposeRight(Matrix4dObject M1, Matrix4dObject M2)
public void mulTransposeBoth(Matrix4dObject M1, Matrix4dObject M2)
public void mulInverse(Matrix4dObject M1)
M1
- right-hand matrix
public boolean mulInverseRight(Matrix4dObject M1, Matrix4dObject M2)
M1
- left-hand matrixM2
- right-hand matrix
public boolean mulInverseLeft(Matrix4dObject M1, Matrix4dObject M2)
M1
- left-hand matrixM2
- right-hand matrix
public boolean mulInverseBoth(Matrix4dObject M1, Matrix4dObject M2)
M1
- left-hand matrixM2
- right-hand matrix
public void add(Matrix4dObject M1, Matrix4dObject M2)
M1
- left-hand matrixM2
- right-hand matrixpublic void add(Matrix4dObject M1)
M1
- right-hand matrixpublic void sub(Matrix4dObject M1, Matrix4dObject M2)
M1
- left-hand matrixM2
- right-hand matrixpublic void sub(Matrix4dObject M1)
M1
- right-hand matrixpublic void scale(double s)
s
.
s
- scaling factorpublic void scale(double s, Matrix4dObject M1)
s
and places
the results in this matrix.
s
- scaling factorM1
- matrix to be scaledpublic void negate(Matrix4dObject M1)
M1
- matrix to negatepublic void transpose(Matrix4dObject M1)
public void setZero()
public void setRandom()
public void setRandom(double lower, double upper)
lower
- lower random value (inclusive)upper
- upper random value (exclusive)public void setRandom(double lower, double upper, java.util.Random generator)
lower
- lower random value (inclusive)upper
- upper random value (exclusive)generator
- random number generatorpublic boolean invert(Matrix4dObject M)
public void setDiagonal(Vector4d diag)
diag
- diagonal valuespublic void setDiagonal(double[] vals)
vals
- diagonal values
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |