A two dimensional array of numbers. Row and column numbering begins with zero.
- Since:
- 1.0
-
Method Summary
Modifier and TypeMethodDescriptionclone()
Returns a modifiable copy of this matrix.double
getElement
(int row, int column) Retrieves the value at the specified row and column of this matrix.int
Returns the number of columns in this matrix.int
Returns the number of rows in this matrix.default boolean
Returnstrue
if this matrix is an identity matrix.default void
setElement
(int row, int column, double value) Modifies the value at the specified row and column of this matrix.
-
Method Details
-
getNumRow
Returns the number of rows in this matrix.- Returns:
- the number of rows in this matrix.
-
getNumCol
Returns the number of columns in this matrix.- Returns:
- the number of columns in this matrix.
-
isIdentity
Returnstrue
if this matrix is an identity matrix.The default returns
true
if this matrix is square and ifgetElement(int, int)
returns 1 on the diagonal and 0 everywhere else. Otherwise this method returnsfalse
.- Returns:
true
if this matrix is an identity matrix.
Convenience extension to OGC/ISO standard
Added as a convenience for a frequently requested operation. -
getElement
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.
- Throws:
IndexOutOfBoundsException
- if the specified row or column is out of bounds.
-
setElement
Modifies the value at the specified row and column of this matrix. This is an optional method.The default throws
UnsupportedOperationException
.- 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.- Throws:
IndexOutOfBoundsException
- if the specified row or column is out of bounds.UnsupportedOperationException
- if this matrix is unmodifiable.
-
clone
-