httk.core.vectors.vector_frac_view¶
A view presenting any vector backend as a FracVector (the exact-rational representation).
Classes¶
A view presenting an underlying vector backend as an exact |
Module Contents¶
- class httk.core.vectors.vector_frac_view.VectorFracView(obj, **hints)¶
Bases:
httk.core.vectors.vector_view.VectorView,httk.core.vectors.fracvector.FracVectorA view presenting an underlying vector backend as an exact
FracVector.This view is a genuine FracVector, so it can be passed anywhere a FracVector is accepted, and it exposes the full exact-rational algebra (
det/inv/*/…). It is built lazily on first access — adopting a frac backend’s FracVector directly, otherwise converting from the backend’s exactfractionsinterchange — so the round-trip is exactness-preserving for the frac and native backends. (numpy values are binary rationals, so a numpy source round-trips to the exact float64 rational, not necessarily the original decimal fraction.)Because inherited FracVector algebra builds its results with the low-level
self.__class__._of(noms, denom)constructor, results built that way are plain (backend-less) FracVector values presented through this class.- Parameters:
obj (httk.core.vectors.vector_like.VectorLike) – The source value to present.
**hints (Any) – Backend-selection and view-conversion hints.
- property noms: httk.core.vectors.fracvector.Noms¶
Return the materialized numerator data.
- unwrap()¶
Return the underlying unwrapped vector, or this value when no backend remains.
- unview()¶
Return a plain FracVector containing this view’s presented data.