JaggedArrayMath Type

This provides array math for a special case of matrices, so called jagged arrays.

Static members

Static member Description

JaggedArrayMath.Add(a, arows, acols, b, brows, bcols, c, crows, ccols)

Full Usage: JaggedArrayMath.Add(a, arows, acols, b, brows, bcols, c, crows, ccols)

Parameters:
    a : float[][] - First operand.
    arows : int - Number of rows of a.
    acols : int - Number of columns of a.
    b : float[][] - Second operand.
    brows : int - Number of rows of b.
    bcols : int - Number of columns of b.
    c : float[][] - The matrix where to store the result. Has to be of same dimensions than a and b.
    crows : int - Number of rows of c.
    ccols : int - Number of columns of c.

Calculates a+b and stores the result in matrix c.

a : float[][]

First operand.

arows : int

Number of rows of a.

acols : int

Number of columns of a.

b : float[][]

Second operand.

brows : int

Number of rows of b.

bcols : int

Number of columns of b.

c : float[][]

The matrix where to store the result. Has to be of same dimensions than a and b.

crows : int

Number of rows of c.

ccols : int

Number of columns of c.

JaggedArrayMath.AddRow(a, arows, acols, b, brows, bcols, browToAdd, c, crows, ccols)

Full Usage: JaggedArrayMath.AddRow(a, arows, acols, b, brows, bcols, browToAdd, c, crows, ccols)

Parameters:
    a : float[][] - First operand.
    arows : int - Number of rows of a.
    acols : int - Number of columns of a.
    b : float[][] - Second operand.
    brows : int - Number of rows of b.
    bcols : int - Number of columns of b.
    browToAdd : int - The row number of matrix b which should be added to all rows of matrix a.
    c : float[][] - The matrix where to store the result. Has to be of same dimensions than a and b.
    crows : int - Number of rows of c.
    ccols : int - Number of columns of c.

Add the row browToAdd of matrix b to all rows of matrix a.

a : float[][]

First operand.

arows : int

Number of rows of a.

acols : int

Number of columns of a.

b : float[][]

Second operand.

brows : int

Number of rows of b.

bcols : int

Number of columns of b.

browToAdd : int

The row number of matrix b which should be added to all rows of matrix a.

c : float[][]

The matrix where to store the result. Has to be of same dimensions than a and b.

crows : int

Number of rows of c.

ccols : int

Number of columns of c.

JaggedArrayMath.DivideRow(a, arows, acols, b, brows, bcols, browForDivision, resultIfNull, c, crows, ccols)

Full Usage: JaggedArrayMath.DivideRow(a, arows, acols, b, brows, bcols, browForDivision, resultIfNull, c, crows, ccols)

Parameters:
    a : float[][] - First operand (minuend).
    arows : int - Number of rows of a.
    acols : int - Number of columns of a.
    b : float[][] - Second operand (subtrahend).
    brows : int - Number of rows of b.
    bcols : int - Number of columns of b.
    browForDivision : int - The row number of matrix b which serves as denominator.
    resultIfNull : float - If the denominator is null, the result is set to this number.
    c : float[][] - The matrix where to store the result. Has to be of same dimensions than a. Must not be identical to b.
    crows : int - Number of rows of c.
    ccols : int - Number of columns of c.

Divides all rows of matrix a by the row rowb of matrix b (element by element).

a : float[][]

First operand (minuend).

arows : int

Number of rows of a.

acols : int

Number of columns of a.

b : float[][]

Second operand (subtrahend).

brows : int

Number of rows of b.

bcols : int

Number of columns of b.

browForDivision : int

The row number of matrix b which serves as denominator.

resultIfNull : float

If the denominator is null, the result is set to this number.

c : float[][]

The matrix where to store the result. Has to be of same dimensions than a. Must not be identical to b.

crows : int

Number of rows of c.

ccols : int

Number of columns of c.

JaggedArrayMath.GetMatrixArray(n, m)

Full Usage: JaggedArrayMath.GetMatrixArray(n, m)

