Matrix Module

Types and nested modules

Type/Module Description

Generic

DataSource

Orientation

elem

Functions and values

Function or value Description

add a b

Full Usage: add a b

Parameters:
Returns: Matrix<float>

Performs a element wise addition of matrices a and b (a+b).
Only usable if both matrices have the same dimensions.

a : matrix

b : matrix

Returns: Matrix<float>

Example

colRange a

Full Usage: colRange a

Parameters:
Returns: int * int
a : Matrix<'a>
Returns: int * int

columnCovarianceMatrixOf df dataMatrix

Full Usage: columnCovarianceMatrixOf df dataMatrix

Parameters:
    df : int
    dataMatrix : Matrix<float>

Returns: Matrix<float>

computes the column specific covariance matrix of a data matrix as described at:

df : int
dataMatrix : Matrix<float>
Returns: Matrix<float>

columnPopulationCovarianceMatrixOf dataMatrix

Full Usage: columnPopulationCovarianceMatrixOf dataMatrix

Parameters:
    dataMatrix : Matrix<float> -

Returns: Matrix<float>

computes the column specific population covariance matrix of a data matrix

dataMatrix : Matrix<float>

Returns: Matrix<float>

Example

columnSampleCovarianceMatrixOf dataMatrix

Full Usage: columnSampleCovarianceMatrixOf dataMatrix

Parameters:
    dataMatrix : Matrix<float> -

Returns: Matrix<float>

computes the column specific sample covariance matrix of a data matrix

dataMatrix : Matrix<float>

Returns: Matrix<float>

Example

constDiag n x

Full Usage: constDiag n x

Parameters:
    n : int
    x : float

Returns: matrix
n : int
x : float
Returns: matrix

copy a

Full Usage: copy a

Parameters:
Returns: Matrix<float>

Builds a new matrix whose elements are identical to the elements of a.

a : matrix

Returns: Matrix<float>

Example

countBy f a

Full Usage: countBy f a

Parameters:
    f : float -> bool
    a : matrix

Returns: (bool * int) list
f : float -> bool
a : matrix
Returns: (bool * int) list

covarianceMatrixOf dataSource orientation dataMatrix

Full Usage: covarianceMatrixOf dataSource orientation dataMatrix

Parameters:
Returns: matrix

computes the orientation and dataSource specific covariance matrix of a dataMatrix\
dataSource - "Sample" or "Population". \
orientation - "RowWise" or "ColWise"

dataSource : DataSource

orientation : Orientation

dataMatrix : matrix

Returns: matrix

Example

cptMax a b

Full Usage: cptMax a b

Parameters:
Returns: Matrix<float>

Performs a element wise comparison of matrices a and b always preserving the greater value.
Only usable if both matrices have the same dimensions.

a : matrix

b : matrix

Returns: Matrix<float>

Example

cptMin a b

Full Usage: cptMin a b

Parameters:
Returns: Matrix<float>

Performs a element wise comparison of matrices a and b always preserving the smaller value.
Only usable if both matrices have the same dimensions.

a : matrix

b : matrix

Returns: Matrix<float>

Example

cptMul a b

Full Usage: cptMul a b

Parameters:
Returns: Matrix<float>

Performs a element wise multiplication of matrices a and b (a+b, Hadamard-Product).
Only usable if both matrices have the same dimensions.

a : matrix

b : matrix

Returns: Matrix<float>

Example

cptPow a y

Full Usage: cptPow a y

Parameters:
Returns: Matrix<float>
a : matrix
y : float
Returns: Matrix<float>

create m n x

Full Usage: create m n x

Parameters:
    m : int
    n : int
    x : float

Returns: Matrix<float>
m : int
n : int
x : float
Returns: Matrix<float>

diag v

Full Usage: diag v

Parameters:
Returns: Matrix<float>
v : vector
Returns: Matrix<float>

dot a b

Full Usage: dot a b

Parameters:
Returns: float
a : matrix
b : Matrix<float>
Returns: float

exists f a

Full Usage: exists f a

