MatrixContainer

class glotaran.optimization.matrix_provider.MatrixContainer(clp_labels: list[str], matrix: ndarray)[source]

Bases: object

A container of matrix and the corresponding clp labels.

Attributes Summary

is_index_dependent

Check if the matrix is index dependent.

clp_labels

The clp labels.

matrix

The matrix.

Methods Summary

apply_weight

Apply weight on a matrix.

create_scaled_matrix

Create a matrix container with a scaled matrix.

create_weighted_matrix

Create a matrix container with a weighted matrix.

Methods Documentation

static apply_weight(matrix: ArrayLike, weight: ArrayLike) ArrayLike[source]

Apply weight on a matrix.

Parameters:
  • matrix (ArrayLike) – The matrix.

  • weight (ArrayLike) – The weight.

Returns:

The weighted matrix.

Return type:

ArrayLike

clp_labels: list[str]

The clp labels.

create_scaled_matrix(scale: float) MatrixContainer[source]

Create a matrix container with a scaled matrix.

Parameters:

scale (float) – The scale.

Returns:

The scaled matrix.

Return type:

MatrixContainer

create_weighted_matrix(weight: ArrayLike) MatrixContainer[source]

Create a matrix container with a weighted matrix.

Parameters:

weight (ArrayLike) – The weight.

Returns:

The weighted matrix.

Return type:

MatrixContainer

property is_index_dependent: bool

Check if the matrix is index dependent.

Returns:

Whether the matrix is index dependent.

Return type:

bool

matrix: ndarray

The matrix.