vortex_compute/expand/
mod.rs

1// SPDX-License-Identifier: Apache-2.0
2// SPDX-FileCopyrightText: Copyright the Vortex contributors
3
4//! Expand function.
5
6mod buffer;
7
8use vortex_mask::Mask;
9
10/// Function for expanding values of `self` to the true positions of a mask.
11pub trait Expand {
12    /// The result type after expansion.
13    type Output: Default;
14
15    /// Expands `self` using the provided mask.
16    ///
17    ///
18    /// The result will have length equal to the mask. All values of `self` are
19    /// scattered to the true positions of the mask. False positions are set to
20    /// `Output::default`.
21    ///
22    ///
23    /// # Panics
24    ///
25    /// Panics if the number of true count of the mask does not equal the length of `self`.
26    fn expand(self, mask: &Mask) -> Self::Output;
27}