GeneralMatrixQualifier#

class nvmath.linalg.GeneralMatrixQualifier[source]#

A class which constructs and validates matrix_qualifiers_dtype for a general rectangular matrix.

Examples

>>> import numpy as np
>>> from nvmath.linalg import GeneralMatrixQualifier, matrix_qualifiers_dtype

Create a general matrix qualifier:

>>> GeneralMatrixQualifier.create()  
array(('ge', False, False, 2, 0, 0),
      dtype=[('abbreviation', '<U2'), ('conjugate', '?'), ...

Create a conjugate general matrix qualifier:

>>> GeneralMatrixQualifier.create(conjugate=True)  
array(('ge', True, False, 2, 0, 0),
      dtype=[('abbreviation', '<U2'), ('conjugate', '?'), ...

Create an array of general matrix qualifiers:

>>> np.full(
...     2, GeneralMatrixQualifier.create(), dtype=matrix_qualifiers_dtype
... )  
array([('ge', False, False, 2, 0, 0), ('ge', False, False, 2, 0, 0)],
      dtype=[('abbreviation', '<U2'), ('conjugate', '?'), ...

Methods

__init__()[source]#
classmethod create(
conjugate: bool = False,
transpose: bool = False,
)[source]#

Return a np.ndarray of type matrix_qualifiers_dtype whose element describes a general matrix.

Parameters:
  • conjugate – Whether the matrix is conjugate.

  • transpose – Whether the matrix is transpose.

classmethod is_valid(
other: ndarray[tuple[Any, ...], dtype[_ScalarT]],
) bool[source]#

Return True if all elements of other are valid examples of the matrix_qualifiers_dtype constructed by this class.

classmethod to_string(
other: ndarray[tuple[Any, ...], dtype[_ScalarT]],
) str[source]#

Return a pretty string representation of other.

Attributes

abbreviation: ClassVar[str] = 'ge'#