Represents a matrix in the mathematical sense and is the central type of this library. Row dimension, column dimension and the data type of the elements are set at compile-time. Elements are indexed zero-based. Concrete subclasses of this trait implement immutable storage and access to the elements of the matrix. Implementations for non-mathematical helper methods (mkString
etc.) are provided here, but can be overridden. Mathematical operations are handled by type classes.
Matrix elements are indexed according to the following pattern: | 0,0 | 0,1 | 0,2 | 0,colIdx | ... | 0,colDim-1 | |:-----------|:---------|:----|:--------------|:----|:------------------| | 1,0 | 1,1 | 1,2 | 1,colIdx | ... | ... | | 2,0 | 2,1 | 2,2 | ... | ... | ... | | rowIdx,0 | rowIdx,1 | ... | rowIdx,colIdx | ... | ... | | ... | ... | ... | ... | ... | ... | | rowDim-1,0 | ... | ... | ... | ... | rowDim-1,colDim-1 |
Type parameters
- C
-
column dimension
- R
-
row dimension
- T
-
element type
Attributes
- Companion
- object
- Graph
-
- Supertypes
-
class Objecttrait Matchableclass Any
- Known subtypes
-
- Self type
-
Members list
Value members
Abstract methods
Returns the element at the index specified at runtime.
Returns the element at the index specified at runtime.
Value parameters
- colIdx
-
column index
- rowIdx
-
row index
Attributes
Concrete methods
Performs a Matrix Addition.
Performs a Matrix Addition.
Attributes
Performs a Matrix Subtraction.
Performs a Matrix Subtraction.
Attributes
Checks the equality of this and the other Matrix by performing element-wise comparision.
Checks the equality of this and the other Matrix by performing element-wise comparision.
Attributes
- Returns
-
true
if both Matrices are equal
Returns the element at the index specified at compile-time.
Returns the element at the index specified at compile-time.
Type parameters
- ColIdx
-
column index
- RowIdx
-
row index
Attributes
Returns the column dimension.
Returns the column dimension.
Attributes
Combines this Matrix and the other Matrix by applying the specified operation on the respective corresponding elements.
Combines this Matrix and the other Matrix by applying the specified operation on the respective corresponding elements.
Attributes
Returns the determinant of this Matrix. Requires that this Matrix is a squared Matrix.
Returns the determinant of this Matrix. Requires that this Matrix is a squared Matrix.
Attributes
Performs a Matrix Multiplication by calculating the dot product.
Performs a Matrix Multiplication by calculating the dot product.
Attributes
Folds over the elements of this Matrix by invoking the specified operation with each element's index and the result of the previous invocation.
Folds over the elements of this Matrix by invoking the specified operation with each element's index and the result of the previous invocation.
Value parameters
- op
-
operation applied to each element (index)
- start
-
value provided to the first invocation
Attributes
- Returns
-
result of the last invocation of the specified operation
Returns the inverse of this Matrix. Requires that this Matrix is a squared Matrix.
Returns the inverse of this Matrix. Requires that this Matrix is a squared Matrix.
Attributes
Iterates over this Matrix by invoking the specified operation with each element's index.
Iterates over this Matrix by invoking the specified operation with each element's index.
Attributes
Maps this Matrix to a new Matrix by applying the specified operation element-wise.
Maps this Matrix to a new Matrix by applying the specified operation element-wise.
Attributes
Renders this Matrix to a String using the elements' toString
method.
Renders this Matrix to a String using the elements' toString
method.
Attributes
Renders this Matrix to a String using the specified function.
Renders this Matrix to a String using the specified function.
Attributes
Allows to easily "modify" this Matrix by creating a Builder
initialized with the values of this Matrix.
Allows to easily "modify" this Matrix by creating a Builder
initialized with the values of this Matrix.
Attributes
Returns the row dimension.
Returns the row dimension.
Attributes
Returns the submatrix with the specified bounds.
Returns the submatrix with the specified bounds.
Type parameters
- ColIdxBR
-
column index of the bottom-right vertex
- ColIdxTL
-
column index of the top-left vertex
- RowIdxBR
-
row index of the bottom-right vertex
- RowIdxTL
-
row index of the top-left vertex