public class Matrix
extends java.lang.Object
implements java.lang.Iterable<java.util.List<java.lang.Integer>>
| Constructor and Description |
|---|
Matrix(int[][] src)
Constructor for a new Matrix with the values from the given array.
|
Matrix(int m,
int n)
Constructor for a new Matrix with the given col and row count.
|
| Modifier and Type | Method and Description |
|---|---|
void |
deleteColumn(int j)
Deletes the column with the given index from this matrix.
|
java.util.List<java.lang.Integer> |
getColumn(int i)
Returns a copy of the column with the given index of this matrix.
|
int |
getColumnCount()
Returns the count of cols of this matrix.
|
Pair<java.lang.Integer,java.util.List<java.lang.Integer>> |
getNoneZeroRow()
Returns a row which has at least one component different from zero.
|
java.util.List<java.lang.Integer> |
getRow(int i)
Returns the row with the given index in this matrix.
|
int |
getRowCount()
Returns the count of rows of this matrix.
|
static Matrix |
identity(int m,
int n)
Returns the identity matrix with given col and row count.
|
boolean |
isZero()
Checks if this matrix only contains of components equal to zero.
|
java.util.Iterator<java.util.List<java.lang.Integer>> |
iterator() |
java.lang.String |
toString() |
public Matrix(int m,
int n)
m - - the row count of the resulting matrix.n - - the col count of the resulting matrix.public Matrix(int[][] src)
src - - the template to create the matrix from.public static Matrix identity(int m, int n)
m - - the row count of the identity matrix.n - - the col count of the identity matrix.public int getRowCount()
public int getColumnCount()
public java.util.List<java.lang.Integer> getRow(int i)
i - - the index of the wished row of this matrix.public java.util.List<java.lang.Integer> getColumn(int i)
i - - the index of the wished column of this matrix.public Pair<java.lang.Integer,java.util.List<java.lang.Integer>> getNoneZeroRow()
public void deleteColumn(int j)
j - - the index of the column which should be deleted.public boolean isZero()
public java.util.Iterator<java.util.List<java.lang.Integer>> iterator()
iterator in interface java.lang.Iterable<java.util.List<java.lang.Integer>>public java.lang.String toString()
toString in class java.lang.Object