Parameters:
    n : int - First matrix dimension (rows).
    m : int - Second matrix dimension( columns).

Returns: float[][] Array of dimensions n x m.

Allocates an array of n x m values.

n : int

First matrix dimension (rows).

m : int

Second matrix dimension( columns).

Returns: float[][]

Array of dimensions n x m.

JaggedArrayMath.GetMatrixCopy(a)

Full Usage: JaggedArrayMath.GetMatrixCopy(a)

Parameters:
Returns: float[][] New jagged array with the same element values than matrix a.

Allocates an array of the same dimensions than the provided matrix a, and copies the element of a to the new array.

a : IROMatrix<float>

The matrix to copy.

Returns: float[][]

New jagged array with the same element values than matrix a.

JaggedArrayMath.Multiply(a, arows, acols, b, brows, bcols, c, crows, ccols)

Full Usage: JaggedArrayMath.Multiply(a, arows, acols, b, brows, bcols, c, crows, ccols)

Parameters:
    a : float[][] - First multiplicant.
    arows : int - Number of rows of a.
    acols : int - Number of columns of a.
    b : float[][] - Second multiplicant.
    brows : int - Number of rows of b.
    bcols : int - Number of columns of b.
    c : float[][] - The matrix where to store the result. Has to be of dimension (arows, bcols).
    crows : int - Number of rows of c.
    ccols : int - Number of columns of c.

Multiplies matrix a with matrix b and stores the result in matrix c.

a : float[][]

First multiplicant.

arows : int

Number of rows of a.

acols : int

Number of columns of a.

b : float[][]

Second multiplicant.

brows : int

Number of rows of b.

bcols : int

Number of columns of b.

c : float[][]

The matrix where to store the result. Has to be of dimension (arows, bcols).

crows : int

Number of rows of c.

ccols : int

Number of columns of c.

JaggedArrayMath.MultiplyFirstTransposed(a, arows, acols, b, brows, bcols, c, crows, ccols)

Full Usage: JaggedArrayMath.MultiplyFirstTransposed(a, arows, acols, b, brows, bcols, c, crows, ccols)

Parameters:
    a : float[][] - First multiplicant.
    arows : int - Number of rows of a.
    acols : int - Number of columns of a.
    b : float[][] - Second multiplicant.
    brows : int - Number of rows of b.
    bcols : int - Number of columns of b.
    c : float[][] - The matrix where to store the result. Has to be of dimension (acols, bcols).
    crows : int - Number of rows of c.
    ccols : int - Number of columns of c.

Multiplies matrix a_transposed with matrix b and stores the result in matrix c.

a : float[][]

First multiplicant.

arows : int

Number of rows of a.

acols : int

Number of columns of a.

b : float[][]

Second multiplicant.

brows : int

Number of rows of b.

bcols : int

Number of columns of b.

c : float[][]

The matrix where to store the result. Has to be of dimension (acols, bcols).

crows : int

Number of rows of c.

ccols : int

Number of columns of c.

JaggedArrayMath.MultiplyFirstTransposedWithItself(a, arows, acols, c, crows, ccols)

Full Usage: JaggedArrayMath.MultiplyFirstTransposedWithItself(a, arows, acols, c, crows, ccols)

Parameters:
    a : float[][] - First and second multiplicant.
    arows : int - Number of rows of a.
    acols : int - Number of columns of a.
    c : float[][] - The matrix where to store the result. Has to be of dimension (acols, acols).
    crows : int - Number of rows of c.
    ccols : int - Number of columns of c.

Multiplies matrix a_transposed with matrix a itself and stores the result in matrix c.

a : float[][]

First and second multiplicant.

arows : int

Number of rows of a.

acols : int

Number of columns of a.

c : float[][]

The matrix where to store the result. Has to be of dimension (acols, acols).

crows : int

Number of rows of c.

ccols : int

Number of columns of c.

JaggedArrayMath.MultiplyRow(a, arows, acols, b, brows, bcols, browToMultiply, c, crows, ccols)