Parameters:
    f : float -> bool -
    a : matrix -

Returns: bool

Iterates the given Matrix row wise and applies function f element wise.
The iteration stops and returns true if an element satisfies the condition or false when the end of
the matrix is reached.

f : float -> bool

a : matrix

Returns: bool

Example

existsi f a

Full Usage: existsi f a

Parameters:
    f : int -> int -> float -> bool -
    a : matrix -

Returns: bool

Iterates the given Matrix row wise and applies function f element wise.
The iteration stops and returns true if an element satisfies the condition or false when the end of
the matrix is reached.

f : int -> int -> float -> bool

a : matrix

Returns: bool

Example

filterCols colPredicate m

Full Usage: filterCols colPredicate m

Parameters:
Returns: Matrix<'T>

Returns a matrix without the cols for which the given predicate returns false

The predicate function based on which the cols should be filtered. The resulting matrix will only contain rows for which this function returns true
The matrix to filter cols from

colPredicate : Vector<'T> -> bool

m : Matrix<'T>
Returns: Matrix<'T>

Example

filterRows rowPredicate m

Full Usage: filterRows rowPredicate m

Parameters:
Returns: Matrix<'T>

Returns a matrix without the rows for which the given predicate returns false

The predicate function based on which the rows should be filtered. The resulting matrix will only contain rows for which this function returns true
The matrix to filter rows from

rowPredicate : RowVector<'T> -> bool

m : Matrix<'T>
Returns: Matrix<'T>

Example

flattenColWise a

Full Usage: flattenColWise a

Parameters:
Returns: Vector<float>

Iterates the given Matrix column wise and places every element in a new vector with length n*m.

a : matrix

Returns: Vector<float>

Example

flattenRowWise a

Full Usage: flattenRowWise a

Parameters:
Returns: Vector<float>

Iterates the given Matrix row wise and places every element in a new vector with length n*m.

a : matrix

Returns: Vector<float>

Example

fold f z a

Full Usage: fold f z a

Parameters:
    f : 'a -> float -> 'a -
    z : 'a -
    a : matrix -

Returns: 'a

Applies a function f row wise to each element of the matrix, threading an accumulator argument through the computation.
The fold function takes the second argument, and applies the function f to it and the first element of the matrix.
Then, it feeds this result into the function f along with the second element, and so on. It returns the final result.
If the input function is f and the elements are i0...iN, then this function computes f (... (f s i0) i1 ...) iN.

f : 'a -> float -> 'a

z : 'a

a : matrix

Returns: 'a

Example

foldByCol f z a

Full Usage: foldByCol f z a

Parameters:
Returns: RowVector<'T>
f : 'T -> 'a -> 'T
z : RowVector<'T>
a : Matrix<'a>
Returns: RowVector<'T>

foldByRow f z a

Full Usage: foldByRow f z a

Parameters:
Returns: Vector<'T>
f : 'T -> 'a -> 'T
z : Vector<'T>
a : Matrix<'a>
Returns: Vector<'T>

foldCol f z a j

Full Usage: foldCol f z a j

Parameters:
    f : 'T -> 'a -> 'T
    z : 'T
    a : Matrix<'a>
    j : int

Returns: 'T
f : 'T -> 'a -> 'T
z : 'T
a : Matrix<'a>
j : int
Returns: 'T

foldRow f z a i

Full Usage: foldRow f z a i

Parameters:
    f : 'T -> 'a -> 'T
    z : 'T
    a : Matrix<'a>
    i : int

Returns: 'T
f : 'T -> 'a -> 'T
z : 'T
a : Matrix<'a>
i : int
Returns: 'T

foldi f z a

Full Usage: foldi f z a

Parameters:
    f : int -> int -> 'a -> float -> 'a -
    z : 'a -
    a : matrix -

Returns: 'a

Applies a function f row wise to each element of the matrix, threading an accumulator argument through the computation.
The fold function takes the second argument, and applies the function f to it and the first element of the matrix.
Then, it feeds this result into the function f along with the second element, and so on. It returns the final result.
If the input function is f and the elements are i0...iN, then this function computes f (... (f s i0) i1 ...) iN.
The integers indicies passed to the function indicate row and column position (from 0) the of the element being transformed.

