org.geotools.referencing.operation.matrix
Class Matrix1

java.lang.Object
  extended byorg.geotools.referencing.operation.matrix.Matrix1
All Implemented Interfaces:
org.opengis.util.Cloneable, java.lang.Cloneable, org.opengis.referencing.operation.Matrix, java.io.Serializable, XMatrix

public class Matrix1
extends java.lang.Object
implements XMatrix, java.io.Serializable

A matrix of fixed {@value}×{@value} size. This trivial matrix is returned as a result of MathTransform1D derivative computation.

Since:
2.2
Version:
$Id: Matrix1.java 17964 2006-02-10 11:27:41Z desruisseaux $
Author:
Martin Desruisseaux
See Also:
Serialized Form

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(org.opengis.referencing.operation.Matrix matrix)
          Creates a new matrix initialized to the same value than the specified one.
 
Method Summary
 java.lang.Object clone()
          Returns a clone of this matrix.
 boolean equals(java.lang.Object object)
          Returns if the specified object is of type and all of the data members are equal to the corresponding data members in this matrix.
 double getElement(int row, int col)
          Returns the element at the specified index.
 int getNumCol()
          Returns the number of colmuns in this matrix, which is always {@value} in this implementation.
 int getNumRow()
          Returns the number of rows in this matrix, which is always {@value} 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 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.
 boolean isIdentity()
          Returns if this matrix is an identity matrix.
 void multiply(org.opengis.referencing.operation.Matrix matrix)
          Sets the value of this matrix to the result of multiplying itself with the specified matrix. In other words, performs = × . 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.
 void negate()
          Negates the value of this matrix: = .
 void setElement(int row, int col, double value)
          Set the element at the specified index.
 void setIdentity()
          Sets this matrix to the identity matrix.
 void setZero()
          Sets all the values in this matrix to zero.
 java.lang.String toString()
          Returns a string representation of this matrix.
 void transpose()
          Sets the value of this matrix to its transpose.
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

m00

public double m00
The only element in this matrix.


SIZE

public static final int SIZE
The matrix size, which is 1.

See Also:
Constant Field Values
Constructor Detail

Matrix1

public Matrix1()
Creates a new identity matrix.


Matrix1

public Matrix1(double m00)
Creates a new matrix initialized to the specified value.


Matrix1

public Matrix1(org.opengis.referencing.operation.Matrix matrix)
Creates a new matrix initialized to the same value than the specified one. The specified matrix size must be {@value}×{@value}.

Method Detail

getNumRow

public final int getNumRow()
Returns the number of rows in this matrix, which is always {@value} in this implementation.

Specified by:
getNumRow in interface org.opengis.referencing.operation.Matrix

getNumCol

public final int getNumCol()
Returns the number of colmuns in this matrix, which is always {@value} in this implementation.

Specified by:
getNumCol in interface org.opengis.referencing.operation.Matrix

getElement

public final double getElement(int row,
                               int col)
Returns the element at the specified index.

Specified by:
getElement in interface org.opengis.referencing.operation.Matrix

setElement

public final void setElement(int row,
                             int col,
                             double value)
Set the element at the specified index.

Specified by:
setElement in interface org.opengis.referencing.operation.Matrix

setZero

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

Specified by:
setZero in interface XMatrix

setIdentity

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

Specified by:
setIdentity in interface XMatrix

isIdentity

public final boolean isIdentity()
Returns if this matrix is an identity matrix.

Specified by:
isIdentity in interface org.opengis.referencing.operation.Matrix

isAffine

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

Specified by:
isAffine in interface XMatrix

negate

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

Specified by:
negate in interface XMatrix

transpose

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

Specified by:
transpose in interface XMatrix

invert

public final void invert()
Inverts this matrix in place.

Specified by:
invert in interface XMatrix

multiply

public final void multiply(org.opengis.referencing.operation.Matrix matrix)
Sets the value of this matrix to the result of multiplying itself with the specified matrix. In other words, performs = × . 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.

Specified by:
multiply in interface XMatrix

equals

public boolean equals(java.lang.Object object)
Returns if the specified object is of type and all of the data members are equal to the corresponding data members in this matrix.


hashCode

public int hashCode()
Returns a hash code value based on the data values in this object.


toString

public java.lang.String toString()
Returns a string representation of this matrix. The returned string is implementation dependent. It is usually provided for debugging purposes only.


clone

public java.lang.Object clone()
Returns a clone of this matrix.

Specified by:
clone in interface org.opengis.referencing.operation.Matrix


Copyright © GeoTools. All Rights Reserved.