|
ContactCenters V. 0.9.9. |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.util.AbstractCollection<E>
umontreal.iro.lecuyer.collections.AbstractMatrix<E>
umontreal.iro.lecuyer.collections.DenseMatrix<E>
E - the element type.public class DenseMatrix<E>
Represents a matrix storing elements in an array.
| Field Summary |
|---|
| Fields inherited from class umontreal.iro.lecuyer.collections.AbstractMatrix |
|---|
modCount |
| Constructor Summary | |
|---|---|
DenseMatrix(E[][] elements)
Constructs a new matrix from the 2D array elements. |
|
DenseMatrix(int rows,
int columns)
Constructs a new dense matrix with rows rows, columns columns, and filled with null elements. |
|
DenseMatrix(Matrix<? extends E> matrix)
Constructs a new matrix from the matrix matrix. |
|
| Method Summary | |
|---|---|
protected DenseMatrix<E> |
clone()
|
int |
columns()
Returns the number of columns in this matrix. |
E |
get(int r,
int c)
Returns the element at index (r, c) of the matrix. |
int |
rows()
Returns the number of rows in this matrix. |
E |
set(int r,
int c,
E value)
Sets the element at index (r, c) of the matrix to value, and returns the element previously at that position. |
void |
setColumns(int numColumns)
Sets the number of columns of this matrix to numColumns. |
void |
setRows(int numRows)
Sets the number of rows of this matrix to numRows. |
| Methods inherited from class umontreal.iro.lecuyer.collections.AbstractMatrix |
|---|
asList, equals, hashCode, isEmpty, iterator, size, to2DArray, to2DArray, toString, viewColumn, viewPart, viewRow |
| Methods inherited from class java.util.AbstractCollection |
|---|
add, addAll, clear, contains, containsAll, remove, removeAll, retainAll, toArray, toArray |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.util.Collection |
|---|
add, addAll, clear, contains, containsAll, remove, removeAll, retainAll, toArray, toArray |
| Constructor Detail |
|---|
public DenseMatrix(int rows,
int columns)
rows - the number of rows.columns - the number of columns.public DenseMatrix(E[][] elements)
elements - the elements of the matrix.public DenseMatrix(Matrix<? extends E> matrix)
matrix - the source matrix.| Method Detail |
|---|
public int columns()
Matrix
columns in interface Matrix<E>public int rows()
Matrix
rows in interface Matrix<E>
public E get(int r,
int c)
Matrix
get in interface Matrix<E>r - the row index.c - the column index.
public void setColumns(int numColumns)
MatrixMatrix.columns(), the
last columns of the matrix are
removed.
If numColumns is greater than
Matrix.columns(), new
columns filled with null
references are added to the matrix.
This method is optional, and throws an
UnsupportedOperationException if
not implemented.
setColumns in interface Matrix<E>numColumns - the new number of columns in the matrix.public void setRows(int numRows)
MatrixMatrix.rows(), the
last rows of the matrix are
removed.
If numRows is greater than
Matrix.rows(), new
rows filled with null
references are added to the matrix.
This method is optional, and throws an
UnsupportedOperationException if
not implemented.
setRows in interface Matrix<E>numRows - the new number of rows in the matrix.
public E set(int r,
int c,
E value)
MatrixUnsupportedOperationException if
not implemented.
set in interface Matrix<E>set in class AbstractMatrix<E>r - the row index.c - the column index.value - the value of the element.
protected DenseMatrix<E> clone()
clone in class Object
|
ContactCenters V. 0.9.9. |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||