org.geotoolkit.referencing.operation.matrix
Interface XMatrix

All Superinterfaces:
Cloneable, LenientComparable, Matrix
All Known Implementing Classes:
GeneralMatrix, Matrix1, Matrix2, Matrix3, Matrix4

public interface XMatrix
extends Matrix, LenientComparable, Cloneable

A matrix capables to perform some operations. The GeoAPI Matrix interface is basically a two dimensional array of numbers. The XMatrix interface adds inversion and multiplication capabilities among others. It is used as a bridge across various matrix implementations in Java3D (Matrix3f, Matrix3d, Matrix4f, Matrix4d, GMatrix).

Since:
2.2
Version:
3.18
Author:
Martin Desruisseaux (IRD, Geomatys), Simone Giannecchini (Geosolutions)
See Also:
MatrixFactory.toXMatrix(Matrix)
Module:
referencing/geotk-referencing (download)    View source code for this class

Method Summary
 XMatrix 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, ComparisonMode mode)
          Compares this matrix with the given object for equality.
 void invert()
          Inverts this matrix in place.
 boolean isAffine()
          Returns true if this matrix is an affine transform.
 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 setIdentity()
          Sets this matrix to the identity matrix.
 void setZero()
          Sets all the values in this matrix to zero.
 void transpose()
          Sets the value of this matrix to its transpose.
 
Methods inherited from interface Matrix
getElement, getNumCol, getNumRow, isIdentity, setElement
 
Methods inherited from interface LenientComparable
equals
 

Method Detail

setZero

void setZero()
Sets all the values in this matrix to zero.


setIdentity

void setIdentity()
Sets this matrix to the identity matrix.


isIdentity

boolean isIdentity(double tolerance)
Returns 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.

Parameters:
tolerance - The tolerance value.
Returns:
true if this matrix is close enough to the identity matrix given the tolerance value.
Since:
2.4

isAffine

boolean isAffine()
Returns 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.

Returns:
true if this matrix is affine.

negate

void negate()
Negates the value of this matrix: this = -this.


transpose

void transpose()
Sets the value of this matrix to its transpose.


invert

void invert()
            throws SingularMatrixException
Inverts this matrix in place.

Throws:
SingularMatrixException - if this matrix is not invertible.

multiply

void multiply(Matrix matrix)
Sets the value of this matrix to the result of multiplying itself with the specified matrix. In other words, performs 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.

Parameters:
matrix - The matrix to multiply to this matrix.

equals

boolean equals(Matrix matrix,
               double tolerance)
Compares the element values regardless the object class. This is similar to a call to GMatrix.epsilonEquals. The method name is intentionally different in order to avoid ambiguities at compile-time.

Parameters:
matrix - The matrix to compare.
tolerance - The tolerance value.
Returns:
true if this matrix is close enough to the given matrix given the tolerance value.
Since:
2.5

equals

boolean equals(Object object,
               ComparisonMode mode)
Compares this matrix with the given object for equality. To be considered equal, the two objects must meet the following conditions, which depend on the mode argument:

Specified by:
equals in interface LenientComparable
Parameters:
object - The object to compare to this.
mode - The strictness level of the comparison.
Returns:
true if both objects are equal.
Since:
3.18

clone

XMatrix clone()
Returns a clone of this matrix.

Specified by:
clone in interface Matrix


Copyright © 2009-2011 Geotoolkit.org. All Rights Reserved.