[][src]Struct flag_algebra::QFlag

pub struct QFlag<N, F> {
    pub basis: Basis<F>,
    pub data: Array1<N>,
    pub scale: u64,
    pub expr: Expr<N, F>,
}

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

impl<N, F> QFlag<N, F> where
    N: Num + Clone + FromPrimitive,
    F: Flag
[src]

pub fn expand(&self, outbasis: Basis<F>) -> Self[src]

Projection to a basis of larger flag.

pub fn untype(&self) -> Self[src]

Unlabeling operator 〚.〛 to the flag algebra of completly unlabeled flags.

impl<N, F> QFlag<N, F>[src]

pub fn with_expr(self, expr: Expr<N, F>) -> Self[src]

Return the same element with modified pretty-print expression

pub fn named(self, name: String) -> Self[src]

Return the same element with modified pretty-print expression

pub fn no_scale(self) -> Self where
    N: FromPrimitive + DivAssign<N> + ScalarOperand
[src]

pub fn map<G, M>(&self, g: G) -> QFlag<M, F> where
    G: Fn(&N) -> M, 
[src]

impl<N, F> QFlag<N, F> where
    N: Num + FromPrimitive + Clone + Display,
    F: Flag
[src]

pub fn at_least(&self, x: N) -> Ineq<N, F>[src]

Return the inequality "selfx".

pub fn at_most(&self, x: N) -> Ineq<N, F> where
    N: Clone + Neg<Output = N>, 
[src]

Return the inequality "selfx".

pub fn non_negative(&self) -> Ineq<N, F> where
    N: Num
[src]

Return the inequality "self0".

pub fn equal(self, n: N) -> Ineq<N, F> where
    N: Clone + Neg<Output = N>, 
[src]

Return the equality "self = n".

Trait Implementations

impl<N, F, '_> Add<&'_ QFlag<N, F>> for QFlag<N, F> where
    N: Clone + FromPrimitive + Num + ScalarOperand,
    F: Flag
[src]

type Output = Self

The resulting type after applying the + operator.

impl<N, F> Add<QFlag<N, F>> for QFlag<N, F> where
    N: Clone + Num + FromPrimitive + ScalarOperand,
    F: Flag
[src]

type Output = Self

The resulting type after applying the + operator.

impl<N: Clone, F: Clone> Clone for QFlag<N, F>[src]

impl<N: Debug, F: Debug> Debug for QFlag<N, F>[src]

impl<F, N> Html for QFlag<N, F> where
    F: Flag + Draw,
    N: Num + Clone + Display + FromPrimitive
[src]

impl<'a, N, F> Mul<&'a QFlag<N, F>> for &'a QFlag<N, F> where
    N: Num + Clone + FromPrimitive,
    F: Flag
[src]

type Output = QFlag<N, F>

The resulting type after applying the * operator.

impl<N, F> Mul<N> for QFlag<N, F> where
    N: Num + ScalarOperand + Display,
    F: Flag
[src]

type Output = Self

The resulting type after applying the * operator.

impl<N, F> Mul<QFlag<N, F>> for QFlag<N, F> where
    N: Num + Clone + FromPrimitive,
    F: Flag
[src]

type Output = Self

The resulting type after applying the * operator.

impl<N, F> Neg for QFlag<N, F> where
    N: Clone + Neg<Output = N>, 
[src]

type Output = Self

The resulting type after applying the - operator.

impl<'a, N, F> Neg for &'a QFlag<N, F> where
    N: Clone + Neg<Output = N>,
    F: Clone
[src]

type Output = QFlag<N, F>

The resulting type after applying the - operator.

impl<N, F> PartialEq<QFlag<N, F>> for QFlag<N, F> where
    N: Num + FromPrimitive + Clone,
    F: Flag
[src]

impl<'a, N, F> Sub<&'a QFlag<N, F>> for &'a QFlag<N, F> where
    N: Clone + Num + FromPrimitive + ScalarOperand,
    F: Flag
[src]

type Output = QFlag<N, F>

The resulting type after applying the - operator.

impl<N, F> Sub<QFlag<N, F>> for QFlag<N, F> where
    N: Clone + Num + FromPrimitive + ScalarOperand,
    F: Flag
[src]

type Output = Self

The resulting type after applying the - operator.

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

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> ClosedNeg for T where
    T: Neg<Output = T>, 

impl<T> From<T> for T[src]

impl<F> Html for F where
    F: Draw
[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T[src]

type Output = T

Should always be Self

impl<SS, SP> SupersetOf<SS> for SP where
    SS: SubsetOf<SP>, 

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,