public abstract class Matrix4dBase extends DenseMatrixBase implements Clonable
Matrix.Partition, Matrix.WriteFormat
Modifier and Type | Field and Description |
---|---|
double |
m00
Matrix element (0,0)
|
double |
m01
Matrix element (0,1)
|
double |
m02
Matrix element (0,2)
|
double |
m03
Matrix element (0,3)
|
double |
m10
Matrix element (1,0)
|
double |
m11
Matrix element (1,1)
|
double |
m12
Matrix element (1,2)
|
double |
m13
Matrix element (1,3)
|
double |
m20
Matrix element (2,0)
|
double |
m21
Matrix element (2,1)
|
double |
m22
Matrix element (2,2)
|
double |
m23
Matrix element (2,3)
|
double |
m30
Matrix element (3,0)
|
double |
m31
Matrix element (3,1)
|
double |
m32
Matrix element (3,2)
|
double |
m33
Matrix element (3,3)
|
INDEFINITE, POSITIVE_DEFINITE, SPD, SYMMETRIC
Constructor and Description |
---|
Matrix4dBase() |
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
clone() |
int |
colSize()
Returns the number of columns in this matrix (which is always 4).
|
double |
determinant()
Returns the determinant of this matrix
|
boolean |
epsilonEquals(Matrix4dBase M1,
double epsilon)
Returns true if the elements of this matrix equal those of matrix
M1 within a prescribed tolerance epsilon . |
boolean |
equals(Matrix4dBase 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.
|
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,
double[] values,
int off)
Copies a column of this matrix into an array of doubles, starting at a
specified offset.
|
void |
getColumn(int j,
Vector4d col)
Copies a column of this matrix into a 4-vector.
|
void |
getRow(int i,
double[] values)
Copies a row of this matrix into an array of doubles.
|
void |
getRow(int i,
double[] values,
int off)
Copies a row of this matrix into an array of doubles, starting at a
specified offset.
|
void |
getRow(int i,
Vector4d row)
Copies a row of this matrix into a 4-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(Vector4d vr)
Multiplies this matrix by the column vector vr and places the result back
into vr.
|
void |
mul(Vector4d vr,
Vector4d v1)
Multiplies this matrix by the column vector v1 and places the result in
the vector vr.
|
void |
mul(VectorNd vr,
VectorNd v1)
Multiplies this matrix by the column vector v1 and places the result in
the vector vr.
|
void |
mulAdd(Matrix M1,
Matrix M2)
Multiplies M1 by M2 and places the result in this matrix.
|
boolean |
mulInverse(Vector4d vr)
Multiplies the column vector vr by the inverse of this matrix and places
the result back in vr.
|
boolean |
mulInverse(Vector4d vr,
Vector4d v1)
Multiplies the column vector v1 by the inverse of this matrix and places
the result in vr.
|
boolean |
mulInverseTranspose(Vector4d vr)
Multiplies the column vector vr by the inverse transpose of this matrix
and places the result back in vr.
|
boolean |
mulInverseTranspose(Vector4d vr,
Vector4d v1)
Multiplies the column vector v1 by the inverse transpose of this matrix
and places the result in vr.
|
void |
mulTranspose(Vector4d vr)
Multiplies the transpose of this matrix by the vector vr and places the
result back in vr.
|
void |
mulTranspose(Vector4d vr,
Vector4d v1)
Multiplies the transpose of this matrix by the vector v1 and places the
result in vr.
|
void |
mulTransposeLeftAdd(Matrix M1,
Matrix M2)
Multiplies M1^T by M2 and places the result in this matrix.
|
void |
mulTransposeRightAdd(Matrix M1,
Matrix M2)
Multiplies M1 by M2^T and places the result in this matrix.
|
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 4).
|
void |
set(double[] vals)
Sets the elements of this matrix from an array of doubles.
|
void |
set(int i,
int j,
double value)
Sets a single element of this matrix.
|
void |
set(Matrix4dBase 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,
Vector4d col)
Sets a column of this matrix to the specified 4-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,
Vector4d row)
Sets a row of this matrix to the specified 4-vector.
|
void |
transpose()
Transposes this matrix in place.
|
add, checkConsistency, set, set, set, set, setCCSValues, setColumn, setCRSValues, setRandom, 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, isWritable, maxNorm, mul, mul, mulAdd, mulAdd, mulAdd, mulTranspose, mulTranspose, mulTranspose, mulTransposeAdd, mulTransposeAdd, mulTransposeAdd, numNonZeroVals, numNonZeroVals, scan, scan, setCRSValues, setDefaultFormat, setSize, toString, toString, toString, trace, write, 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 double m00
public double m01
public double m02
public double m03
public double m10
public double m11
public double m12
public double m13
public double m20
public double m21
public double m22
public double m23
public double m30
public double m31
public double m32
public double m33
public final int rowSize()
rowSize
in interface LinearTransformNd
rowSize
in interface Matrix
rowSize
in class MatrixBase
public final int colSize()
colSize
in interface LinearTransformNd
colSize
in interface Matrix
colSize
in class MatrixBase
public double get(int i, int j)
get
in interface Matrix
get
in class MatrixBase
i
- element row indexj
- element column indexpublic void get(double[] values)
(i,j)
is
stored at location i*colSize()+j
.get
in interface Matrix
get
in class MatrixBase
values
- array into which values are copiedpublic void getColumn(int j, double[] values)
getColumn
in interface Matrix
getColumn
in class MatrixBase
j
- column indexvalues
- array into which the column is copiedpublic void getColumn(int j, double[] values, int off)
getColumn
in interface Matrix
getColumn
in class MatrixBase
j
- column indexvalues
- array into which the column is copiedoff
- offset in values where copying should beginpublic void getColumn(int j, Vector4d col)
j
- column indexcol
- 4-vector into which the column is copiedpublic void getRow(int i, double[] values)
getRow
in interface Matrix
getRow
in class MatrixBase
i
- row indexvalues
- array into which the row is copiedpublic void getRow(int i, double[] values, int off)
getRow
in interface Matrix
getRow
in class MatrixBase
i
- row indexvalues
- array into which the row is copiedoff
- offset in values where copying should beginpublic void getRow(int i, Vector4d row)
i
- row indexrow
- 4-vector into which the row is copiedpublic final void set(int i, int j, double value)
set
in interface DenseMatrix
set
in class DenseMatrixBase
i
- element row indexj
- element column indexvalue
- element valuepublic void set(double[] vals)
(i,j)
is stored at location i*colSize()+j
.set
in interface DenseMatrix
set
in class DenseMatrixBase
vals
- array from which values are copiedpublic void setColumn(int j, double[] values)
setColumn
in interface DenseMatrix
setColumn
in class DenseMatrixBase
j
- column indexvalues
- array from which column values are copiedpublic void setColumn(int j, Vector4d col)
j
- column indexcol
- 4-vector from which the column is copiedpublic void setRow(int i, double[] values)
setRow
in interface DenseMatrix
setRow
in class DenseMatrixBase
i
- row indexvalues
- array from which the row is copiedpublic void setRow(int i, Vector4d row)
i
- row indexrow
- 4-vector from which the row is copiedpublic void set(Matrix4dBase M)
M
- matrix whose values are to be copiedpublic void mul(Vector4d vr, Vector4d v1)
vr = M v1
vr
- result vectorv1
- vector to multiply bypublic void mul(VectorNd vr, VectorNd v1)
vr = M v1
mul
in interface LinearTransformNd
mul
in interface Matrix
mul
in class MatrixBase
vr
- result vectorv1
- vector to multiply bypublic void mul(Vector4d vr)
vr = M vr
vr
- vector to multiply (in place)public void mulTranspose(Vector4d vr, Vector4d v1)
vr = v1 M
vr
- result vectorv1
- vector to multiply bypublic void mulTranspose(Vector4d vr)
vr = vr M
vr
- vector to multiply by (in place)public boolean mulInverse(Vector4d vr, Vector4d v1)
vr
- result vectorv1
- vector to multiply bypublic boolean mulInverse(Vector4d vr)
vr
- vector to multiply by (in place)public boolean mulInverseTranspose(Vector4d vr, Vector4d v1)
vr
- result vectorv1
- vector to multiply bypublic boolean mulInverseTranspose(Vector4d vr)
vr
- vector to multiply by (in place)public void mulAdd(Matrix M1, Matrix M2)
M1
- left matrix termM2
- right matrix termpublic void mulTransposeRightAdd(Matrix M1, Matrix M2)
M1
- left matrix termM2
- right matrix termpublic void mulTransposeLeftAdd(Matrix M1, Matrix M2)
M1
- left matrix termM2
- right matrix termpublic void negate()
public void transpose()
public void setIdentity()
public boolean epsilonEquals(Matrix4dBase M1, double epsilon)
M1
within a prescribed tolerance epsilon
.M1
- matrix to compare withepsilon
- comparison tolerancepublic boolean equals(Matrix4dBase M1)
M1
.M1
- matrix to compare withpublic double infinityNorm()
infinityNorm
in interface Matrix
infinityNorm
in class MatrixBase
public double oneNorm()
oneNorm
in interface Matrix
oneNorm
in class MatrixBase
public double frobeniusNorm()
frobeniusNorm
in interface Matrix
frobeniusNorm
in class MatrixBase
public boolean invert()
public double determinant() throws ImproperSizeException
determinant
in interface Matrix
determinant
in class MatrixBase
ImproperSizeException
- if the matrix is not square