trait MatrixFactory[R <: Int, C <: Int, T](using x$1: Numeric[T])(using x$2: ValueOf[R], x$3: ValueOf[C])
Central entry point for creating Matrices. Modules implementing the Matrix
trait should also
provide an instance of this type class.
- Companion:
- object
class Object
trait Matchable
class Any
Value members
Abstract methods
Concrete methods
def fromTuple[MatrixTuple <: Tuple, RowTuple <: Tuple](matrixTuple: MatrixTuple)(using matrixReader: MatrixTupleReader[MatrixTuple, RowTuple], rowReader: RowTupleReader[RowTuple, T])(using Size[MatrixTuple] =:= R, Size[RowTuple] =:= C): Matrix[R, C, T]
Creates a Matrix with the specified elements that are structured row by row by tuples.
Creates a Matrix with the specified elements that are structured row by row by tuples.
Dimensions will be checked at compile-time.
When invoking this method the following import has to be in place:
import matr.TupleSupport.given
The creation of i.e. a 2x3 Matrix looks like this:
val m = MatrixFactory[2, 3, Int].fromTuple(
(11, 12, 13),
(21, 22, 23)
)
Creates a Matrix containing the specified elements, assuming row-major order. Dimensions will be checked at runtime.
Creates a Matrix containing the specified elements, assuming row-major order. Dimensions will be checked at runtime.