Full Usage: JaggedArrayMath.MultiplyRow(a, arows, acols, b, brows, bcols, browToMultiply, c, crows, ccols)

Parameters:
    a : float[][] - First multiplicant.
    arows : int - Number of rows of a.
    acols : int - Number of columns of a.
    b : float[][] - Second multiplicant.
    brows : int - Number of rows of b.
    bcols : int - Number of columns of b.
    browToMultiply : int - The row number of matrix b to multiply.
    c : float[][] - The matrix where to store the result. Has to be of same dimension than a.
    crows : int - Number of rows of c.
    ccols : int - Number of columns of c.

Multiplies the row rowb of matrix b element by element to all rows of matrix a.

a : float[][]

First multiplicant.

arows : int

Number of rows of a.

acols : int

Number of columns of a.

b : float[][]

Second multiplicant.

brows : int

Number of rows of b.

bcols : int

Number of columns of b.

browToMultiply : int

The row number of matrix b to multiply.

c : float[][]

The matrix where to store the result. Has to be of same dimension than a.

crows : int

Number of rows of c.

ccols : int

Number of columns of c.

JaggedArrayMath.MultiplyScalar(a, arows, acols, b, c, crows, ccols)

Full Usage: JaggedArrayMath.MultiplyScalar(a, arows, acols, b, c, crows, ccols)

Parameters:
    a : float[][] - The first multiplicant.
    arows : int - Number of rows of a.
    acols : int - Number of columns of a.
    b : float - The second multiplicant.
    c : float[][] - The resulting matrix. Has to be of same dimensions than a.
    crows : int - Number of rows of c.
    ccols : int - Number of columns of c.

Multiplies the matrix a with a scalar value b and stores the result in c. Matrix a and c are allowed to be the same matrix.

a : float[][]

The first multiplicant.

arows : int

Number of rows of a.

acols : int

Number of columns of a.

b : float

The second multiplicant.

c : float[][]

The resulting matrix. Has to be of same dimensions than a.

crows : int

Number of rows of c.

ccols : int

Number of columns of c.

JaggedArrayMath.MultiplySecondTransposed(a, arows, acols, b, brows, bcols, c, crows, ccols)

Full Usage: JaggedArrayMath.MultiplySecondTransposed(a, arows, acols, b, brows, bcols, c, crows, ccols)

Parameters:
    a : float[][] - First multiplicant.
    arows : int - Number of rows of a.
    acols : int - Number of columns of a.
    b : float[][] - Second multiplicant.
    brows : int - Number of rows of b.
    bcols : int - Number of columns of b.
    c : float[][] - The matrix where to store the result. Has to be of dimension (arows, brows).
    crows : int - Number of rows of c.
    ccols : int - Number of columns of c.

Multiplies matrix a with matrix b_transposed and stores the result in matrix c.

a : float[][]

First multiplicant.

arows : int

Number of rows of a.

acols : int

Number of columns of a.

b : float[][]

Second multiplicant.

brows : int

Number of rows of b.

bcols : int

Number of columns of b.

c : float[][]

The matrix where to store the result. Has to be of dimension (arows, brows).

crows : int

Number of rows of c.

ccols : int

Number of columns of c.

JaggedArrayMath.Subtract(a, arows, acols, b, brows, bcols, c, crows, ccols)

Full Usage: JaggedArrayMath.Subtract(a, arows, acols, b, brows, bcols, c, crows, ccols)

Parameters:
    a : float[][] - First operand (minuend).
    arows : int - Number of rows of a.
    acols : int - Number of columns of a.
    b : float[][] - Second operand (subtrahend).
    brows : int - Number of rows of b.
    bcols : int - Number of columns of b.
    c : float[][] - The matrix where to store the result a-b. Has to be of same dimensions than a and b.
    crows : int - Number of rows of c.
    ccols : int - Number of columns of c.

Calculates a-b and stores the result in matrix c.

a : float[][]

First operand (minuend).

