finesse.densematrix.DenseMatrix

Overview

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

Bases: object

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

Properties

DenseMatrix.name

DenseMatrix.num_equations

Methods

DenseMatrix.__init__(name)

DenseMatrix.add_block(Neqs, index, name)

Parameters

DenseMatrix.add_diagonal_elements(Neqs, ...)

Adds a submatrix to the matrix along its diagonal.

DenseMatrix.add_submatrix(_from, _to, name)

Adds a submatrix to the matrix.

DenseMatrix.clear_rhs()

DenseMatrix.construct()

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_matrix_elements()

DenseMatrix.get_sub_diagonal_view(from_node, ...)

DenseMatrix.get_sub_matrix_view(from_node, ...)

DenseMatrix.get_submatrix(_from, _to)

DenseMatrix.print_matrix()

DenseMatrix.print_rhs()

DenseMatrix.set_rhs(index, value)

DenseMatrix.solve(self, transpose, conjugate)

Solve the matrix with options for transposing and conjugating.