pub struct IntArray {
pub bits: usize,
pub length: usize,
/* private fields */
}
Expand description
1-64 bits unsigned integer array
Fields§
§bits: usize
bit width
length: usize
number of element
Implementations§
Source§impl IntArray
impl IntArray
pub fn new(b: usize, len: usize) -> IntArray
pub fn new_with_vec(b: usize, vals: Vec<u64>) -> IntArray
pub fn new_with_iter<'a, I>(b: usize, vals: I) -> IntArray
pub fn subarray<'a>(&'a self, offset: usize, length: usize) -> IntArray
pub fn datasize(self) -> usize
pub fn push(&mut self, v: u64) -> Option<usize>
pub fn extend<I>(&mut self, vals: I)
pub fn extend_array(&mut self, vals: IntArray)
pub fn concat(&mut self, vals: IntArray)
pub fn shape<'a>(self: &'a IntArray, bits: usize) -> IntArray
pub fn shape_auto<'a>(self: &'a IntArray) -> IntArray
pub fn pop(&mut self) -> Result<u64, String>
pub fn iter(&self) -> IntIter<'_> ⓘ
pub fn capacity(&self) -> usize
pub fn resize(&mut self, len: usize)
pub fn len(&self) -> usize
pub fn max_value(&self) -> u64
pub fn max(&self) -> u64
pub fn min(&self) -> u64
pub fn average(&self) -> f64
pub fn get(&self, i: usize) -> Result<u64, String>
pub fn set(&mut self, i: usize, v: u64) -> Result<u64, String>
pub fn add(&mut self, i: usize, v: u64) -> Result<u64, String>
pub fn sub(&mut self, i: usize, v: u64) -> Result<u64, String>
pub fn incr_limit(&mut self, i: usize) -> Option<u64>
pub fn decr_limit(&mut self, i: usize) -> Option<u64>
pub fn incr(&mut self, i: usize) -> Result<u64, String>
pub fn decr(&mut self, i: usize) -> Result<u64, String>
pub fn sum<'a>(&'a self) -> Option<u64>
pub fn sum0<'a>(&'a self) -> Option<u64>
pub fn fill_random(&mut self)
Trait Implementations§
Source§impl AddAssign<u64> for IntArray
impl AddAssign<u64> for IntArray
Source§fn add_assign(&mut self, v: u64)
fn add_assign(&mut self, v: u64)
Performs the
+=
operation. Read moreSource§impl AddAssign for IntArray
impl AddAssign for IntArray
Source§fn add_assign(&mut self, v: IntArray)
fn add_assign(&mut self, v: IntArray)
Performs the
+=
operation. Read moreSource§impl MulAssign<u64> for IntArray
impl MulAssign<u64> for IntArray
Source§fn mul_assign(&mut self, v: u64)
fn mul_assign(&mut self, v: u64)
Performs the
*=
operation. Read moreAuto Trait Implementations§
impl Freeze for IntArray
impl RefUnwindSafe for IntArray
impl Send for IntArray
impl Sync for IntArray
impl Unpin for IntArray
impl UnwindSafe for IntArray
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