Struct chain_vote::encrypted_vote::UnitVector
source · pub struct UnitVector {
ith: usize,
size: usize,
}
Expand description
Represents a Unit vector which size is @size and the @ith element (0-indexed) is enabled
Fields§
§ith: usize
§size: usize
Implementations§
source§impl UnitVector
impl UnitVector
sourcepub fn new(
size: usize,
ith: usize
) -> Result<Self, UnitVectorInitializationError>
pub fn new( size: usize, ith: usize ) -> Result<Self, UnitVectorInitializationError>
Create a new ith
unit vector, with size
greater than zero, and greater than ith
.
pub fn iter(&self) -> UnitVectorIter ⓘ
pub fn len(&self) -> usize
pub fn ith(&self) -> usize
pub fn is_jth(&self, j: usize) -> bool
pub fn jth(&self, j: usize) -> Scalar
Trait Implementations§
source§impl Clone for UnitVector
impl Clone for UnitVector
source§fn clone(&self) -> UnitVector
fn clone(&self) -> UnitVector
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for UnitVector
impl Debug for UnitVector
source§impl Display for UnitVector
impl Display for UnitVector
impl Copy for UnitVector
Auto Trait Implementations§
impl RefUnwindSafe for UnitVector
impl Send for UnitVector
impl Sync for UnitVector
impl Unpin for UnitVector
impl UnwindSafe for UnitVector
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