Struct flag_algebra::QFlag
source · pub struct QFlag<N, F: Flag> {
pub basis: Basis<F>,
pub data: Array1<N>,
pub scale: u64,
pub expr: Expr<N, F>,
}
Expand description
An element of a flag algebra.
Fields§
§basis: Basis<F>
Basis of the space where the element lives. This corresponds to the size and type of the flags.
data: Array1<N>
The vector of the element in the corresponding basis is (1/self.scale).self.data
.
scale: u64
Scaling factor of the vector.
expr: Expr<N, F>
Expression recording how the vector was computed.
Implementations§
source§impl<N, F: Flag> QFlag<N, F>
impl<N, F: Flag> QFlag<N, F>
sourcepub fn untype(&self) -> Self
pub fn untype(&self) -> Self
Unlabeling operator 〚.〛 to the flag algebra of completly unlabeled flags.
sourcepub fn with_expr(self, expr: Expr<N, F>) -> Self
pub fn with_expr(self, expr: Expr<N, F>) -> Self
Return the same element with modified pretty-print expression
sourcepub fn no_scale(self) -> Self
pub fn no_scale(self) -> Self
Divide the elements of the vector by the scale and set the scale to 1
pub fn map<G, M>(&self, g: G) -> QFlag<M, F>
Trait Implementations§
source§impl<N, F> PartialEq for QFlag<N, F>
impl<N, F> PartialEq for QFlag<N, F>
Auto Trait Implementations§
impl<N, F> !RefUnwindSafe for QFlag<N, F>
impl<N, F> !Send for QFlag<N, F>
impl<N, F> !Sync for QFlag<N, F>
impl<N, F> Unpin for QFlag<N, F>where
F: Unpin,
impl<N, F> !UnwindSafe for QFlag<N, F>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self
from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self
is actually part of its subset T
(and can be converted to it).§unsafe fn to_subset_unchecked(&self) -> SS
unsafe fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset
but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self
to the equivalent element of its superset.