api / koma.matrix.common / DoubleFactoryBase

DoubleFactoryBase

abstract class DoubleFactoryBase<T :Matrix<Double>> :MatrixFactory<T>

Some functionality to help more easily implement double based koma backends. Feel free to not use if your backend has fast implementations of these functions.

Constructors

Name Summary
<init> DoubleFactoryBase()
Some functionality to help more easily implement double based koma backends. Feel free to not use if your backend has fast implementations of these functions.

Functions

Name Summary
arange open fun arange(start:Double, stop:Double, increment:Double):T
open fun arange(start:Int, stop:Int, increment:Int):T
Creates a row-vector with the first value of start and the last value of stop, with increment steps between each value.open fun arange(start:Double, stop:Double):T
open fun arange(start:Int, stop:Int):T
Creates a row-vector with the first value of start and the last value of stop, with unit steps between each value.
rand open fun rand(rows:Int, cols:Int):T
Creates a matrix of uniform 0-1 random samples
randn open fun randn(rows:Int, cols:Int):T
Creates a matrix of unit-normal random samples

Inherited Functions

Name Summary
create abstract fun create(data:IntRange):T
Creates a row-vector with initial values pulled from an int range, e.g. 1..45abstract fun create(data:DoubleArray):T
Creates a row-vector with initial values pulled from a double arrayabstract fun create(data:Array<DoubleArray>):T
Creates a matrix from an array of arrays (row-major)
eye abstract fun eye(size:Int):T
Creates an identity matrix of the requested shapeabstract fun eye(rows:Int, cols:Int):T
Creates an identity matrix of the requested shape, with zero padding if the axis lengths arent equal.
ones abstract fun ones(rows:Int, cols:Int):T
Creates a one initialized matrix of the requested shape
zeros abstract fun zeros(rows:Int, cols:Int):T
Generate a zero initialized matrix of the requested shape.

Inheritors

Name Summary
CBlasMatrixFactory class CBlasMatrixFactory :DoubleFactoryBase<CBlasMatrix>
EJMLMatrixFactory class EJMLMatrixFactory :DoubleFactoryBase<EJMLMatrix>
JBlasMatrixFactory class JBlasMatrixFactory :DoubleFactoryBase<JBlasMatrix>
MTJMatrixFactory class MTJMatrixFactory :DoubleFactoryBase<MTJMatrix>