pub struct GroupValue<G: AbelianGroupBase> { /* private fields */ }unstable-enable only.Expand description
Implementations§
Source§impl<G: AbelianGroupBase + Sized> GroupValue<G>
impl<G: AbelianGroupBase + Sized> GroupValue<G>
Source§impl<R: RingStore> GroupValue<AddGroupBase<R>>where
R::Type: HashableElRing,
impl<R: RingStore> GroupValue<AddGroupBase<R>>where
R::Type: HashableElRing,
Source§impl<R: RingStore> GroupValue<MultGroupBase<R>>
impl<R: RingStore> GroupValue<MultGroupBase<R>>
Sourcepub fn new(ring: R) -> Self
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.
Sourcepub fn underlying_ring(&self) -> &R
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.
Sourcepub fn from_ring_el(&self, x: El<R>) -> Option<MultGroupEl<R>>
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.
Sourcepub fn as_ring_el<'a>(&self, x: &'a MultGroupEl<R>) -> &'a El<R>
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.
Source§impl<G: AbelianGroupStore> GroupValue<SubgroupBase<G>>
impl<G: AbelianGroupStore> GroupValue<SubgroupBase<G>>
Sourcepub fn new(
group: G,
order_multiple: El<BigIntRing>,
generators: Vec<GroupEl<G>>,
) -> Self
pub fn new( group: G, order_multiple: El<BigIntRing>, generators: Vec<GroupEl<G>>, ) -> Self
Creates a new [GeneratingSet] representing the subgroup generated
by the given generators.
The value order_multiple should be a multiple of the order of every
generator, including generators that will be added later on via
[GeneratingSet::add_generator()].
§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.
Sourcepub fn parent(&self) -> &G
pub fn parent(&self) -> &G
Returns the group that this group is a subgroup of.
§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.
Sourcepub fn subgroup_order(&self) -> El<BigIntRing>
pub fn subgroup_order(&self) -> El<BigIntRing>
Returns the order of the subgroup, i.e. the number of elements.
§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.
Sourcepub fn generators(&self) -> &[GroupEl<G>] ⓘ
pub fn generators(&self) -> &[GroupEl<G>] ⓘ
Returns the stored generating set of the subgroup.
§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.
Sourcepub fn add_generator(self, new_gen_base: GroupEl<G>) -> Self
pub fn add_generator(self, new_gen_base: GroupEl<G>) -> Self
Adds a generator to this subgroup, returning a new, larger subgroup.
§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.
Sourcepub fn contains(&self, element: &GroupEl<G>) -> bool
pub fn contains(&self, element: &GroupEl<G>) -> bool
Checks whether the given element of the parent group is contained in the subgroup.
§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.
Sourcepub fn dlog(&self, target: &GroupEl<G>) -> Option<Vec<i64>>
pub fn dlog(&self, target: &GroupEl<G>) -> Option<Vec<i64>>
Writes the given element of the parent group as a combination of the subgroup generators, if this exists.
§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.
Sourcepub fn enumerate_elements<'a>(
&'a self,
) -> impl use<'a, G> + Clone + Iterator<Item = GroupEl<G>>
pub fn enumerate_elements<'a>( &'a self, ) -> impl use<'a, G> + Clone + Iterator<Item = GroupEl<G>>
Returns an iterator over all elements of the subgroup.
§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§impl<R> GroupValue<SubgroupBase<GroupValue<MultGroupBase<R>>>>
impl<R> GroupValue<SubgroupBase<GroupValue<MultGroupBase<R>>>>
Trait Implementations§
Source§impl<G: AbelianGroupBase> AbelianGroupStore for GroupValue<G>
impl<G: AbelianGroupBase> AbelianGroupStore for GroupValue<G>
Source§fn clone_el(&self, el: &GroupEl<Self>) -> GroupEl<Self>
fn clone_el(&self, el: &GroupEl<Self>) -> GroupEl<Self>
unstable-enable only.Source§fn eq_el(&self, lhs: &GroupEl<Self>, rhs: &GroupEl<Self>) -> bool
fn eq_el(&self, lhs: &GroupEl<Self>, rhs: &GroupEl<Self>) -> bool
unstable-enable only.Source§fn op(&self, lhs: GroupEl<Self>, rhs: GroupEl<Self>) -> GroupEl<Self>
fn op(&self, lhs: GroupEl<Self>, rhs: GroupEl<Self>) -> GroupEl<Self>
unstable-enable only.Source§fn op_ref(&self, lhs: &GroupEl<Self>, rhs: &GroupEl<Self>) -> GroupEl<Self>
fn op_ref(&self, lhs: &GroupEl<Self>, rhs: &GroupEl<Self>) -> GroupEl<Self>
unstable-enable only.Source§fn op_ref_snd(&self, lhs: GroupEl<Self>, rhs: &GroupEl<Self>) -> GroupEl<Self>
fn op_ref_snd(&self, lhs: GroupEl<Self>, rhs: &GroupEl<Self>) -> GroupEl<Self>
unstable-enable only.Source§fn inv(&self, x: &GroupEl<Self>) -> GroupEl<Self>
fn inv(&self, x: &GroupEl<Self>) -> GroupEl<Self>
unstable-enable only.Source§fn pow(&self, x: &GroupEl<Self>, e: &El<BigIntRing>) -> GroupEl<Self>
fn pow(&self, x: &GroupEl<Self>, e: &El<BigIntRing>) -> GroupEl<Self>
unstable-enable only.Source§fn is_identity(&self, x: &GroupEl<Self>) -> bool
fn is_identity(&self, x: &GroupEl<Self>) -> bool
unstable-enable only.Source§impl<G: AbelianGroupBase + Clone> Clone for GroupValue<G>
impl<G: AbelianGroupBase + Clone> Clone for GroupValue<G>
Source§impl<'de, G> Deserialize<'de> for GroupValue<G>where
G: Deserialize<'de> + AbelianGroupBase,
impl<'de, G> Deserialize<'de> for GroupValue<G>where
G: Deserialize<'de> + AbelianGroupBase,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl<G: AbelianGroupBase> From<G> for GroupValue<G>
impl<G: AbelianGroupBase> From<G> for GroupValue<G>
Source§impl<G> Serialize for GroupValue<G>where
G: Serialize + AbelianGroupBase,
impl<G> Serialize for GroupValue<G>where
G: Serialize + AbelianGroupBase,
impl<G: AbelianGroupBase + Copy> Copy for GroupValue<G>
Auto Trait Implementations§
impl<G> Freeze for GroupValue<G>where
G: Freeze,
impl<G> RefUnwindSafe for GroupValue<G>where
G: RefUnwindSafe,
impl<G> Send for GroupValue<G>where
G: Send,
impl<G> Sync for GroupValue<G>where
G: Sync,
impl<G> Unpin for GroupValue<G>where
G: Unpin,
impl<G> UnsafeUnpin for GroupValue<G>where
G: UnsafeUnpin,
impl<G> UnwindSafe for GroupValue<G>where
G: UnwindSafe,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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