Cmpnt

class zixy.container.cmpnts.Cmpnt(impl: ImplT, indexer: int | None = None)[source]

Bases: ViewableItem[ImplT], Generic[ImplT, SpecT]

A component.

A single component that may be an owning instance referencing a single element in a Rust-bound data object, or a view on an element in another collection.

__eq__(other: object) bool[source]

Return whether self and other are equal.

__init__(impl: ImplT, indexer: int | None = None)[source]

Initialize the component.

Parameters:
  • impl – Rust-bound object storing the data.

  • indexer – Position within Rust-bound array at which the viewed component is stored. When indexer is None, the Cmpnt is an owning view on the sole element of impl.

__mul__(rhs: CoeffT | Cmpnt[ImplT, SpecT]) Term[ImplT, SpecT, CoeffT] | Term[ImplT, SpecT, OtherCoeffT][source]
Overloads:
  • self, rhs (Cmpnt[ImplT, SpecT]) → Term[ImplT, SpecT, OtherCoeffT]

  • self, rhs (CoeffT) → Term[ImplT, SpecT, CoeffT]

Return the product of self and rhs.

__rmul__(lhs: CoeffT) Term[ImplT, SpecT, CoeffT][source]

Return the product of lhs and self.

aliases(other: Cmpnt[ImplT, SpecT]) bool[source]

Determine whether self is a view of the same component as other.

clear() None[source]

Set the value of the component to zero.

Note

This method operates in-place.

clone() Self[source]

Return a deep copy of self.

impl_type: type[ImplT]
into(t: type[OutT]) OutT

Clone self into a new related container of type t.

Parameters:

t – Type of the new container to create.

Returns:

A new instance of t containing the same data as self.

is_owning() bool

Check if self is owning (i.e. not a view).

abstractmethod set(source: SpecT | Self | None) None[source]

Set the value of the component.

Parameters:

source – Specification for the new value.

Note

This method operates in-place.