| org.geotools.referencing.operation.matrix.GeneralMatrix
GeneralMatrix | public class GeneralMatrix extends GMatrix implements XMatrix(Code) | | A two dimensional array of numbers. Row and column numbering begins with zero.
since: 2.2 version: $Id: GeneralMatrix.java 24925 2007-03-27 20:12:08Z jgarnett $ author: Martin Desruisseaux author: Simone Giannecchini See Also: javax.vecmath.GMatrix See Also: java.awt.geom.AffineTransform See Also: javax.media.jai.PerspectiveTransform See Also: javax.media.j3d.Transform3D See Also: Jama matrix See Also: JSR-83 Multiarray package |
Field Summary | |
final public static double | EPS Defaul tolerance value for floating point comparisons. |
Constructor Summary | |
public | GeneralMatrix(int size) Constructs a square identity matrix of size
size ×
size . | public | GeneralMatrix(int numRow, int numCol) Creates a matrix of size
numRow ×
numCol . | public | GeneralMatrix(int numRow, int numCol, double[] matrix) Constructs a
numRow ×
numCol matrix
initialized to the values in the
matrix array. | public | GeneralMatrix(double[][] matrix) Constructs a new matrix from a two-dimensional array of doubles.
Parameters: matrix - Array of rows. | public | GeneralMatrix(Matrix matrix) Constructs a new matrix and copies the initial values from the parameter matrix. | public | GeneralMatrix(GMatrix matrix) Constructs a new matrix and copies the initial values from the parameter matrix. | public | GeneralMatrix(AffineTransform transform) Constructs a 3×3 matrix from the specified affine transform. | public | GeneralMatrix(Envelope srcRegion, Envelope dstRegion) Constructs a transform that maps a source region to a destination region.
Axis order and direction are left unchanged.
If the source dimension is equals to the destination dimension,
then the transform is affine. | public | GeneralMatrix(AxisDirection[] srcAxis, AxisDirection[] dstAxis) Constructs a transform changing axis order and/or direction.
For example, the transform may converts (NORTH,WEST) coordinates
into (EAST,NORTH). | public | GeneralMatrix(Envelope srcRegion, AxisDirection[] srcAxis, Envelope dstRegion, AxisDirection[] dstAxis) Constructs a transform mapping a source region to a destination region.
Axis order and/or direction can be changed during the process.
For example, the transform may convert (NORTH,WEST) coordinates
into (EAST,NORTH). |
Method Summary | |
public static double[][] | getElements(Matrix matrix) Retrieves the specifiable values in the transformation matrix into a
2-dimensional array of double precision values. | final public double[][] | getElements() Retrieves the specifiable values in the transformation matrix into a
2-dimensional array of double precision values. | final public boolean | isAffine() | final public boolean | isIdentity() Returns
true if this matrix is an identity matrix. | final public boolean | isIdentity(double tolerance) | static boolean | isIdentity(Matrix matrix, double tolerance) Returns
true if the matrix is an identity matrix using the provided tolerance. | public static GeneralMatrix | load(File file) Loads data from the specified file until the first blank line or end of file.
Parameters: file - The file to read. | public static GeneralMatrix | load(BufferedReader in, Locale locale) Loads data from the specified streal until the first blank line or end of stream.
Parameters: in - The stream to read. Parameters: locale - The locale for the numbers to be parsed. | final public void | multiply(Matrix matrix) | final public AffineTransform | toAffineTransform2D() Returns an affine transform for this matrix. | public String | toString() Returns a string representation of this matrix. | static String | toString(Matrix matrix) Returns a string representation of the specified matrix. |
EPS | final public static double EPS(Code) | | Defaul tolerance value for floating point comparisons.
since: 2.4 |
GeneralMatrix | public GeneralMatrix(int size)(Code) | | Constructs a square identity matrix of size
size ×
size .
|
GeneralMatrix | public GeneralMatrix(int numRow, int numCol)(Code) | | Creates a matrix of size
numRow ×
numCol .
Elements on the diagonal j==i are set to 1.
|
GeneralMatrix | public GeneralMatrix(int numRow, int numCol, double[] matrix)(Code) | | Constructs a
numRow ×
numCol matrix
initialized to the values in the
matrix array. The array values
are copied in one row at a time in row major fashion. The array should be
exactly numRow*numCol in length. Note that because row and column
numbering begins with zero,
numRow and
numCol will be
one larger than the maximum possible matrix index values.
|
GeneralMatrix | public GeneralMatrix(double[][] matrix) throws IllegalArgumentException(Code) | | Constructs a new matrix from a two-dimensional array of doubles.
Parameters: matrix - Array of rows. Each row must have the same length. throws: IllegalArgumentException - if the specified matrix is not regular(i.e. if all rows doesn't have the same length). |
GeneralMatrix | public GeneralMatrix(Matrix matrix)(Code) | | Constructs a new matrix and copies the initial values from the parameter matrix.
|
GeneralMatrix | public GeneralMatrix(GMatrix matrix)(Code) | | Constructs a new matrix and copies the initial values from the parameter matrix.
|
GeneralMatrix | public GeneralMatrix(AffineTransform transform)(Code) | | Constructs a 3×3 matrix from the specified affine transform.
|
GeneralMatrix | public GeneralMatrix(Envelope srcRegion, Envelope dstRegion)(Code) | | Constructs a transform that maps a source region to a destination region.
Axis order and direction are left unchanged.
If the source dimension is equals to the destination dimension,
then the transform is affine. However, the following special cases
are also handled:
- If the target dimension is smaller than the source dimension,
then extra dimensions are dropped.
- If the target dimension is greater than the source dimension,
then the coordinates in the new dimensions are set to 0.
Parameters: srcRegion - The source region. Parameters: dstRegion - The destination region. |
GeneralMatrix | public GeneralMatrix(AxisDirection[] srcAxis, AxisDirection[] dstAxis)(Code) | | Constructs a transform changing axis order and/or direction.
For example, the transform may converts (NORTH,WEST) coordinates
into (EAST,NORTH). Axis direction can be inversed only. For example,
it is illegal to transform (NORTH,WEST) coordinates into (NORTH,DOWN).
If the source dimension is equals to the destination dimension,
then the transform is affine. However, the following special cases
are also handled:
- If the target dimension is smaller than the source dimension,
extra axis are dropped. An exception is thrown if the target
contains some axis not found in the source.
Parameters: srcAxis - The set of axis direction for source coordinate system. Parameters: dstAxis - The set of axis direction for destination coordinate system. throws: IllegalArgumentException - If dstAxis contains some axisnot found in srcAxis , or if some colinear axis were found. |
GeneralMatrix | public GeneralMatrix(Envelope srcRegion, AxisDirection[] srcAxis, Envelope dstRegion, AxisDirection[] dstAxis)(Code) | | Constructs a transform mapping a source region to a destination region.
Axis order and/or direction can be changed during the process.
For example, the transform may convert (NORTH,WEST) coordinates
into (EAST,NORTH). Axis direction can be inversed only. For example,
it is illegal to transform (NORTH,WEST) coordinates into (NORTH,DOWN).
If the source dimension is equals to the destination dimension,
then the transform is affine. However, the following special cases
are also handled:
- If the target dimension is smaller than the source dimension,
extra axis are dropped. An exception is thrown if the target
contains some axis not found in the source.
Parameters: srcRegion - The source region. Parameters: srcAxis - Axis direction for each dimension of the source region. Parameters: dstRegion - The destination region. Parameters: dstAxis - Axis direction for each dimension of the destination region. throws: MismatchedDimensionException - if the envelope dimension doesn'tmatches the axis direction array length. throws: IllegalArgumentException - If dstAxis contains some axisnot found in srcAxis , or if some colinear axis were found. |
getElements | public static double[][] getElements(Matrix matrix)(Code) | | Retrieves the specifiable values in the transformation matrix into a
2-dimensional array of double precision values. The values are stored
into the 2-dimensional array using the row index as the first subscript
and the column index as the second. Values are copied; changes to the
returned array will not change this matrix.
|
getElements | final public double[][] getElements()(Code) | | Retrieves the specifiable values in the transformation matrix into a
2-dimensional array of double precision values. The values are stored
into the 2-dimensional array using the row index as the first subscript
and the column index as the second. Values are copied; changes to the
returned array will not change this matrix.
|
isAffine | final public boolean isAffine()(Code) | | |
isIdentity | final public boolean isIdentity()(Code) | | Returns
true if this matrix is an identity matrix.
|
isIdentity | final public boolean isIdentity(double tolerance)(Code) | | since: 2.3.1 |
isIdentity | static boolean isIdentity(Matrix matrix, double tolerance)(Code) | | Returns
true if the matrix is an identity matrix using the provided tolerance.
|
load | public static GeneralMatrix load(File file) throws IOException(Code) | | Loads data from the specified file until the first blank line or end of file.
Parameters: file - The file to read. The matrix parsed from the file. throws: IOException - if an error occured while reading the file. since: 2.2 |
load | public static GeneralMatrix load(BufferedReader in, Locale locale) throws IOException(Code) | | Loads data from the specified streal until the first blank line or end of stream.
Parameters: in - The stream to read. Parameters: locale - The locale for the numbers to be parsed. The matrix parsed from the stream. throws: IOException - if an error occured while reading the stream. since: 2.2 |
multiply | final public void multiply(Matrix matrix)(Code) | | |
toString | public String toString()(Code) | | Returns a string representation of this matrix. The returned string is implementation
dependent. It is usually provided for debugging purposes only.
|
toString | static String toString(Matrix matrix)(Code) | | Returns a string representation of the specified matrix. The returned string is
implementation dependent. It is usually provided for debugging purposes only.
|
|
|