TermData

class zixy.container.data.TermData(cmpnts: Cmpnts[ImplT, SpecT], coeffs: Coeffs[CoeffT])[source]

Bases: Generic[ImplT, SpecT, CoeffT]

Data for terms, consisting of an array of components and a vector of coefficients.

__eq__(other: object) bool[source]

Return whether self and other are equal.

__init__(cmpnts: Cmpnts[ImplT, SpecT], coeffs: Coeffs[CoeffT])[source]

Initialize the data.

Parameters:
  • cmpnts – The component array.

  • coeffs – The coefficient vector.

__len__() int[source]

Get the number of elements in self.

__repr__() str[source]

Return a string representation of self.

clone(s: int | slice = slice(None, None, None)) Self[source]

Return a deep copy of self.

Parameters:

s – The slice of the containers to clone.

Returns:

A clone of self with the specified slice.

property cmpnt_type: type[Cmpnt[ImplT, SpecT]]

Get the component type of self.

property cmpnts: Cmpnts[ImplT, SpecT]

Get the components of self.

property cmpnts_type: type[Cmpnts[ImplT, SpecT]]

Get the component container type of self.

property coeff_type: type[CoeffT]

Get the coefficient type of self.

property coeffs: Coeffs[CoeffT]

Get the coefficients of self.

property coeffs_type: type[Coeffs[CoeffT]]

Get the coefficient container type of self.

resize(n: int) None[source]

Resize the underlying containers.

Parameters:

n – The new size of the containers.

Raises:

ValueError – If the container is a view.

Note

This method operates in-place.