cern.colt.matrix.impl
Class AbstractMatrix2D
java.lang.Object
|
+--cern.colt.PersistentObject
|
+--cern.colt.matrix.impl.AbstractMatrix
|
+--cern.colt.matrix.impl.AbstractMatrix2D
- All Implemented Interfaces:
- Cloneable, Serializable
- Direct Known Subclasses:
- DoubleMatrix2D, ObjectMatrix2D
- public abstract class AbstractMatrix2D
- extends AbstractMatrix
Abstract base class for 2-d matrices holding objects or primitive data types such as int
, double
, etc.
First see the package summary and javadoc tree view to get the broad picture.
Note that this implementation is not synchronized.
- See Also:
- Serialized Form
Method Summary |
void |
checkShape(AbstractMatrix2D B)
Sanity check for operations requiring two matrices with the same number of columns and rows. |
void |
checkShape(AbstractMatrix2D B,
AbstractMatrix2D C)
Sanity check for operations requiring matrices with the same number of columns and rows. |
int |
columns()
Returns the number of columns. |
int |
rows()
Returns the number of rows. |
int |
size()
Returns the number of cells which is rows()*columns(). |
String |
toStringShort()
Returns a string representation of the receiver's shape. |
checkShape
public void checkShape(AbstractMatrix2D B)
- Sanity check for operations requiring two matrices with the same number of columns and rows.
- Throws:
IllegalArgumentException
- if columns() != B.columns() || rows() != B.rows().
checkShape
public void checkShape(AbstractMatrix2D B,
AbstractMatrix2D C)
- Sanity check for operations requiring matrices with the same number of columns and rows.
- Throws:
IllegalArgumentException
- if columns() != B.columns() || rows() != B.rows() || columns() != C.columns() || rows() != C.rows().
columns
public int columns()
- Returns the number of columns.
rows
public int rows()
- Returns the number of rows.
size
public int size()
- Returns the number of cells which is rows()*columns().
- Overrides:
size
in class AbstractMatrix
toStringShort
public String toStringShort()
- Returns a string representation of the receiver's shape.
Submit a bug or feature. Check the Colt home page for the latest news.