Class: ComplexDenseMatrix

LinearAlgebra. ComplexDenseMatrix


new ComplexDenseMatrix()

This class represents a m by n complex matrix where every entry, including
zero-valued entries, is stored explicitly. Do not create a ComplexDenseMatrix
from its constructor, instead use static factory methods such as zeros,
identity, ones, constant and random.

Example
let A = ComplexDenseMatrix.zeros(20, 5);
let B = ComplexDenseMatrix.identity(10, 10);
let C = ComplexDenseMatrix.ones(100, 1);
let D = ComplexDenseMatrix.constant(new Complex(1, 2), 5, 5);
let E = ComplexDenseMatrix.random(5, 20);

Methods


<static> zeros(m, n)

Initializes a m by n matrix of zeros.

Parameters:
Name Type Description
m number

The number of rows in this complex dense matrix.

n number

The number of columns in this complex dense matrix.

Returns:
Type
module:LinearAlgebra.ComplexDenseMatrix

<static> identity(m, n)

Initializes a m by n identity matrix.

Parameters:
Name Type Description
m number

The number of rows in this complex dense matrix.

n number

The number of columns in this complex dense matrix.

Returns:
Type
module:LinearAlgebra.ComplexDenseMatrix

<static> ones(m, n)

Initializes a m by n matrix of ones.

Parameters:
Name Type Description
m number

The number of rows in this complex dense matrix.

n number

The number of columns in this complex dense matrix.

Returns:
Type
module:LinearAlgebra.ComplexDenseMatrix

<static> constant(x, m, n)

Initializes a m by n constant matrix.

Parameters:
Name Type Description
x module:LinearAlgebra.Complex

The constant value stored in every entry of this complex dense matrix.

m number

The number of rows in this complex dense matrix.

n number

The number of columns in this complex dense matrix.

Returns:
Type
module:LinearAlgebra.ComplexDenseMatrix

<static> random(m, n)

Initializes a m by n random matrix.

Parameters:
Name Type Description
m number

The number of rows in this complex dense matrix.

n number

The number of columns in this complex dense matrix.

Returns:
Type
module:LinearAlgebra.ComplexDenseMatrix

transpose()

Returns the transpose of this complex dense matrix.

Returns:
Type
module:LinearAlgebra.ComplexDenseMatrix

conjugate()

Returns the conjugate of this complex dense matrix.

Returns:
Type
module:LinearAlgebra.ComplexDenseMatrix

nRows()

Returns the number of rows in this complex dense matrix.

Returns:
Type
number

nCols()

Returns the number of columns in this complex dense matrix.

Returns:
Type
number

norm(n)

Computes the lInfinity, l1 or l2 norm of this complex dense matrix.

Parameters:
Name Type Description
n number

Computes the lInfinity norm if n = 0, l1 norm if n = 1
and l2 norm if n = 2.

Returns:
Type
number

rank()

Returns the rank of this complex dense matrix.

Returns:
Type
number

sum()

Sums all the entries in this complex dense matrix.

Returns:
Type
module:LinearAlgebra.Complex

subMatrix(r0, r1, c0, c1)

Extracts a sub-matrix in the range [r0, r1) x [c0, c1), i.e., a matrix
of size (r1 - r0) x (c1 - c0) starting at indices (r0, c0).

Parameters:
Name Type Description
r0 number

The start row index.

r1 number

The end row index (not included).

c0 number

The start column index.

c1 number

The end column index (not included).

Returns:
Type
module:LinearAlgebra.ComplexDenseMatrix

incrementBy(B)

A += B

Parameters:
Name Type Description
B module:LinearAlgebra.ComplexDenseMatrix

The complex dense matrix added to this complex dense matrix.


decrementBy(B)

A -= B

Parameters:
Name Type Description
B module:LinearAlgebra.ComplexDenseMatrix

The complex dense matrix subtracted from this complex dense matrix.


scaleBy(s)

A *= s

Parameters:
Name Type Description
s module:LinearAlgebra.Complex

The complex number this complex dense matrix is scaled by.


plus(B)

Returns A + B

Parameters:
Name Type Description
B module:LinearAlgebra.ComplexDenseMatrix

The complex dense matrix added to this complex dense matrix.

Returns:
Type
module:LinearAlgebra.ComplexDenseMatrix

minus(B)

Returns A - B

Parameters:
Name Type Description
B module:LinearAlgebra.ComplexDenseMatrix

The complex dense matrix subtracted from this
complex dense matrix.

Returns:
Type
module:LinearAlgebra.ComplexDenseMatrix

timesComplex(s)

Returns A * s

Parameters:
Name Type Description
s module:LinearAlgebra.Complex

The complex number this complex dense matrix is multiplied by.

Returns:
Type
module:LinearAlgebra.ComplexDenseMatrix

timesDense(B)

Returns A * B

Parameters:
Name Type Description
B module:LinearAlgebra.ComplexDenseMatrix

The complex dense matrix this complex dense matrix
is multiplied by.

Returns:
Type
module:LinearAlgebra.ComplexDenseMatrix

negated()

Returns -A

Returns:
Type
module:LinearAlgebra.ComplexDenseMatrix

get(i, j)

Returns A(i, j)

Parameters:
Name Type Description
i number

The ith row of this complex dense matrix.

j number

The jth column of this complex dense matrix.

Returns:
Type
module:LinearAlgebra.Complex

set(x, i, j)

A(i, j) = x

Parameters:
Name Type Description
x module:LinearAlgebra.Complex

The complex value the (i, j)th entry of this complex dense
matrix is set to.

i number

The ith row of this complex dense matrix.

j number

The jth column of this complex dense matrix.


hcat(B)

Concatenates two complex dense matrices horizontally.

Parameters:
Name Type Description
B module:LinearAlgebra.ComplexDenseMatrix

The complex dense matrix that is concatenated horizontally
with this complex dense matrix.

Returns:
Type
module:LinearAlgebra.ComplexDenseMatrix

vcat(B)

Concatenates two complex dense matrices vertically.

Parameters:
Name Type Description
B module:LinearAlgebra.ComplexDenseMatrix

The complex dense matrix that is concatenated vertically
with this complex dense matrix.

Returns:
Type
module:LinearAlgebra.ComplexDenseMatrix