f : int -> int -> 'a -> float -> 'a

z : 'a

a : matrix

Returns: 'a

Example

forall f a

Full Usage: forall f a

Parameters:
    f : float -> bool -
    a : matrix -

Returns: bool

Iterates the given Matrix row wise and applies function f element wise.
The iteration stops and returns false if an element fails the condition or true when the end of
the matrix is reached.

f : float -> bool

a : matrix

Returns: bool

Example

foralli f a

Full Usage: foralli f a

Parameters:
    f : int -> int -> float -> bool -
    a : matrix -

Returns: bool

Iterates the given Matrix row wise and applies function f element wise.
The iteration stops and returns false if an element fails the condition or true when the end of
the matrix is reached.

f : int -> int -> float -> bool

a : matrix

Returns: bool

Example

get a i j

Full Usage: get a i j

Parameters:
    a : Matrix<'a>
    i : int
    j : int

Returns: 'a
a : Matrix<'a>
i : int
j : int
Returns: 'a

getCol a j

Full Usage: getCol a j

Parameters:
Returns: Vector<float>

Returns col of index j of matrix a

a : matrix

j : int

Returns: Vector<float>

Example

getCols a j1 j2

Full Usage: getCols a j1 j2

Parameters:
    a : matrix -
    j1 : int -
    j2 : int -

Returns: Matrix<float>

Accesses the m*n matrix a and returns a total of j2 Columns starting from column index j1. The Result is a new
m*j2 matrix.
Only usable if (j1+j2-1) does not exceed n.

a : matrix

j1 : int

j2 : int

Returns: Matrix<float>

Example

getDiag a

Full Usage: getDiag a

Parameters:
Returns: Vector<float>
a : matrix
Returns: Vector<float>

getDiagN a n

Full Usage: getDiagN a n

Parameters:
Returns: Vector<float>
a : matrix
n : int
Returns: Vector<float>

getLowerTriangular a

Full Usage: getLowerTriangular a

Parameters:
Returns: matrix

Returns lower triangular Matrix by setting all values beneath the diagonal to Zero.
Warning: triangular matrices can only be computed for square input matrices.

a : Matrix<float>

Returns: matrix

Example

getRegion a i1 j1 i2 j2

Full Usage: getRegion a i1 j1 i2 j2

Parameters:
    a : matrix -
    i1 : int -
    j1 : int -
    i2 : int -
    j2 : int -

Returns: Matrix<float>

Accesses the m*n matrix a and returns a total of i2 rows and j2 columns starting from row index i1 and colum index j1. The Result is a new
i2*j2 matrix.
Only usable if (i1+i2-1) does not exceed m and (j1+j2-1) does not exceed n.

a : matrix

i1 : int

j1 : int

i2 : int

j2 : int

Returns: Matrix<float>

Example

getRow a i

Full Usage: getRow a i

Parameters:
Returns: RowVector<float>

Returns row of index i of matrix a

a : matrix

i : int

Returns: RowVector<float>

Example

getRows a i1 i2

Full Usage: getRows a i1 i2

Parameters:
    a : matrix -
    i1 : int -
    i2 : int -

Returns: Matrix<float>

Accesses the m*n matrix a and returns a total of i2 rows starting from row index i1. The Result is a new
i2*n matrix.
Only usable if (i1+i2-1) does not exceed m.

a : matrix

i1 : int

i2 : int

Returns: Matrix<float>

Example

getUpperTriangular a

Full Usage: getUpperTriangular a

Parameters:
Returns: matrix

Returns upper triangular Matrix by setting all values beneath the diagonal to Zero.
Warning: triangular matrices can only be computed for square input matrices.

a : Matrix<float>

Returns: matrix

Example

identity m

Full Usage: identity m

Parameters:
    m : int -

Returns: matrix

