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: u64Scaling 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 expand(&self, outbasis: Basis<F>) -> Selfwhere
N: Num + Clone + FromPrimitive,
pub fn expand(&self, outbasis: Basis<F>) -> Selfwhere N: Num + Clone + FromPrimitive,
Projection to a basis of larger flag.
sourcepub fn untype(&self) -> Selfwhere
N: Num + Clone + FromPrimitive,
pub fn untype(&self) -> Selfwhere N: Num + Clone + FromPrimitive,
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) -> Selfwhere
N: FromPrimitive + DivAssign<N> + ScalarOperand,
pub fn no_scale(self) -> Selfwhere N: FromPrimitive + DivAssign<N> + ScalarOperand,
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>where G: Fn(&N) -> M,
Trait Implementations§
source§impl<N, F> Add<&QFlag<N, F>> for QFlag<N, F>where
N: Clone + FromPrimitive + Num + ScalarOperand,
F: Flag,
impl<N, F> Add<&QFlag<N, F>> for QFlag<N, F>where N: Clone + FromPrimitive + Num + ScalarOperand, F: Flag,
source§impl<N, F> Add<QFlag<N, F>> for QFlag<N, F>where
N: Clone + Num + FromPrimitive + ScalarOperand,
F: Flag,
impl<N, F> Add<QFlag<N, F>> for QFlag<N, F>where N: Clone + Num + FromPrimitive + ScalarOperand, F: Flag,
source§impl<F, N> Html for QFlag<N, F>where
F: Flag + Draw,
N: Num + Clone + Display + FromPrimitive,
impl<F, N> Html for QFlag<N, F>where F: Flag + Draw, N: Num + Clone + Display + FromPrimitive,
source§impl<'a, N, F> Mul<&'a QFlag<N, F>> for &'a QFlag<N, F>where
N: Num + Clone + FromPrimitive,
F: Flag,
impl<'a, N, F> Mul<&'a QFlag<N, F>> for &'a QFlag<N, F>where N: Num + Clone + FromPrimitive, F: Flag,
source§impl<N, F> PartialEq<QFlag<N, F>> for QFlag<N, F>where
N: Num + FromPrimitive + Clone,
F: Flag,
impl<N, F> PartialEq<QFlag<N, F>> for QFlag<N, F>where N: Num + FromPrimitive + Clone, F: Flag,
source§impl<N, F> Pow<usize> for &QFlag<N, F>where
N: Num + Clone + FromPrimitive + Display,
F: Flag,
impl<N, F> Pow<usize> for &QFlag<N, F>where N: Num + Clone + FromPrimitive + Display, F: Flag,
source§impl<'a, N, F> Sub<&'a QFlag<N, F>> for &'a QFlag<N, F>where
N: Clone + Num + FromPrimitive + ScalarOperand,
F: Flag,
impl<'a, N, F> Sub<&'a QFlag<N, F>> for &'a QFlag<N, F>where N: Clone + Num + FromPrimitive + ScalarOperand, F: Flag,
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.