finesse.densematrix.DenseMatrix

Overview

class finesse.densematrix.DenseMatrix(name)[source]

Examples

Create a matrix with memory views of different submatrices for giving to components:

> DM = DenseMatrix(“abc”) > > DM.add_diagonal_elements(5, 0, ‘a’) > DM.add_diagonal_elements(5, 1, ‘b’) > DM.add_diagonal_elements(5, 2, ‘c’) > DM.add_diagonal_elements(2, 3, ‘d’) > > v1 = DM.get_sub_matrix_view(0, 1, ‘b’) > v2 = DM.get_sub_diagonal_view(0, 2, ‘b’) > v3 = DM.get_sub_matrix_view(3, 1, ‘b’) > > DM.construct() > > v1[:] = 1 > v2[:] = 0.5 > v3[:] = 0.75

Methods

DenseMatrix.__init__(self, name)

Initialize self.

DenseMatrix.get_sub_matrix_view(self, …)

DenseMatrix.get_sub_diagonal_view(self, …)

DenseMatrix.add_diagonal_elements(self, …)

Adds a submatrix to the matrix along its diagonal.

DenseMatrix.add_block(self, Neqs, index, name)

Parameters

DenseMatrix.add_submatrix(self, _from, _to, name)

Adds a submatrix to the matrix.

DenseMatrix.construct(self)

Constructing the matrix involves taking the metadata submatrix positions throughout the matrix and allocating the memory and building the various CCS matrix structures.

DenseMatrix.get_submatrix(self, _from, _to)

DenseMatrix.get_matrix_elements(self)

DenseMatrix.print_matrix(self)

DenseMatrix.print_rhs(self)

DenseMatrix.set_rhs(self, index, value)

DenseMatrix.clear_rhs(self)

DenseMatrix.solve(self, transpose, conjugate)

Solve the matrix with options for transposing and conjugating.