Creates a dense identiy m*m matrix. A identity matrix is always squared and the elements are set to zero exept elements
on the diagonal, which are set to 1.
e.g.
[[1.;0.;0.]
[0.;1.;0.]
[0.;0.;1.]]

m : int

Returns: matrix

Example

init m n f

Full Usage: init m n f

Parameters:
    m : int
    n : int
    f : int -> int -> float

Returns: Matrix<float>

returns a dense matrix with m rows and n rows, applying the init function with the two indices as arguments

m : int
n : int
f : int -> int -> float
Returns: Matrix<float>

initDense i j a

Full Usage: initDense i j a

Parameters:
    i : int -
    j : int -
    a : seq<int * int * float> -

Returns: matrix

Creates a dense matrix with i rows and j columns. All values are initialized to the value of a.

i : int

j : int

a : seq<int * int * float>

Returns: matrix

Example

initDiagonal v

Full Usage: initDiagonal v

Parameters:
Returns: Matrix<float>
v : vector
Returns: Matrix<float>

initSparse i j a

Full Usage: initSparse i j a

Parameters:
    i : int -
    j : int -
    a : seq<int * int * float> -

Returns: matrix

Creates a sparse matrix with i rows and j columns. All values are initialized to the value of a.

i : int

j : int

a : seq<int * int * float>

Returns: matrix

Example

inplaceAdd a b

Full Usage: inplaceAdd a b

Parameters:
a : matrix
b : Matrix<float>

inplaceSub a b

Full Usage: inplaceSub a b

Parameters:
a : matrix
b : Matrix<float>

inplace_assign f a

Full Usage: inplace_assign f a

Parameters:
    f : int -> int -> float
    a : matrix

f : int -> int -> float
a : matrix

inplace_cptMul a b

Full Usage: inplace_cptMul a b

Parameters:
a : matrix
b : Matrix<float>

inplace_mapi f a

Full Usage: inplace_mapi f a

Parameters:
    f : int -> int -> float -> float
    a : matrix

f : int -> int -> float -> float
a : matrix

inplace_scale a b

Full Usage: inplace_scale a b

Parameters:
a : float
b : matrix

map f a

Full Usage: map f a

Parameters:
    f : float -> float -
    a : matrix -

Returns: Matrix<float>

Builds a new matrix whose elements are the result of row wise applying the given function on each element of a.

f : float -> float

a : matrix

Returns: Matrix<float>

Example

mapCols f m

Full Usage: mapCols f m

Parameters:
Returns: RowVector<'a>

Applies function f along column axis

f : Vector<float> -> 'a

m : matrix

Returns: RowVector<'a>

Example

mapRows f m

Full Usage: mapRows f m

Parameters:
Returns: Vector<'a>

Applies function f along row axis

f : RowVector<float> -> 'a

m : matrix

Returns: Vector<'a>

Example

mapi f a

Full Usage: mapi f a

Parameters:
    f : int -> int -> float -> float -
    a : matrix -

Returns: matrix

Builds a new matrix whose elements are the result of row wise applying the given function on each element of a. The integer index
passed to the function indicates the index (from 0) the of the element being transformed.

f : int -> int -> float -> float

a : matrix

Returns: matrix

Example

mapiCols f m

Full Usage: mapiCols f m

Parameters:
Returns: RowVector<'b>

Maps every matrix column using the position dependant function

f : int -> vector -> 'b

m : matrix

Returns: RowVector<'b>

Example

mapiRows f m

Full Usage: mapiRows f m

Parameters:
Returns: Vector<'b>

Maps every matrix row using the position dependant function

f : int -> rowvec -> 'b

m : matrix

Returns: Vector<'b>

Example

meanAsSeq orientation a

Full Usage: meanAsSeq orientation a

Parameters:
Returns: seq<float>

Computes mean in the specified orientation

orientation - "RowWise" or "ColWise"

orientation : Orientation
a : matrix
Returns: seq<float>

meanColumnWise a

Full Usage: meanColumnWise a

Parameters:
Returns: RowVector<float>

Computes the Column wise mean of a Matrix

a : matrix

Returns: RowVector<float>

Example

