public class GeneralMatrix extends Matrix
This class is the basic implementation of matrices to use when nothing special is known about the structure of the matrix.
| Constructor and Description |
|---|
GeneralMatrix(int rows,
int columns)
Simple constructor.
|
GeneralMatrix(int rows,
int columns,
double[] data)
Simple constructor.
|
GeneralMatrix(Matrix m)
Copy constructor.
|
| Modifier and Type | Method and Description |
|---|---|
Matrix |
duplicate()
Polymorphic copy operator.
|
protected org.spaceroots.mantissa.linalg.NonNullRange |
getRangeForColumn(int j)
Set a range to the non null part covered by a column.
|
protected org.spaceroots.mantissa.linalg.NonNullRange |
getRangeForRow(int i)
Set a range to the non null part covered by a row.
|
void |
selfAdd(Matrix m)
Add a matrix to the instance.
|
void |
selfSub(Matrix m)
Substract a matrix from the instance.
|
add, getColumns, getElement, getRows, getTranspose, mul, mul, selfMul, setElement, sub, toStringpublic GeneralMatrix(int rows,
int columns)
rows - number of rows of the matrixcolumns - number of columns of the matrixpublic GeneralMatrix(int rows,
int columns,
double[] data)
rows - number of rows of the matrixcolumns - number of columns of the matrixdata - table of the matrix elements (stored row after row)public GeneralMatrix(Matrix m)
m - matrix to copypublic Matrix duplicate()
MatrixObject.clone()
method, except that it has public access, it doesn't throw any
specific exception and it returns a Matrix.public void selfAdd(Matrix m)
m - matrix to addjava.lang.IllegalArgumentException - if there is a dimension mismatchpublic void selfSub(Matrix m)
m - matrix to substractjava.lang.IllegalArgumentException - if there is a dimension mismatchprotected org.spaceroots.mantissa.linalg.NonNullRange getRangeForRow(int i)
MatrixgetRangeForRow in class Matrixi - index of the rowMatrix.getRangeForColumn(int)protected org.spaceroots.mantissa.linalg.NonNullRange getRangeForColumn(int j)
MatrixgetRangeForColumn in class Matrixj - index of the columnMatrix.getRangeForRow(int)Copyright © 2001-2007 Luc Maisonobe. All Rights Reserved.