|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
ObjectMatrix1
public class Matrix1
A matrix of fixed 1×1 size. This trivial matrix is returned as a result of MathTransform1D derivative computation.
| referencing/geotk-referencing (download) | View source code for this class |
| Field Summary | |
|---|---|
double |
m00
The only element in this matrix. |
static int |
SIZE
The matrix size, which is 1. |
| Constructor Summary | |
|---|---|
Matrix1()
Creates a new identity matrix. |
|
Matrix1(double m00)
Creates a new matrix initialized to the specified value. |
|
Matrix1(Matrix matrix)
Creates a new matrix initialized to the same value than the specified one. |
|
| Method Summary | |
|---|---|
Matrix1 |
clone()
Returns a clone of this matrix. |
boolean |
equals(Matrix matrix,
double tolerance)
Compares the element values regardless the object class. |
boolean |
equals(Object object)
Returns true if the specified object is of type Matrix1 and
all of the data members are equal to the corresponding data members in this matrix. |
boolean |
equals(Object object,
ComparisonMode mode)
Compares this matrix with the given object for equality. |
double |
getElement(int row,
int column)
Retrieves the value at the specified row and column of this matrix. |
int |
getNumCol()
Returns the number of colmuns in this matrix, which is always 1 in this implementation. |
int |
getNumRow()
Returns the number of rows in this matrix, which is always 1 in this implementation. |
int |
hashCode()
Returns a hash code value based on the data values in this object. |
void |
invert()
Inverts this matrix in place. |
boolean |
isAffine()
Returns true if this matrix is an affine transform. |
boolean |
isIdentity()
Returns true if this matrix is an identity matrix. |
boolean |
isIdentity(double tolerance)
Returns true if this matrix is an identity matrix using the provided tolerance. |
void |
multiply(Matrix matrix)
Sets the value of this matrix to the result of multiplying itself with the specified matrix. |
void |
negate()
Negates the value of this matrix: this = -this. |
void |
setElement(int row,
int column,
double value)
Modifies the value at the specified row and column of this matrix. |
void |
setIdentity()
Sets this matrix to the identity matrix. |
void |
setZero()
Sets all the values in this matrix to zero. |
String |
toString()
Returns a string representation of this matrix. |
void |
transpose()
Sets the value of this matrix to its transpose. |
| Methods inherited from class Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public double m00
public static final int SIZE
| Constructor Detail |
|---|
public Matrix1()
public Matrix1(double m00)
m00 - The element in this matrix.
public Matrix1(Matrix matrix)
throws IllegalArgumentException
matrix - The matrix to copy.
IllegalArgumentException - if the given matrix is not of the expected size.| Method Detail |
|---|
public final int getNumRow()
getNumRow in interface Matrixpublic final int getNumCol()
getNumCol in interface Matrix
public final double getElement(int row,
int column)
getElement in interface Matrix
public final void setElement(int row,
int column,
double value)
setElement in interface Matrixpublic final void setZero()
setZero in interface XMatrixpublic final void setIdentity()
setIdentity in interface XMatrixpublic final boolean isIdentity()
true if this matrix is an identity matrix.
isIdentity in interface Matrixpublic final boolean isIdentity(double tolerance)
true if this matrix is an identity matrix using the provided tolerance.
This method is equivalent to computing the difference between this matrix and an identity
matrix of identical size, and returning true if and only if all differences are
smaller than or equal to tolerance.
isIdentity in interface XMatrixtolerance - The tolerance value.
true if this matrix is close enough to the identity matrix
given the tolerance value.public final boolean isAffine()
true if this matrix is an affine transform.
A transform is affine if the matrix is square and last row contains
only zeros, except in the last column which contains 1.
isAffine in interface XMatrixtrue if this matrix is affine.public final void negate()
this = -this.
negate in interface XMatrixpublic final void transpose()
transpose in interface XMatrixpublic final void invert()
invert in interface XMatrixpublic final void multiply(Matrix matrix)
this = this × matrix. In the context
of coordinate transformations, this is equivalent to
AffineTransform.concatenate:
first transforms by the supplied transform and then transform the result by
the original transform.
multiply in interface XMatrixmatrix - The matrix to multiply to this matrix.
public boolean equals(Matrix matrix,
double tolerance)
GMatrix.epsilonEquals. The method name is
intentionally different in order to avoid ambiguities at compile-time.
equals in interface XMatrixmatrix - The matrix to compare.tolerance - The tolerance value.
true if this matrix is close enough to the given matrix
given the tolerance value.
public boolean equals(Object object,
ComparisonMode mode)
mode argument:
STRICT: the two matrixes must be of the same
class, have the same size and the same element values.BY_CONTRACT/IGNORE_METADATA: the two matrixes must have the same size and the same element
values, but are not required to be the same implementation class (any Matrix
is okay).APPROXIMATIVE: the two matrixes must have
the same size, but the element values can differ up to some threshold. The threshold
value is determined empirically and may change in future Geotk versions.
equals in interface XMatrixequals in interface LenientComparableobject - The object to compare to this.mode - The strictness level of the comparison.
true if both objects are equal.public boolean equals(Object object)
true if the specified object is of type Matrix1 and
all of the data members are equal to the corresponding data members in this matrix.
equals in interface LenientComparableequals in class Objectobject - The object to compare with this matrix for equality.
true if the given object is equal to this matrix.public int hashCode()
hashCode in class Objectpublic String toString()
toString in class Objectpublic Matrix1 clone()
clone in interface XMatrixclone in interface Matrixclone in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||