Interface Matrix
-
@UML(identifier="PT_Matrix", specification=OGC_01009) public interface Matrix
A two dimensional array of numbers. Row and column numbering begins with zero.API note: The API for this interface matches closely the API in variousjavax.vecmath
implementations, which should enable straightforward implementations on top ofjavax.vecmath
. The later package provides matrix for the general case and optimized versions for 3×3 and 4×4 cases, which are quite common in a transformation package.Examples of third-party classes that can be used for implementing this
Matrix
interface:- Standard Java:
AffineTransform
- Java Advanced Imaging (JAI):
javax.media.jai.PerspectiveTransform
- Java3D:
javax.media.j3d.Transform3D
,javax.vecmath.GMatrix
,javax.vecmath.Matrix4d
,javax.vecmath.Matrix3d
- Other: Jama matrix
- Since:
- 1.0
- Standard Java:
-
-
Method Summary
Modifier and Type Method Description Matrix
clone()
Returns a clone of this matrix.double
getElement(int row, int column)
Retrieves the value at the specified row and column of this matrix.int
getNumCol()
Returns the number of columns in this matrix.int
getNumRow()
Returns the number of rows in this matrix.boolean
isIdentity()
Returnstrue
if this matrix is an identity matrix.void
setElement(int row, int column, double value)
Modifies the value at the specified row and column of this matrix.
-
-
-
Method Detail
-
getNumRow
int getNumRow()
Returns the number of rows in this matrix.- Returns:
- the number of rows in this matrix.
Departure from OGC/ISO specification:
Needed for making the matrix usable. The method signature matches the one ofGMatrix
in the vecmath package, for straightforward implementation.
-
getNumCol
int getNumCol()
Returns the number of columns in this matrix.- Returns:
- the number of columns in this matrix.
Departure from OGC/ISO specification:
Needed for making the matrix usable. The method signature matches the one ofGMatrix
in the vecmath package, for straightforward implementation.
-
getElement
double getElement(int row, int column)
Retrieves the value at the specified row and column of this matrix.- Parameters:
row
- the row number to be retrieved (zero indexed).column
- the column number to be retrieved (zero indexed).- Returns:
- the value at the indexed element.
Departure from OGC/ISO specification:
Needed for making the matrix usable. The method signature matches the one ofGMatrix
in the vecmath package, for straightforward implementation.
-
setElement
void setElement(int row, int column, double value)
Modifies the value at the specified row and column of this matrix.- Parameters:
row
- the row number of the value to set (zero indexed).column
- the column number of the value to set (zero indexed).value
- the new matrix element value.
Departure from OGC/ISO specification:
Needed for making the matrix usable. The method signature matches the one ofGMatrix
in the vecmath package, for straightforward implementation.
-
isIdentity
boolean isIdentity()
Returnstrue
if this matrix is an identity matrix.- Returns:
true
if this matrix is an identity matrix.
Departure from OGC/ISO specification:
Added as a convenience for a frequently requested operation.
-
clone
Matrix clone()
Returns a clone of this matrix.- Returns:
- a clone of this matrix.
-
-