Constructor and Description |
---|
DoubleMatrix(double[][] data)
Create matrix from a rectangular array of data
|
Modifier and Type | Method and Description |
---|---|
boolean |
eq(DoubleMatrix mat)
Test equality with another double matrix using == for doubles.
|
boolean |
equals(java.lang.Object obj)
Uses the Double.equals() rather than == for compatibility with hashcode.
|
double |
getDEle(int i,
int j)
Get the element as a double value.
|
Dimensions |
getDimensions()
Gets the dimensions of the Vector or Matrix
|
java.lang.Double |
getEle(int i,
int j)
Gets an element of a matrix
|
int |
getNCols()
The number of columns
|
int |
getNRows()
The number of rows
|
int |
hashCode() |
static DoubleMatrix |
newInstance(java.lang.Double[][] in)
Create a matrix from an array of Doubles
|
static DoubleMatrix |
newInstance(DoubleVector[] rows)
Create a matrix from an array of Doubles
|
void |
setEle(int row,
int col,
double val)
Sets an element
|
void |
setEle(int row,
int col,
java.lang.Object val)
Set an element of a matrix
|
java.lang.Object[][] |
toArray(java.lang.Object[][] mat)
Copies the data to an array
|
double[][] |
toArrayMat()
Return a cloned copy of the data
|
java.lang.String |
toString() |
public DoubleMatrix(double[][] data)
data
- must be rectangularpublic static DoubleMatrix newInstance(java.lang.Double[][] in)
in
- rectangular array of Doublespublic static DoubleMatrix newInstance(DoubleVector[] rows)
rows
- array of DoubleVector's, one per row, must all be the same lengthpublic java.lang.Double getEle(int i, int j)
MatrixI
public double getDEle(int i, int j)
i
- rowj
- colpublic int getNRows()
MatrixI
public int getNCols()
MatrixI
public Dimensions getDimensions()
MatrixI
getDimensions
in interface MatrixI
public double[][] toArrayMat()
public java.lang.String toString()
toString
in class java.lang.Object
public void setEle(int row, int col, double val)
row
- the rowcol
- the columnval
- value to setpublic void setEle(int row, int col, java.lang.Object val) throws EvaluationException
MatrixI
setEle
in interface MatrixI
val
- value to setEvaluationException
public java.lang.Object[][] toArray(java.lang.Object[][] mat) throws EvaluationException
MatrixI
toArray
in interface MatrixI
EvaluationException
- if mat is not a matrix of the correct sizepublic int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
eq(DoubleMatrix)
for comparison using ==.equals
in class java.lang.Object
public boolean eq(DoubleMatrix mat)
mat
- Copyright © 2018 Singular Systems http://www.singularsys.com/jep