meanRowWise a

Full Usage: meanRowWise a

Parameters:
Returns: Vector<float>

Computes the row wise mean of a Matrix

a : matrix

Returns: Vector<float>

Example

mul a b

Full Usage: mul a b

Parameters:
Returns: Matrix<float>

Performs a left sided matrix multiplication of a and b (a*b).
Only usable if both matrices have the same dimensions.

a : matrix

b : matrix

Returns: Matrix<float>

Example

mulRV a b

Full Usage: mulRV a b

Parameters:
Returns: RowVector<float>

Performs a matrix multiplication of the 1*n rowvector a and the m*n matrix b (a*b).
Only usable if column number (n) of the vector equals the row number (m) of the matrix.

a : rowvec

b : matrix

Returns: RowVector<float>

Example

mulV a b

Full Usage: mulV a b

Parameters:
Returns: Vector<float>

Performs a matrix multiplication m*n matrix a and the m*1 vector b (a*b).
Only usable if column number (n) of the matrix equals the row number (m) of the vector.

a : matrix

b : vector

Returns: Vector<float>

Example

neg a

Full Usage: neg a

Parameters:
Returns: Matrix<float>

Scales matrix a by element wise mulitplication with minus 1.

a : matrix

Returns: Matrix<float>

Example

nonzero_entries a

Full Usage: nonzero_entries a

Parameters:
Returns: seq<int * int * float>

Iterates the m*n matrix a row wise and returns a list of tuples (mi,ni,v) containing non zero elements of a
and their row (m) and column (n) indicies.

a : matrix

Returns: seq<int * int * float>

Example

norm a

Full Usage: norm a

Parameters:
Returns: float
a : matrix
Returns: float

ofArray2D arr

Full Usage: ofArray2D arr

Parameters:
    arr : float[,]

Returns: matrix
arr : float[,]
Returns: matrix

ofCols cols

Full Usage: ofCols cols

Parameters:
Returns: Matrix<float>

returns a dense matrix with the inner vectors of the input rowvector as its columns

cols : RowVector<Vector<float>>

Returns: Matrix<float>

Example

ofJaggedArray xss

Full Usage: ofJaggedArray xss

Parameters:
    xss : float[][]

Returns: Matrix<float>

returns a dense matrix with the inner arrays of the input jagged array as its rows

xss : float[][]
Returns: Matrix<float>

ofJaggedColArray xss

Full Usage: ofJaggedColArray xss

Parameters:
    xss : float[][]

Returns: Matrix<float>

returns a dense matrix with the inner arrays of the input jagged array as its columns

xss : float[][]
Returns: Matrix<float>

Example

ofJaggedColList xss

Full Usage: ofJaggedColList xss

Parameters:
    xss : float list list

Returns: Matrix<float>

returns a dense matrix with the inner lists of the input jagged list as its columns

xss : float list list
Returns: Matrix<float>

ofJaggedColSeq xss

Full Usage: ofJaggedColSeq xss

Parameters:
    xss : seq<'a>

Returns: Matrix<float>

returns a dense matrix with the inner sequences of the input jagged sequence as its columns

xss : seq<'a>
Returns: Matrix<float>

ofJaggedList xss

Full Usage: ofJaggedList xss

Parameters:
    xss : float list list

Returns: Matrix<float>

returns a dense matrix with the inner lists of the input jagged list as its rows

xss : float list list
Returns: Matrix<float>

ofJaggedSeq xss

Full Usage: ofJaggedSeq xss

Parameters:
    xss : seq<'b>

Returns: Matrix<float>

returns a dense matrix with the inner sequences of the input jagged sequences as its rows

xss : seq<'b>
Returns: Matrix<float>

ofRowVector x

Full Usage: ofRowVector x

Parameters:
Returns: matrix
x : RowVector<float>
Returns: matrix

ofRows rows

Full Usage: ofRows rows

Parameters:
Returns: Matrix<float>

returns a dense matrix with the inner rowvectors of the input vector as its rows

rows : Vector<RowVector<float>>

Returns: Matrix<float>

