runlmc.linalg.sum_matrix module

class runlmc.linalg.sum_matrix.SumMatrix(Ks)[source]

Bases: runlmc.linalg.matrix.Matrix

The sum matrix represents a sum of other possibly sparse runlmc.linalg.SymmetricMatrix instances \(A_i\), taking on the meaning \(\sum_iA_i\).

Parameters:Ks – decomposable matrices to sum
Raises:ValueError – If Ks is empty
as_numpy()[source]
Returns:numpy matrix equivalent, as a 2D numpy.ndarray
matvec(x)[source]

Multiply a vector \(\textbf{x}\) by this matrix, \(K\), yielding \(K\textbf{x}\).

Parameters:x – a one-dimensional numpy array of the same size as this matrix
Returns:the matrix-vector product
upper_eig_bound()[source]