Struct IntArray

Source
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

Source

pub fn new(b: usize, len: usize) -> IntArray

Source

pub fn new_with_vec(b: usize, vals: Vec<u64>) -> IntArray

Source

pub fn new_with_iter<'a, I>(b: usize, vals: I) -> IntArray
where I: Iterator<Item = u64>,

Source

pub fn subarray<'a>(&'a self, offset: usize, length: usize) -> IntArray

Source

pub fn datasize(self) -> usize

Source

pub fn push(&mut self, v: u64) -> Option<usize>

Source

pub fn extend<I>(&mut self, vals: I)
where I: Iterator<Item = u64>,

Source

pub fn extend_array(&mut self, vals: IntArray)

Source

pub fn concat(&mut self, vals: IntArray)

Source

pub fn shape<'a>(self: &'a IntArray, bits: usize) -> IntArray

Source

pub fn shape_auto<'a>(self: &'a IntArray) -> IntArray

Source

pub fn pop(&mut self) -> Result<u64, String>

Source

pub fn iter(&self) -> IntIter<'_>

Source

pub fn capacity(&self) -> usize

Source

pub fn resize(&mut self, len: usize)

Source

pub fn len(&self) -> usize

Source

pub fn max_value(&self) -> u64

Source

pub fn max(&self) -> u64

Source

pub fn min(&self) -> u64

Source

pub fn average(&self) -> f64

Source

pub fn get(&self, i: usize) -> Result<u64, String>

Source

pub fn set(&mut self, i: usize, v: u64) -> Result<u64, String>

Source

pub fn add(&mut self, i: usize, v: u64) -> Result<u64, String>

Source

pub fn sub(&mut self, i: usize, v: u64) -> Result<u64, String>

Source

pub fn incr_limit(&mut self, i: usize) -> Option<u64>

Source

pub fn decr_limit(&mut self, i: usize) -> Option<u64>

Source

pub fn incr(&mut self, i: usize) -> Result<u64, String>

Source

pub fn decr(&mut self, i: usize) -> Result<u64, String>

Source

pub fn sum<'a>(&'a self) -> Option<u64>

Source

pub fn sum0<'a>(&'a self) -> Option<u64>

Source

pub fn fill_random(&mut self)

Trait Implementations§

Source§

impl AddAssign<u64> for IntArray

Source§

fn add_assign(&mut self, v: u64)

Performs the += operation. Read more
Source§

impl AddAssign for IntArray

Source§

fn add_assign(&mut self, v: IntArray)

Performs the += operation. Read more
Source§

impl Clone for IntArray

Source§

fn clone(&self) -> IntArray

Returns a copy 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 Display for IntArray

Source§

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

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

impl MulAssign<u64> for IntArray

Source§

fn mul_assign(&mut self, v: u64)

Performs the *= operation. Read more
Source§

impl Serialize for IntArray

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 SubAssign<u64> for IntArray

Source§

fn sub_assign(&mut self, v: u64)

Performs the -= operation. Read more
Source§

impl SubAssign for IntArray

Source§

fn sub_assign(&mut self, v: IntArray)

Performs the -= operation. Read more

Auto Trait Implementations§

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> 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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. 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<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V