Example

ofScalar x

Full Usage: ofScalar x

Parameters:
    x : float

Returns: Matrix<float>
x : float
Returns: Matrix<float>

ofVector x

Full Usage: ofVector x

Parameters:
Returns: matrix
x : Vector<float>
Returns: matrix

ones m n

Full Usage: ones m n

Parameters:
    m : int -
    n : int -

Returns: Matrix<float>

Creates a dense matrix with i rows and j columns. All values are initialized to one (1.).

m : int

n : int

Returns: Matrix<float>

Example

prod a

Full Usage: prod a

Parameters:
Returns: float
a : matrix
Returns: float

randomize v

Full Usage: randomize v

Parameters:
Returns: Matrix<float>
v : matrix
Returns: Matrix<float>

readCSV path separator removeHeaderRow removeHeaderCol

Full Usage: readCSV path separator removeHeaderRow removeHeaderCol

Parameters:
    path : string -
    separator : char -
    removeHeaderRow : bool -
    removeHeaderCol : bool -

Returns: Matrix<float>

reads matrix from delimiter separated file

path : string

separator : char

removeHeaderRow : bool

removeHeaderCol : bool

Returns: Matrix<float>

Example

removeColAt index m

Full Usage: removeColAt index m

Parameters:
    index : int -
    m : Matrix<'a> -

Returns: Matrix<'a>

Removes a column at a given index

index : int

m : Matrix<'a>

Returns: Matrix<'a>

Example

removeRowAt index m

Full Usage: removeRowAt index m

Parameters:
    index : int -
    m : Matrix<'T> -

Returns: Matrix<'T>

Removes a row at a given index

index : int

m : Matrix<'T>

Returns: Matrix<'T>

Example

rowPopulationCovarianceMatrixOf dataMatrix

Full Usage: rowPopulationCovarianceMatrixOf dataMatrix

Parameters:
    dataMatrix : Matrix<float> -

Returns: Matrix<float>

computes the row specific population covariance matrix of a data matrix

dataMatrix : Matrix<float>

Returns: Matrix<float>

Example

rowRange a

Full Usage: rowRange a

Parameters:
Returns: int * int
a : Matrix<'a>
Returns: int * int

rowSampleCovarianceMatrixOf dataMatrix

Full Usage: rowSampleCovarianceMatrixOf dataMatrix

Parameters:
    dataMatrix : Matrix<float> -

Returns: Matrix<float>

computes the row specific sample covariance matrix of a data matrix

dataMatrix : Matrix<float>

Returns: Matrix<float>

Example

scale a b

Full Usage: scale a b

Parameters:
Returns: Matrix<float>

Builds a new matrix where the elements are the result of multiplying every element of the given matrix with the given value

a : float

b : matrix

Returns: Matrix<float>

Example

set a i j x

Full Usage: set a i j x

Parameters:
    a : Matrix<'a>
    i : int
    j : int
    x : 'a

a : Matrix<'a>
i : int
j : int
x : 'a

setCol a j v

Full Usage: setCol a j v

Parameters:

Replaces column of index j of matrix a with values of vector v, if vector length matches columnsize

a : Matrix<'a>

j : int

v : Vector<'a>

Example

setRow a i v

Full Usage: setRow a i v

Parameters:

Replaces row of index i of matrix a with values of vector v, if vector length matches rowsize

a : Matrix<'a>

i : int

v : Vector<'a>

Example

sparseOfArray2D arr

Full Usage: sparseOfArray2D arr

Parameters:
    arr : float[,] -

Returns: matrix

Creates a sparse matrix based on the CSR format

arr : float[,]

Returns: matrix

Example

splitCols indices m

Full Usage: splitCols indices m

Parameters:
    indices : int[] -
    m : Matrix<'a> -

Returns: Matrix<'a> * Matrix<'a>

Splits a matrix along column direction according to given indices. Returns (matrix including cols according to indices, rest)

indices : int[]

m : Matrix<'a>

Returns: Matrix<'a> * Matrix<'a>

Example

splitRows indices m

