public class Matrix4d extends Matrix4dBase
Matrix.Partition, Matrix.WriteFormat
Modifier and Type | Field and Description |
---|---|
static Matrix4d |
IDENTITY
Global identity matrix.
|
static Matrix4d |
ZERO
Global zero matrix.
|
m00, m01, m02, m03, m10, m11, m12, m13, m20, m21, m22, m23, m30, m31, m32, m33
INDEFINITE, POSITIVE_DEFINITE, SPD, SYMMETRIC
Constructor and Description |
---|
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(Matrix M)
Creates a matrix and initializes its elements to those of the matrix M.
|
Modifier and Type | Method and Description |
---|---|
void |
add(Matrix4dBase M1)
Adds this matrix to M1 and places the result in this matrix.
|
void |
add(Matrix4dBase M1,
Matrix4dBase M2)
Adds matrix M1 to M2 and places the result in this matrix.
|
Matrix4d |
clone() |
boolean |
invert(Matrix4dBase M)
Inverts the matrix M and places the result in this matrix, return false if
M is detected to be singular.
|
void |
mul(Matrix4dBase M1)
Multiplies this matrix by M1 and places the result in this matrix.
|
void |
mul(Matrix4dBase M1,
Matrix4dBase M2)
Multiplies matrix M1 by M2 and places the result in this matrix.
|
boolean |
mulInverse(Matrix4dBase M1)
Multiplies this matrix by the inverse of M1 and places the result in this
matrix.
|
boolean |
mulInverseBoth(Matrix4dBase M1,
Matrix4dBase M2)
Multiplies the inverse of matrix M1 by the inverse of M2 and places the
result in this matrix.
|
boolean |
mulInverseLeft(Matrix4dBase M1,
Matrix4dBase M2)
Multiplies the inverse of matrix M1 by M2 and places the result in this
matrix.
|
boolean |
mulInverseRight(Matrix4dBase M1,
Matrix4dBase M2)
Multiplies matrix M1 by the inverse of M2 and places the result in this
matrix.
|
void |
mulTranspose(Matrix4dBase M1)
Multiplies this matrix by the transpose of M1 and places the result in
this matrix.
|
void |
mulTransposeBoth(Matrix4dBase M1,
Matrix4dBase M2)
Multiplies the transpose of matrix M1 by the transpose of M2 and places
the result in this matrix.
|
void |
mulTransposeLeft(Matrix4dBase M1,
Matrix4dBase M2)
Multiplies the transpose of matrix M1 by M2 and places the result in this
matrix.
|
void |
mulTransposeRight(Matrix4dBase M1,
Matrix4dBase M2)
Multiplies matrix M1 by the transpose of M2 and places the result in this
matrix.
|
void |
negate(Matrix4dBase 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,
Matrix4dBase M1)
Scales the elements of matrix M1 by
s and places the
results in this matrix. |
void |
scaledAdd(double s,
Matrix4dBase M1)
Computes s M1 and adds the result to this matrix.
|
void |
scaledAdd(double s,
Matrix4dBase M1,
Matrix4dBase M2)
Computes s M1 + M2 and places the result in this matrix.
|
void |
setColumns(Vector4d v0,
Vector4d v1,
Vector4d v2,
Vector4d v3)
Sets the columns of this matrix to the vectors v0, v1, v2, and v3.
|
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 |
setRows(Vector4d v0,
Vector4d v1,
Vector4d v2,
Vector4d v3)
Sets the rows of this matrix to the vectors v0, v1, v2, and v3.
|
void |
setZero()
Sets the elements of this matrix to zero.
|
void |
sub(Matrix4dBase M1)
Subtracts this matrix from M1 and places the result in this matrix.
|
void |
sub(Matrix4dBase M1,
Matrix4dBase M2)
Subtracts matrix M1 from M2 and places the result in this matrix.
|
void |
transpose(Matrix4dBase M1)
Sets this matrix to the transpose of M
|
colSize, determinant, epsilonEquals, equals, frobeniusNorm, get, get, getColumn, getColumn, getColumn, getRow, getRow, getRow, infinityNorm, invert, mul, mul, mul, mulAdd, mulInverse, mulInverse, mulInverseTranspose, mulInverseTranspose, mulTranspose, mulTranspose, negate, oneNorm, rowSize, set, set, set, setColumn, setColumn, setIdentity, setRow, setRow, transpose
add, checkConsistency, set, set, set, set, setCCSValues, setColumn, setCRSValues, setRow, setSubMatrix
containsNaN, epsilonEquals, equals, frobeniusNormSquared, get, getCCSIndices, getCCSIndices, getCCSIndices, getCCSValues, getCCSValues, getCCSValues, getColumn, getCRSIndices, getCRSIndices, getCRSIndices, getCRSValues, getCRSValues, getCRSValues, getDefaultFormat, getRow, getSize, getSubMatrix, hasNaN, idString, isFixedSize, isSymmetric, maxNorm, mul, mul, mulAdd, mulAdd, mulAdd, mulTranspose, mulTranspose, mulTranspose, mulTransposeAdd, mulTransposeAdd, mulTransposeAdd, numNonZeroVals, numNonZeroVals, scan, setCRSValues, setDefaultFormat, setSize, toString, toString, toString, trace, write, write, write, write, write, write, writeToFile
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
epsilonEquals, equals, frobeniusNormSquared, getCCSIndices, getCCSIndices, getCCSIndices, getCCSValues, getCCSValues, getCCSValues, getColumn, getCRSIndices, getCRSIndices, getCRSIndices, getCRSValues, getCRSValues, getCRSValues, getRow, getSize, getSubMatrix, isFixedSize, isSymmetric, maxNorm, mul, mul, mulAdd, mulAdd, mulAdd, mulTranspose, mulTranspose, mulTranspose, mulTransposeAdd, mulTransposeAdd, mulTransposeAdd, numNonZeroVals, numNonZeroVals, scan, setSize, toString, toString, trace, write, write, write
public static final Matrix4d IDENTITY
public static final Matrix4d ZERO
public Matrix4d()
public Matrix4d(double[] vals)
vals
- element values for the matrix, with element (i,j) stored at location
i*4+j
public Matrix4d(Matrix M)
M
- matrix object to be copied.public void setColumns(Vector4d v0, Vector4d v1, Vector4d v2, Vector4d v3)
v0
- values for the first columnv1
- values for the second columnv2
- values for the third columnv3
- values for the fourth columnpublic void setRows(Vector4d v0, Vector4d v1, Vector4d v2, Vector4d v3)
v0
- values for the first rowv1
- values for the second rowv2
- values for the third rowv3
- values for the fourth rowpublic void mul(Matrix4dBase M1)
M1
- right-hand matrixpublic void mul(Matrix4dBase M1, Matrix4dBase M2)
M1
- left-hand matrixM2
- right-hand matrixpublic void mulTranspose(Matrix4dBase M1)
M1
- right-hand matrixpublic void mulTransposeLeft(Matrix4dBase M1, Matrix4dBase M2)
M1
- left-hand matrixM2
- right-hand matrixpublic void mulTransposeRight(Matrix4dBase M1, Matrix4dBase M2)
M1
- left-hand matrixM2
- right-hand matrixpublic void mulTransposeBoth(Matrix4dBase M1, Matrix4dBase M2)
M1
- left-hand matrixM2
- right-hand matrixpublic boolean mulInverse(Matrix4dBase M1)
M1
- right-hand matrixpublic boolean mulInverseRight(Matrix4dBase M1, Matrix4dBase M2)
M1
- left-hand matrixM2
- right-hand matrixpublic boolean mulInverseLeft(Matrix4dBase M1, Matrix4dBase M2)
M1
- left-hand matrixM2
- right-hand matrixpublic boolean mulInverseBoth(Matrix4dBase M1, Matrix4dBase M2)
M1
- left-hand matrixM2
- right-hand matrixpublic void add(Matrix4dBase M1, Matrix4dBase M2)
M1
- left-hand matrixM2
- right-hand matrixpublic void add(Matrix4dBase M1)
M1
- right-hand matrixpublic void sub(Matrix4dBase M1, Matrix4dBase M2)
M1
- left-hand matrixM2
- right-hand matrixpublic void sub(Matrix4dBase M1)
M1
- right-hand matrixpublic void scale(double s)
s
.s
- scaling factorpublic void scale(double s, Matrix4dBase M1)
s
and places the
results in this matrix.s
- scaling factorM1
- matrix to be scaledpublic void scaledAdd(double s, Matrix4dBase M1, Matrix4dBase M2)
s
- scaling factorM1
- matrix to be scaledM2
- matrix to be addedpublic void scaledAdd(double s, Matrix4dBase M1)
s
- scaling factorM1
- matrix to be scaled and addedpublic void negate(Matrix4dBase M1)
M1
- matrix to negatepublic void transpose(Matrix4dBase M1)
M1
- matrix to take the transpose ofpublic 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(Matrix4dBase M)
M
- matrix to invertpublic void setDiagonal(Vector4d diag)
diag
- diagonal valuespublic void setDiagonal(double[] vals)
vals
- diagonal valuespublic Matrix4d clone()
clone
in interface Clonable
clone
in class Matrix4dBase