org.genepattern.data.matrix
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Constructor Summary | |
DoubleMatrix2D(double[][] data)
Creates a new matrix |
|
DoubleMatrix2D(double[][] data,
java.lang.String[] rowNames,
java.lang.String[] columnNames)
Creates a new matrix |
|
DoubleMatrix2D(int rows,
int columns)
Creates a new matrix |
|
| Method Summary | |
DoubleMatrix2D |
copy()
Make a deep copy of this matrix |
double |
det()
Matrix determinant |
double |
get(int row,
int column)
Gets a single element |
double[][] |
getArray()
Gets the underlying double[][] array |
int |
getColumnCount()
Gets the column dimension. |
int |
getColumnIndex(java.lang.String columnName)
Gets the column index for the column name . |
java.lang.String |
getColumnName(int columnIndex)
Gets the column name at the specified index |
java.lang.String[] |
getColumnNames()
Allocates a new array contains the column names |
double[] |
getRow(int row)
Gets the underlying array at the given row |
int |
getRowCount()
Gets the row dimension. |
int |
getRowIndex(java.lang.String rowName)
Gets the row index for the row name . |
java.lang.String |
getRowName(int rowIndex)
Gets the row name at the specified index |
java.lang.String[] |
getRowNames()
Allocates a new array contains the row names |
DoubleMatrix2D |
minus(DoubleMatrix2D B)
C = A - B |
DoubleMatrix2D |
plus(DoubleMatrix2D B)
C = A + B |
void |
print(java.io.PrintStream ps,
java.lang.String delimiter)
Prints this matrix in delimitted format using the default number format. |
void |
print(java.io.PrintStream ps,
java.lang.String delimiter,
java.text.NumberFormat nf)
Prints this matrix in delimitted format. |
int |
rank()
Returns the effective numerical rank, obtained from Singular Value Decomposition. |
void |
set(int rowIndex,
int columnIndex,
double value)
Sets a single element. |
void |
set(java.lang.String rowName,
java.lang.String columnName,
double value)
Sets a single element. |
void |
setColumnName(int columnIndex,
java.lang.String name)
Sets the column name at the specified index |
void |
setRowName(int rowIndex,
java.lang.String name)
Sets the row name at the specified index |
DoubleMatrix2D |
slice(int[] rowIndices,
int[] columnIndices)
Constructs and returns a new matrix that contains the indicated cells. |
DoubleMatrix2D |
slice(java.lang.String[] rowNames,
java.lang.String[] columnNames)
Constructs and returns a new matrix that contains the indicated cells. |
DoubleMatrix2D |
times(double d)
Multiply a matrix by a scalar, C = s*A |
DoubleMatrix2D |
times(DoubleMatrix2D B)
Linear algebraic matrix multiplication, A * B |
double |
trace()
Computes the sum of the diagonal elements of matrix A; Sum(A[i,i]). |
DoubleMatrix2D |
transpose()
Matrix transpose. |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public DoubleMatrix2D(double[][] data)
data - The data.
public DoubleMatrix2D(double[][] data,
java.lang.String[] rowNames,
java.lang.String[] columnNames)
data - The data.rowNames - the row namescolumnNames - the column names
public DoubleMatrix2D(int rows,
int columns)
rows - The number of rows.columns - The number of columns.| Method Detail |
public void print(java.io.PrintStream ps,
java.lang.String delimiter)
ps - the print streamdelimiter - the delimiter between columnsprint(java.io.PrintStream, String, java.text.NumberFormat)
public void print(java.io.PrintStream ps,
java.lang.String delimiter,
java.text.NumberFormat nf)
ps - the print streamdelimiter - the delimiter between columnsnf - the formatterpublic DoubleMatrix2D transpose()
public DoubleMatrix2D slice(java.lang.String[] rowNames, java.lang.String[] columnNames)
rowNames - The row names of the cells in the new matrix. To indicate that
the new matrix should contain all rows, set this parameter to
null.columnNames - The column names of the cells in the new matrix. To indicate
that the new matrix should contain all columns, set this
parameter to null.
java.lang.IllegalArgumentException - if an index occcurs more than once.slice(int[], int[])public DoubleMatrix2D slice(int[] rowIndices, int[] columnIndices)
rowIndices - The rows of the cells in the new matrix. To indicate that the
new matrix should contain all rows, set this parameter to
null.columnIndices - The columns of the cells in the new matrix. To indicate that
the new matrix should contain all columns, set this parameter
to null.
java.lang.IllegalArgumentException - if an index occcurs more than once.slice(String[], String[])public DoubleMatrix2D times(DoubleMatrix2D B)
B - another matrix
public DoubleMatrix2D times(double d)
d - a scalar
public DoubleMatrix2D copy()
public DoubleMatrix2D plus(DoubleMatrix2D B)
B - another matrix
public DoubleMatrix2D minus(DoubleMatrix2D B)
B - another matrix
public double det()
public int rank()
public double trace()
public void set(int rowIndex,
int columnIndex,
double value)
value - A(row,column).rowIndex - The row index.columnIndex - The column index.
public void set(java.lang.String rowName,
java.lang.String columnName,
double value)
value - A(row,column).rowName - The row name.columnName - The column name.
public void setColumnName(int columnIndex,
java.lang.String name)
columnIndex - The column index.name - The new columnName value
public void setRowName(int rowIndex,
java.lang.String name)
rowIndex - The new rowName valuename - The new rowName valuepublic int getRowIndex(java.lang.String rowName)
rowName - the row name.
public int getColumnIndex(java.lang.String columnName)
columnName - the column name.
public double get(int row,
int column)
row - Row index.column - Column index.
public double[] getRow(int row)
row - Row index
public double[][] getArray()
public java.lang.String getRowName(int rowIndex)
rowIndex - The row index.
public java.lang.String getColumnName(int columnIndex)
columnIndex - The column index.
public java.lang.String[] getColumnNames()
public java.lang.String[] getRowNames()
public int getRowCount()
public int getColumnCount()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||