Class: ComplexTriplet

LinearAlgebra. ComplexTriplet


new ComplexTriplet(m, n)

This class represents a small structure to hold nonzero entries in a ComplexSparseMatrix.
Each entry is a triplet of a complex value and the (i, j)th indices, i.e., (x, i, j).

Parameters:
Name Type Description
m number

The number of rows in the complex sparse matrix that will be
initialized from this complex triplet.

n number

The number of columns in the complex sparse matrix that will be
initialized from this complex triplet.

Example
let T = new ComplexTriplet(100, 100);
T.addEntry(new Complex(3.4, 6.4), 11, 43);
T.addEntry(new Complex(6.4, 3.4), 99, 99);

let A = ComplexSparseMatrix.fromTriplet(T);

Methods


addEntry(x, i, j)

A(i, j) += x

Parameters:
Name Type Description
x number

The value of the nonzero entry being inserted into this
complex triplet.

i number

The ith row of the complex sparse matrix that will be initialized
from this complex triplet.

j number

The jth column of the complex sparse matrix that will be
initialized from this complex triplet.