pub trait ArrayOptimizer {
// Required methods
fn optimize(&self) -> VortexResult<ArrayRef>;
fn optimize_ctx(&self, session: &VortexSession) -> VortexResult<ArrayRef>;
fn optimize_recursive(
&self,
session: &VortexSession,
) -> VortexResult<ArrayRef>;
}Expand description
Extension trait for optimizing array trees using reduce/reduce_parent rules.
Required Methods§
Sourcefn optimize(&self) -> VortexResult<ArrayRef>
fn optimize(&self) -> VortexResult<ArrayRef>
Optimize the root array node by running reduce and reduce_parent rules to fixpoint.
This uses only static rules registered on encoding vtables. Use Self::optimize_ctx
when a session-scoped kernels::ArrayKernels registry should participate.
Sourcefn optimize_ctx(&self, session: &VortexSession) -> VortexResult<ArrayRef>
fn optimize_ctx(&self, session: &VortexSession) -> VortexResult<ArrayRef>
Optimize the array tree using static rules and the active kernels::ArrayKernels
registry on session, if any.
The descendants that were never optimized are optimized before the root. Session kernels
are checked for each (parent_encoding_id, child_encoding_id) pair before the child’s
static PARENT_RULES. The registry comes from the kernels::KernelSession on session,
if any. If session does not contain a kernels::KernelSession, this behaves like
Self::optimize on the root and its never optimized descendants.
Sourcefn optimize_recursive(&self, session: &VortexSession) -> VortexResult<ArrayRef>
fn optimize_recursive(&self, session: &VortexSession) -> VortexResult<ArrayRef>
Optimize the entire array tree recursively (root and all descendants).
This is the same as Self::optimize_ctx: optimizing a node first optimizes every
descendant that was never optimized.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".