public abstract class AbstractMatrix extends java.lang.Object implements Matrix
Constructor and Description |
---|
AbstractMatrix() |
Modifier and Type | Method and Description |
---|---|
Matrix |
add(Matrix other)
Adds this matrix to another.
|
boolean |
equals(java.lang.Object obj)
Tests for equality of this matrix with another.
|
int |
getNumColumns()
Returns the number of columns in this matrix.
|
int |
getNumRows()
Returns the number of rows in this matrix.
|
Matrix |
multiply(Matrix other)
Multiplies this matrix by another.
|
void |
setNumColumns(int numColumns)
Sets the number of columns in this matrix.
|
void |
setNumRows(int numRows)
Sets the number of rows in this matrix.
|
java.lang.String |
toString()
Creates a visual representation of this matrix as a string.
|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
checkBounds, checkColumnBounds, checkRowBounds, clear, create, fillColumnWise, fillRowWise, get, incrColumns, incrRows, insertColumn, insertRow, isIdentity, makeIdentity, set, sumColumn, sumRow, transpose
public int getNumRows()
getNumRows
in interface Matrix
public int getNumColumns()
getNumColumns
in interface Matrix
public void setNumRows(int numRows)
setNumRows
in interface Matrix
numRows
- the number of rows in this matrixMatrixException
- if numRows is not positivepublic void setNumColumns(int numColumns)
setNumColumns
in interface Matrix
numColumns
- the number of columns in this matrixMatrixException
- if numColumns is not positivepublic boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
obj
- the other matrix to be tested for equality with this matrixpublic java.lang.String toString()
toString
in class java.lang.Object
public Matrix add(Matrix other)
add
in interface Matrix
other
- the other matrix to addMatrixException
- if this matrix and the other matrix do not have
the same dimensionspublic Matrix multiply(Matrix other)
multiply
in interface Matrix
other
- the other matrix to multiplyMatrixException
- if the number of columns in this matrix does not
match the number of rows in the other