arows : int

Number of rows of a.

acols : int

Number of columns of a.

b : float[][]

Second operand (subtrahend).

brows : int

Number of rows of b.

bcols : int

Number of columns of b.

c : float[][]

The matrix where to store the result a-b. Has to be of same dimensions than a and b.

crows : int

Number of rows of c.

ccols : int

Number of columns of c.

JaggedArrayMath.SubtractColumn(a, arows, acols, b, brows, bcols, bcolToSubtract, c, crows, ccols)

Full Usage: JaggedArrayMath.SubtractColumn(a, arows, acols, b, brows, bcols, bcolToSubtract, c, crows, ccols)

Parameters:
    a : float[][] - First operand (minuend).
    arows : int - Number of rows of a.
    acols : int - Number of columns of a.
    b : float[][] - Second operand (subtrahend).
    brows : int - Number of rows of b.
    bcols : int - Number of columns of b.
    bcolToSubtract : int - The column number of matrix b which should be subtracted from all columns of matrix a.
    c : float[][] - The matrix where to store the result. Has to be of same dimensions than a. Must not be identical to b.
    crows : int - Number of rows of c.
    ccols : int - Number of columns of c.

Subtract the column bcolToSubtract of matrix b from all columns of matrix a.

a : float[][]

First operand (minuend).

arows : int

Number of rows of a.

acols : int

Number of columns of a.

b : float[][]

Second operand (subtrahend).

brows : int

Number of rows of b.

bcols : int

Number of columns of b.

bcolToSubtract : int

The column number of matrix b which should be subtracted from all columns of matrix a.

c : float[][]

The matrix where to store the result. Has to be of same dimensions than a. Must not be identical to b.

crows : int

Number of rows of c.

ccols : int

Number of columns of c.

JaggedArrayMath.SubtractProductFromSelf(a, arows, acols, b, brows, bcols, c, crows, ccols)

Full Usage: JaggedArrayMath.SubtractProductFromSelf(a, arows, acols, b, brows, bcols, c, crows, ccols)

Parameters:
    a : float[][] - First operand of multiplication.
    arows : int - Number of rows of a.
    acols : int - Number of columns of a.
    b : float[][] - Second operand of multiplication.
    brows : int - Number of rows of b.
    bcols : int - Number of columns of b.
    c : float[][] - The matrix where to store the result c = c - a*b. Has to be of same dimensions than the product of a and b.
    crows : int - Number of rows of c.
    ccols : int - Number of columns of c.

Calculates c = c - ab

a : float[][]

First operand of multiplication.

arows : int

Number of rows of a.

acols : int

Number of columns of a.

b : float[][]

Second operand of multiplication.

brows : int

Number of rows of b.

bcols : int

Number of columns of b.

c : float[][]

The matrix where to store the result c = c - a*b. Has to be of same dimensions than the product of a and b.

crows : int

Number of rows of c.

ccols : int

Number of columns of c.

JaggedArrayMath.SubtractProductFromSelf(a, arows, acols, b, c, crows, ccols)

Full Usage: JaggedArrayMath.SubtractProductFromSelf(a, arows, acols, b, c, crows, ccols)

Parameters:
    a : float[][] - First operand of multiplication.
    arows : int - Number of rows of a.
    acols : int - Number of columns of a.
    b : float - Second multiplicant.
    c : float[][] - The third operand and matrix where to store the result c = c - a*b. Has to be of same dimensions than a.
    crows : int - Number of rows of c.
    ccols : int - Number of columns of c.

Calculates c = c - ab

a : float[][]

First operand of multiplication.

arows : int

Number of rows of a.

acols : int

Number of columns of a.

b : float

Second multiplicant.

c : float[][]

The third operand and matrix where to store the result c = c - a*b. Has to be of same dimensions than a.

crows : int

Number of rows of c.

ccols : int

Number of columns of c.

JaggedArrayMath.SubtractRow(a, arows, acols, b, brows, bcols, browToSubtract, c, crows, ccols)

