public class Matrix extends Object implements MatrixValueI
| Modifier | Constructor and Description |
|---|---|
protected |
Matrix(int rows,
int cols)
Construct a matrix with given rows and cols.
|
| Modifier and Type | Method and Description |
|---|---|
MatrixValueI |
copy()
returns a copy of this value.
|
boolean |
equals(Object obj)
Are two matrices equal, element by element
Overrides Object.
|
Dimensions |
getDim()
Returns the dimension of this object.
|
Object |
getEle(int n)
gets the i-th element, treats data a a linear array.
|
Object |
getEle(int i,
int j) |
Object[][] |
getEles() |
static MatrixValueI |
getInstance(int rows,
int cols) |
int |
getNumCols() |
int |
getNumEles()
The total number of elements.
|
int |
getNumRows() |
int |
hashCode()
Always override hashCode when you override equals.
|
void |
setEle(int i,
int j,
Object value) |
void |
setEle(int n,
Object value)
sets the i-th element, treats data a a linear array.
|
void |
setEles(MatrixValueI val)
sets the elements to those of the arguments.
|
String |
toString()
Returns a string representation of matrix.
|
protected Matrix(int rows,
int cols)
public MatrixValueI copy()
MatrixValueIcopy in interface MatrixValueIpublic static MatrixValueI getInstance(int rows, int cols)
public String toString()
public Dimensions getDim()
MatrixValueIgetDim in interface MatrixValueIpublic int getNumEles()
MatrixValueIgetNumEles in interface MatrixValueIpublic int getNumRows()
public int getNumCols()
public void setEle(int n,
Object value)
MatrixValueIsetEle in interface MatrixValueIpublic void setEle(int i,
int j,
Object value)
public Object getEle(int n)
MatrixValueIgetEle in interface MatrixValueIpublic Object getEle(int i, int j)
public Object[][] getEles()
public void setEles(MatrixValueI val)
setEles in interface MatrixValueIpublic boolean equals(Object obj)
Copyright © 2018. All rights reserved.