MultGroupBase

Struct MultGroupBase 

Source
pub struct MultGroupBase<R: RingStore>(/* private fields */);
Available on crate feature unstable-enable only.
Expand description

The multiplicative group of a ring, implements AbelianGroupBase.

§Availability

This API is marked as unstable and is only available when the unstable-enable crate feature is enabled. This comes with no stability guarantees, and could be changed or removed at any time.

Implementations§

Source§

impl<R: RingStore> MultGroupBase<R>

Source

pub fn new(ring: R) -> Self

§Availability

This API is marked as unstable and is only available when the unstable-enable crate feature is enabled. This comes with no stability guarantees, and could be changed or removed at any time.

Source

pub fn underlying_ring(&self) -> &R

§Availability

This API is marked as unstable and is only available when the unstable-enable crate feature is enabled. This comes with no stability guarantees, and could be changed or removed at any time.

Source

pub fn from_ring_el(&self, x: El<R>) -> Option<MultGroupEl<R>>

If x is contained in R*, returns a MultGroupEl representing x. Otherwise, None is returned.

§Availability

This API is marked as unstable and is only available when the unstable-enable crate feature is enabled. This comes with no stability guarantees, and could be changed or removed at any time.

Source

pub fn as_ring_el<'a>(&self, x: &'a MultGroupEl<R>) -> &'a El<R>

Returns the ring element represented by the given group element.

§Availability

This API is marked as unstable and is only available when the unstable-enable crate feature is enabled. This comes with no stability guarantees, and could be changed or removed at any time.

Trait Implementations§

Source§

impl<R: RingStore> AbelianGroupBase for MultGroupBase<R>

Source§

type Element = MultGroupEl<R>

Available on crate feature unstable-enable only.
Type used to represent elements of this group.
Source§

fn clone_el(&self, x: &Self::Element) -> Self::Element

Available on crate feature unstable-enable only.
Clones an element of the group.
Source§

fn eq_el(&self, lhs: &Self::Element, rhs: &Self::Element) -> bool

Available on crate feature unstable-enable only.
Checks whether two group elements are equal.
Source§

fn inv(&self, x: &Self::Element) -> Self::Element

Available on crate feature unstable-enable only.
Computes the inverse of the give element, i.e. the unique group element x^-1 such that x * x^-1 is the identity element.
Source§

fn identity(&self) -> Self::Element

Available on crate feature unstable-enable only.
Returns the identity element of the group, i.e. the unique element 1 such that x * 1 = x for all group elements x.
Source§

fn hash<H: Hasher>(&self, x: &Self::Element, hasher: &mut H)

Available on crate feature unstable-enable only.
Hashes the group element. Read more
Source§

fn op(&self, lhs: Self::Element, rhs: Self::Element) -> Self::Element

Available on crate feature unstable-enable only.
Applies the group operation to two elements.
Source§

fn op_ref(&self, lhs: &Self::Element, rhs: &Self::Element) -> Self::Element

Available on crate feature unstable-enable only.
Applies the group operation to two elements. Read more
Source§

fn op_ref_snd(&self, lhs: Self::Element, rhs: &Self::Element) -> Self::Element

Available on crate feature unstable-enable only.
Applies the group operation to two elements. Read more
Source§

fn pow(&self, x: &Self::Element, e: &El<BigIntRing>) -> Self::Element

Available on crate feature unstable-enable only.
Raises a group element to the given power, i.e. computes x * x * ... * x, in total e times.
Source§

fn is_identity(&self, x: &Self::Element) -> bool

Available on crate feature unstable-enable only.
Checks whether the given element is the identity element of the group. Read more
Source§

impl<R> Clone for MultGroupBase<R>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<R: RingStore> Debug for MultGroupBase<R>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de, R> Deserialize<'de> for MultGroupBase<R>
where R: Deserialize<'de> + RingStore,

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl<R: RingStore> PartialEq for MultGroupBase<R>

Source§

fn eq(&self, other: &Self) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<R: RingStore> SerializableElementGroup for MultGroupBase<R>

Source§

fn serialize<S>( &self, el: &Self::Element, serializer: S, ) -> Result<S::Ok, S::Error>
where S: Serializer,

Available on crate feature unstable-enable only.
Serializes an element of this ring to the given serializer.
Source§

fn deserialize<'de, D>( &self, deserializer: D, ) -> Result<Self::Element, D::Error>
where D: Deserializer<'de>,

Available on crate feature unstable-enable only.
Deserializes an element of this ring from the given deserializer.
Source§

impl<R> Serialize for MultGroupBase<R>
where R: Serialize + RingStore,

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl<R> Copy for MultGroupBase<R>

Auto Trait Implementations§

§

impl<R> Freeze for MultGroupBase<R>
where R: Freeze,

§

impl<R> RefUnwindSafe for MultGroupBase<R>
where R: RefUnwindSafe,

§

impl<R> Send for MultGroupBase<R>
where R: Send,

§

impl<R> Sync for MultGroupBase<R>
where R: Sync,

§

impl<R> Unpin for MultGroupBase<R>
where R: Unpin,

§

impl<R> UnwindSafe for MultGroupBase<R>
where R: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,