Full Usage: JaggedArrayMath.SubtractRow(a, arows, acols, b, brows, bcols, browToSubtract, c, crows, ccols)

Parameters:
    a : float[][] - First operand (minuend).
    arows : int - Number of rows of a.
    acols : int - Number of columns of a.
    b : float[][] - Second operand (subtrahend).
    brows : int - Number of rows of b.
    bcols : int - Number of columns of b.
    browToSubtract : int - The row number of matrix b which should be subtracted from all rows of matrix a.
    c : float[][] - The matrix where to store the result. Has to be of same dimensions than a. Must not be identical to b.
    crows : int - Number of rows of c.
    ccols : int - Number of columns of c.

Subtract the row browToSubtract of matrix b from all rows of matrix a.

a : float[][]

First operand (minuend).

arows : int

Number of rows of a.

acols : int

Number of columns of a.

b : float[][]

Second operand (subtrahend).

brows : int

Number of rows of b.

bcols : int

Number of columns of b.

browToSubtract : int

The row number of matrix b which should be subtracted from all rows of matrix a.

c : float[][]

The matrix where to store the result. Has to be of same dimensions than a. Must not be identical to b.

crows : int

Number of rows of c.

ccols : int

Number of columns of c.

JaggedArrayMath.ToMatrix(x, rows, cols)

Full Usage: JaggedArrayMath.ToMatrix(x, rows, cols)

Parameters:
    x : float[][] - The jagged array. Each double[] vector is a row of the matrix.
    rows : int - The number of (used) rows of the array.
    cols : int - The number of (used) columns of the array.

Returns: JaggedArrayMatrix A jagged array matrix wrapping the provided array with a IMatrix interface.

This wraps a jagged double array to the IMatrix interface. The data is not copied!

x : float[][]

The jagged array. Each double[] vector is a row of the matrix.

rows : int

The number of (used) rows of the array.

cols : int

The number of (used) columns of the array.

Returns: JaggedArrayMatrix

A jagged array matrix wrapping the provided array with a IMatrix interface.

JaggedArrayMath.ToTransposedMatrix(x, rows, cols)

Full Usage: JaggedArrayMath.ToTransposedMatrix(x, rows, cols)

Parameters:
    x : float[][] - The jagged array. Each double[] vector is a column of the matrix (because of transpose).
    rows : int - The number of (used) rows of the resulting matrix.
    cols : int - The number of (used) columns of the resulting matrix = length of the first level of the jagged array.

Returns: IMatrix<float> A IROMatrix wrapping the provided array so that it seems to be transposed.

This wraps a jagged double array to the IROMatrix interface so that the array appears to be transposed. The data is not copied!

x : float[][]

The jagged array. Each double[] vector is a column of the matrix (because of transpose).

rows : int

The number of (used) rows of the resulting matrix.

cols : int

The number of (used) columns of the resulting matrix = length of the first level of the jagged array.

Returns: IMatrix<float>

A IROMatrix wrapping the provided array so that it seems to be transposed.

JaggedArrayMath.ToTransposedROMatrix(x, rows, cols)

Full Usage: JaggedArrayMath.ToTransposedROMatrix(x, rows, cols)

Parameters:
    x : float[][] - The jagged array. Each double[] vector is a column of the matrix (because of transpose).
    rows : int - The number of (used) rows of the resulting matrix.
    cols : int - The number of (used) columns of the resulting matrix = length of the first level of the jagged array.

Returns: IROMatrix<float> A IROMatrix wrapping the provided array so that it seems to be transposed.

This wraps a jagged double array to the IROMatrix interface so that the array appears to be transposed. The data is not copied!

x : float[][]

The jagged array. Each double[] vector is a column of the matrix (because of transpose).

rows : int

The number of (used) rows of the resulting matrix.

cols : int

The number of (used) columns of the resulting matrix = length of the first level of the jagged array.

Returns: IROMatrix<float>

A IROMatrix wrapping the provided array so that it seems to be transposed.