Bases: TASSELpy.java.lang.Object.Object
Wrapper for the DoubleMatrix interface, which is implemented by several classes that call native methods
Methods
castTo(pyType) | Casts this object to another java/python type |
clone(*args) | Creates and returns a copy of this object |
column(*args) | Gets the column of the matrix as a column vector |
columnRank(*args) | Gets the column rank of this matrix |
columnSum(*args) | Sums a column |
concatenate(*args) | Puts two matrices together |
copy(*args) | Gets a copy of the matrix |
crossproduct(*args) | Get X’X or X’dm, where X is this matrix |
equals(*args) | Indicates whether some other object is “equal to” this one |
generalizedInverse(*args) | Gets the generalized inverse of a square matrix |
generalizedInverseWithRank(*args) | Inverts the matrix and returns the rank as the first element in rank[]. |
get(*args) | Gets data and doesn’t check to make sure they are in the matrix |
getArray(size) | Gets an empty wrapped java array that can accept the type of the wrapped |
getChecked(*args) | Gets data and checks to make sure they are in the matrix |
getClass(*args) | Returns the runtime class of this Object. |
getDblArray(rows[, cols]) | Gets an empty wrapped java array that can accept the type of other wrapped java arrays: i.e. |
getEigenvalueDecomposition(*args) | Gets the Eigenvalue decomposition of this matrix |
getSelection(*args) | Creates a new matrix consisting of the rows and columns of this matrix in the order specified. |
getSingularValueDecomposition(*args) | Gets the Singular Value decomposition of this matrix |
getXtXGM(*args) | Gets an array of three DoubleMatrices. |
hashCode(*args) | Returns a hash code vlaue for the object |
inverse(*args) | Returns the inverse of a square matrix, without modifying the original matrix. |
invert(*args) | This inverts a square matrix, replacing the original with the inverse |
minus(*args) | Subtracts a matrix from this matrix, X, without modifying X |
minusEquals(*args) | This function subtracts dm, modifying the original matrix |
mult(*args) | Multiply this matrix times another |
multadd(*args) | Using this function for combining multiplication and addition allows the |
numberOfColumns(*args) | Gets the number of columns in this matrix |
numberOfRows(*args) | Gets the number of rows in this matrix |
plus(*args) | Adds a matrix from this matrix, X, without modifying X |
plusEquals(*args) | This function adds dm, modifying the original matrix |
row(*args) | Gets the row of the matrix as a row vector |
rowSum(*args) | Sums a row |
scalarAdd(*args) | Adds a scalar to this matrix and returns a new matrix. |
scalarAddEquals(*args) | Adds a scalar s to this matrix, replacing the original matrix with the result |
scalarMult(*args) | Multiplies a scalar to this matrix and returns a new matrix. |
scalarMultEquals(*args) | Multiplies a scalar s to this matrix, replacing the original matrix with the result |
set(*args) | Sets the matrix value at row, col. |
setChecked(*args) | Sets the matrix value at row, col. |
solve(*args) | Solves the matrix |
tcrossproduct(*args) | Gets XX’ or Xdm’, where X is this matrix |
toString(*args) | Returns a string representation of the object |
transpose(*args) | Gets the tranpose of this matrix |
wrap_existing_array(arr_instance) | Wraps a java array of this class’s type |
Gets the column of the matrix as a column vector
Signature: | column (int j) |
---|---|
Parameters: | j (int) – A column index |
Returns: | The jth row of this matrix as a column vector |
Return type: | DoubleMatrix |
Gets the column rank of this matrix
Signature: | columnRank () |
---|---|
Returns: | The column rank of this matrix |
Return type: | int |
Sums a column
Signature: | columnSum (int column) |
---|---|
Parameters: | column (int) – The column index to sum |
Returns: | The sum of the elements in this column |
Return type: | double |
Puts two matrices together
Signature: | concatenate (DoubleMatrix dm, boolean rows) |
---|---|
Parameters: |
|
Returns: | Returns X with dm appended, where X is this matrix |
Return type: | DoubleMatrix |
Gets a copy of the matrix
Signature: | copy () |
---|---|
Returns: | A copy of the matrix |
Return type: | DoubleMatrix |
Get X’X or X’dm, where X is this matrix
Signature: | crossproduct () |
---|---|
Signature: | crossproduct (DoubleMatrix dm) |
Parameters: | dm (DoubleMatrix) – The second matrix |
Returns: | The cross product |
Return type: | DoubleMatrix |
Gets the generalized inverse of a square matrix
Signature: | generalizedInverse () |
---|---|
Returns: | The generalized inverse of a square matrix |
Return type: | DoubleMatrix |
Inverts the matrix and returns the rank as the first element in rank[]. The original matrix is not modified
Signature: | generalizedInverseWithRank (int[] rank) |
---|---|
Parameters: | rank (int[]) – Array to hold element where rank will be stored |
Returns: | A generalized inverse of this matrix |
Return type: | DoubleMatrix |
Gets data and doesn’t check to make sure they are in the matrix
Signature: | get (int row, int col) |
---|---|
Parameters: |
|
Returns: | The value at row, col |
Return type: | double |
Gets data and checks to make sure they are in the matrix
Signature: | getChecked (int row, int col) |
---|---|
Parameters: |
|
Returns: | The value at row, col |
Return type: | double |
Gets the Eigenvalue decomposition of this matrix
Signature: | getEigenvalueDecomposition () |
---|---|
Returns: | An Eigenvalue Decomposition of this matrix |
Return type: | EigenvalueDecomposition |
Creates a new matrix consisting of the rows and columns of this matrix in the order specified. If rows or columns is null, then all rows or columns, respectively, will be included
Signature: | getSelection (int[] rows, int[] columns) |
---|---|
Parameters: |
|
Returns: | A new matrix consisting of the specified rows and columns |
Return type: | DoubleMatrix |
Gets the Singular Value decomposition of this matrix
Signature: | getSingularValueDecomposition () |
---|---|
Returns: | An Singular Value Decomposition of this matrix |
Return type: | SingularValueDecomposition |
Gets an array of three DoubleMatrices. Where X is this matrix, the first is X’X, the second is the inverse of X’X, and the third is I-XGX’
Signature: | getXtXGM () |
---|---|
Returns: | An array of three DoubleMatrices. Where X is this matrix, the first is X’X, the second is the inverse of X’X, and the third is I-XGX’ |
Return type: | DoubleMatrix[] |
Returns the inverse of a square matrix, without modifying the original matrix.
Signature: | inverse () |
---|---|
Returns: | The inverse of a square matrix if it is non-singular, null otherwise |
Return type: | DoubleMatrix |
This inverts a square matrix, replacing the original with the inverse
Signature: | invert () |
---|
Subtracts a matrix from this matrix, X, without modifying X
Signature: | minus (DoubleMatrix dm) |
---|---|
Parameters: | dm (DoubleMatrix) – A DoubleMatrix to subtract |
Returns: | A new DoubleMatrix created by subtracting dm from this matrix |
Return type: | DoubleMatrix |
This function subtracts dm, modifying the original matrix
Signature: | minusEquals (DoubleMatrix dm) |
---|---|
Parameters: | dm (DoubleMatrix) – A DoubleMatrix to subtract |
Multiply this matrix times another
Signature: | mult (DoubleMatrix dm, boolean transpose, boolean transposedm) |
---|---|
Signature: | mult (DoubleMatrix dm) |
Parameters: |
|
Returns: | The multiplied matrix |
Return type: | DoubleMatrix |
Using this function for combining multiplication and addition allows the implementing library to optimize the operations
Signature: | multadd (DoubleMatrix A, DoubleMatrix B, double alpha, double beta, boolean transpose, boolean transposeA) |
---|---|
Parameters: |
|
Returns: | alpha*XA+beta*B where X is this matrix |
Return type: | DoubleMatrix |
Gets the number of columns in this matrix
Signature: | numberOfColumns () |
---|---|
Returns: | Number of columns in this matrix |
Return type: | int |
Gets the number of rows in this matrix
Signature: | numberOfRows () |
---|---|
Returns: | Number of rows in this matrix |
Return type: | int |
Adds a matrix from this matrix, X, without modifying X
Signature: | plus (DoubleMatrix dm) |
---|---|
Parameters: | dm (DoubleMatrix) – A DoubleMatrix to add |
Returns: | A new DoubleMatrix created by adding dm from this matrix |
Return type: | DoubleMatrix |
This function adds dm, modifying the original matrix
Signature: | plusEquals (DoubleMatrix dm) |
---|---|
Parameters: | dm (DoubleMatrix) – A DoubleMatrix to add |
Gets the row of the matrix as a row vector
Signature: | row (int i) |
---|---|
Parameters: | i (int) – a row index |
Returns: | The ith row of this matrix as a column vector |
Return type: | DoubleMatrix |
Sums a row
Signature: | rowSum (int row) |
---|---|
Parameters: | row (int) – The row index to sum |
Returns: | The sum of the elements in this row |
Return type: | double |
Adds a scalar to this matrix and returns a new matrix. The original is not modified
Signature: | scalarAdd (double s) |
---|---|
Parameters: | s (double) – a scalar |
Returns: | The sum of this matrix and a scalar s |
Return type: | DoubleMatrix |
Adds a scalar s to this matrix, replacing the original matrix with the result
Signature: | scalarAddEquals (double s) |
---|---|
Parameters: | s (double) – a scalar |
Multiplies a scalar to this matrix and returns a new matrix. The original is not modified
Signature: | scalarMult (double s) |
---|---|
Parameters: | s (double) – a scalar |
Returns: | The sum of this matrix and a scalar s |
Return type: | DoubleMatrix |
Multiplies a scalar s to this matrix, replacing the original matrix with the result
Signature: | scalarMultEquals (double s) |
---|---|
Parameters: | s (double) – a scalar |
Sets the matrix value at row, col. The coordinates are not checked to make sure they fall in the matrix
Signature: | set (int row, int col, double value) |
---|---|
Parameters: |
|
Sets the matrix value at row, col. The coordinates are checked to make sure they fall in the matrix
Signature: | setChecked (int row, int col, double value) |
---|---|
Parameters: |
|
Solves the matrix
Signature: | solve (DoubleMatrix Y) |
---|---|
Parameters: | Y (DoubleMatrix) – a DoubleMatrix |
Returns: | The least squares solutions for B, where XB = Y and X is this matrix |
Return type: | DoubleMatrix |
Bases: TASSELpy.java.lang.Object.Object
Builder for creating DoubleMatrix objects
Methods
castTo(pyType) | Casts this object to another java/python type |
clone(*args) | Creates and returns a copy of this object |
compose(*args) | Puts together a DoubleMatrix out of multiple matrices |
diagonal(*args) | Makes a diagonal matrix |
equals(*args) | Indicates whether some other object is “equal to” this one |
getArray(size) | Gets an empty wrapped java array that can accept the type of the wrapped |
getClass(*args) | Returns the runtime class of this Object. |
getDblArray(rows[, cols]) | Gets an empty wrapped java array that can accept the type of other wrapped java arrays: i.e. |
getType(*args) | Gets the FactoryType |
hashCode(*args) | Returns a hash code vlaue for the object |
identity(*args) | Makes an identity matrix |
make(*args) | Produces a DoubleMatrix |
setDefault(*args) | Sets the default DoubleMatrix type |
toString(*args) | Returns a string representation of the object |
wrap_existing_array(arr_instance) | Wraps a java array of this class’s type |
Constructor for DoubleMatrixFactory
Signature: | DoubleMatrixFactory (FactoryType type) |
---|---|
Parameters: | type (FactoryType) – One of the DoubleMatrixFactory.FactoryType types (ejml,jblas,colt,blas) |
Puts together a DoubleMatrix out of multiple matrices
Signature: | compose (DoubleMatrix[][] components) |
---|---|
Parameters: | components (DoubleMatrix[][]) – 2D array of submatrices to form the matrix |
Returns: | A DoubleMatrix composed of the submatrices |
Return type: | DoubleMatrix |
Makes a diagonal matrix
Signature: | diagonal (double[] diag) |
---|---|
Parameters: | diag (double[]) – The elements for the diagonal of the matrix |
Returns: | A DoubleMatrix with the specified elements along the diagonal |
Return type: | DoubleMatrix |
Gets the FactoryType
Signature: | getType () |
---|---|
Returns: | The FactoryType |
Return type: | FactoryType |
Makes an identity matrix
Signature: | identity (int n) |
---|---|
Parameters: | n (int) – The size of the identity matrix |
Returns: | A DoubleMatrix representing an identity matrix |
Return type: | DoubleMatrix |
Produces a DoubleMatrix
Signature: | make (int row, int col) |
---|---|
Signature: | make (int row, int col, double[] values) |
Signature: | make (int row, int col, double[] values, boolean columnMajor) |
Signature: | make (double[][] values) |
Signature: | make (int row, int col, double val) |
Parameters: |
|
Returns: | A DoubleMatrix |
Return type: | DoubleMatrix |