asap_sketchlib 0.2.1

A high-performance sketching library for approximate stream processing
Documentation
use serde::{Deserialize, Serialize};

/// Shared thin wrapper over `Vec<T>` tailored for sketches.
#[derive(Clone, Debug, Serialize, Deserialize)]
pub struct Vector3D<T> {
    data: Vec<T>,
    layer: usize,
    row: usize,
    col: usize,
}

impl<T> Vector3D<T> {
    /// Creates an empty 3D container with reserved capacity.
    pub fn init(layer: usize, row: usize, col: usize) -> Self {
        Self {
            data: Vec::with_capacity(layer * row * col),
            layer,
            row,
            col,
        }
    }
}