Full Usage: splitRows indices m

Parameters:
    indices : int[] -
    m : Matrix<'a> -

Returns: Matrix<'a> * Matrix<'a>

Splits a matrix along row direction according to given indices. Returns (matrix including rows according to indices, rest)

indices : int[]

m : Matrix<'a>

Returns: Matrix<'a> * Matrix<'a>

Example

sub a b

Full Usage: sub a b

Parameters:
Returns: Matrix<float>

Performs a element wise substraction of matrices a and b (a-b).
Only usable if both matrices have the same dimensions.

a : matrix

b : matrix

Returns: Matrix<float>

Example

sum a

Full Usage: sum a

Parameters:
Returns: float
a : matrix
Returns: float

sumColumns a

Full Usage: sumColumns a

Parameters:
Returns: RowVector<float>

Computes the column wise sums of a Matrix

a : matrix

Returns: RowVector<float>

Example

sumRows a

Full Usage: sumRows a

Parameters:
Returns: Vector<float>

Computes the row wise sums of a Matrix

a : matrix

Returns: Vector<float>

Example

toArray2D m

Full Usage: toArray2D m

Parameters:
Returns: float[,]
m : matrix
Returns: float[,]

toDense a

Full Usage: toDense a

Parameters:
Returns: Matrix<float>

Transforms the matrix a to a dense matrix representation

a : matrix

Returns: Matrix<float>

Example

toDiagonal a

Full Usage: toDiagonal a

Parameters:
Returns: Matrix<float>

Returns diagonal matrix by setting all values beneath and above the diagonal to Zero.
Warning: diagonal matrices can only be computed for square input matrices.

a : Matrix<float>

Returns: Matrix<float>

Example

toJaggedArray m

Full Usage: toJaggedArray m

Parameters:
Returns: float[][]
m : matrix
Returns: float[][]

toJaggedColArray m

Full Usage: toJaggedColArray m

Parameters:
Returns: float[][]

converts the matrix into an array of column arrays

m : matrix

Returns: float[][]

Example

toJaggedColSeq m

Full Usage: toJaggedColSeq m

Parameters:
Returns: seq<seq<float>>

converts the matrix into an seq of column seqs

m : matrix

Returns: seq<seq<float>>

Example

toJaggedSeq m

Full Usage: toJaggedSeq m

Parameters:
Returns: seq<seq<float>>

converts the matrix into an seq of row seqs

m : matrix

Returns: seq<seq<float>>

Example

toRowVector x

Full Usage: toRowVector x

Parameters:
Returns: rowvec
x : Matrix<float>
Returns: rowvec

toScalar x

Full Usage: toScalar x

Parameters:
Returns: float
x : Matrix<float>
Returns: float

toSparse a

Full Usage: toSparse a

Parameters:
Returns: Matrix<float>

Transforms the matrix a to a sparse matrix representation

a : matrix

Returns: Matrix<float>

Example

toVector x

Full Usage: toVector x

Parameters:
Returns: vector
x : Matrix<float>
Returns: vector

trace a

Full Usage: trace a

Parameters:
Returns: float

Computes the trace of matrix a by summing elements of the diagonal.
Only usable if matrices a is a square matrix (m*m).

a : matrix

Returns: float

Example

transpose a

Full Usage: transpose a

Parameters:
Returns: Matrix<float>

Returns the transpose of matrix a

a : matrix

Returns: Matrix<float>

Example

wholeRegion a

Full Usage: wholeRegion a

Parameters:
Returns: (int * int) * (int * int)
a : Matrix<'a>
Returns: (int * int) * (int * int)

x

Full Usage: x

Returns: ('a -> 'b -> 'a) -> 'a -> 'b list -> 'a
Returns: ('a -> 'b -> 'a) -> 'a -> 'b list -> 'a

zero m n

Full Usage: zero m n

Parameters:
    m : int -
    n : int -

Returns: Matrix<float>

Creates a dense matrix with i rows and j columns. All values are initialized to yero (0.).

m : int

n : int

Returns: Matrix<float>

Example