public class Array2D
extends java.lang.Object
Matrix.Matrix| Constructor and Description |
|---|
Array2D(double[][] A)
Constructor.
|
Array2D(int rows,
int cols)
Constructor of all-zero matrix.
|
Array2D(int rows,
int cols,
double value)
Constructor.
|
Array2D(int rows,
int cols,
double[] value)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
Array2D |
add(Array2D b) |
Array2D |
add(double x) |
double |
add(int i,
int j,
double x) |
double |
apply(int i,
int j)
Returns A(i, j).
|
Array2D |
div(Array2D b) |
Array2D |
div(double x) |
double |
div(int i,
int j,
double x) |
double |
get(int i,
int j)
Returns A(i, j).
|
Array2D |
mul(Array2D b) |
Array2D |
mul(double x) |
double |
mul(int i,
int j,
double x) |
int |
ncols() |
int |
nrows() |
Array2D |
replaceNaN(double x) |
double |
set(int i,
int j,
double x)
Sets A(i, j).
|
Array2D |
sub(Array2D b) |
Array2D |
sub(double x) |
double |
sub(int i,
int j,
double x) |
double |
sum() |
java.lang.String |
toString() |
java.lang.String |
toString(boolean full)
Returns the string representation of matrix.
|
java.lang.String |
toString(int m,
int n)
Returns the string representation of matrix.
|
public Array2D(double[][] A)
A - the array of matrix.public Array2D(int rows,
int cols)
public Array2D(int rows,
int cols,
double value)
public Array2D(int rows,
int cols,
double[] value)
value - the array of matrix values arranged in row major formatpublic int nrows()
public int ncols()
public double apply(int i,
int j)
public double get(int i,
int j)
public double set(int i,
int j,
double x)
public double add(int i,
int j,
double x)
public double sub(int i,
int j,
double x)
public double mul(int i,
int j,
double x)
public double div(int i,
int j,
double x)
public Array2D add(double x)
public Array2D sub(double x)
public Array2D mul(double x)
public Array2D div(double x)
public Array2D replaceNaN(double x)
public double sum()
public java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.String toString(boolean full)
full - Print the full matrix if true. Otherwise,
print only top left 7 x 7 submatrix.public java.lang.String toString(int m,
int n)
m - the number of rows to print.n - the number of columns to print.