Struct ragged_buffer::ragged_buffer::RaggedBuffer
source · [−]pub struct RaggedBuffer<T> {
pub data: Vec<T>,
pub subarrays: Vec<Range<usize>>,
pub features: usize,
pub items: usize,
}Fields
data: Vec<T>subarrays: Vec<Range<usize>>features: usizeitems: usizeImplementations
sourceimpl<T: Copy + Display + Debug> RaggedBuffer<T>
impl<T: Copy + Display + Debug> RaggedBuffer<T>
pub fn new(features: usize) -> Self
pub fn from_array(data: ArrayView3<'_, T>) -> Self
pub fn from_flattened(
data: ArrayView2<'_, T>,
lengths: ArrayView1<'_, i64>
) -> Result<Self>
pub fn extend(&mut self, other: &RaggedBuffer<T>) -> Result<()>
pub fn clear(&mut self)
pub fn push(&mut self, data: &ArrayView2<'_, T>) -> Result<()>
pub fn push_empty(&mut self)
pub fn swizzle(&self, indices: ArrayView1<'_, i64>) -> Result<RaggedBuffer<T>>
pub fn get(&self, i: usize) -> RaggedBuffer<T>
pub fn size0(&self) -> usize
pub fn lengths(&self) -> Vec<i64>
pub fn size1(&self, i: usize) -> Result<usize>
pub fn size2(&self) -> usize
pub fn __str__(&self) -> Result<String>
pub fn binop<Op: BinOp<T>>(
&self,
rhs: &RaggedBuffer<T>
) -> Result<RaggedBuffer<T>>
pub fn op_scalar<Op: BinOp<T>>(&self, scalar: T) -> RaggedBuffer<T>
pub fn indices(&self, dim: usize) -> Result<RaggedBuffer<i64>>
pub fn flat_indices(&self) -> Result<RaggedBuffer<i64>>
pub fn cat(buffers: &[&RaggedBuffer<T>], dim: usize) -> Result<RaggedBuffer<T>>
pub fn padpack(&self) -> Option<(Vec<i64>, Vec<f32>, Vec<i64>, (usize, usize))>
pub fn items(&self) -> usize
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
Trait Implementations
sourceimpl<T: Clone> Clone for RaggedBuffer<T>
impl<T: Clone> Clone for RaggedBuffer<T>
sourcefn clone(&self) -> RaggedBuffer<T>
fn clone(&self) -> RaggedBuffer<T>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more
sourceimpl<T: Debug> Debug for RaggedBuffer<T>
impl<T: Debug> Debug for RaggedBuffer<T>
sourceimpl<T: Hash> Hash for RaggedBuffer<T>
impl<T: Hash> Hash for RaggedBuffer<T>
sourceimpl<T: PartialEq> PartialEq<RaggedBuffer<T>> for RaggedBuffer<T>
impl<T: PartialEq> PartialEq<RaggedBuffer<T>> for RaggedBuffer<T>
sourcefn eq(&self, other: &RaggedBuffer<T>) -> bool
fn eq(&self, other: &RaggedBuffer<T>) -> bool
This method tests for self and other values to be equal, and is used
by ==. Read more
sourcefn ne(&self, other: &RaggedBuffer<T>) -> bool
fn ne(&self, other: &RaggedBuffer<T>) -> bool
This method tests for !=.
impl<T: Eq> Eq for RaggedBuffer<T>
impl<T> StructuralEq for RaggedBuffer<T>
impl<T> StructuralPartialEq for RaggedBuffer<T>
Auto Trait Implementations
impl<T> RefUnwindSafe for RaggedBuffer<T> where
T: RefUnwindSafe,
impl<T> Send for RaggedBuffer<T> where
T: Send,
impl<T> Sync for RaggedBuffer<T> where
T: Sync,
impl<T> Unpin for RaggedBuffer<T> where
T: Unpin,
impl<T> UnwindSafe for RaggedBuffer<T> where
T: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more