Skip to main content

ArrayOptimizer

Trait ArrayOptimizer 

Source
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§

Source

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 session-registered ArrayKernels should participate.

Source

fn optimize_ctx(&self, session: &VortexSession) -> VortexResult<ArrayRef>

Optimize the root array node using static rules and any ArrayKernels on session.

Session kernels are checked for each (parent_encoding_id, child_encoding_id) pair before the child’s static PARENT_RULES. If session does not contain ArrayKernels, this behaves like Self::optimize.

Source

fn optimize_recursive(&self, session: &VortexSession) -> VortexResult<ArrayRef>

Optimize the entire array tree recursively (root and all descendants).

This uses the same session-aware rule ordering as Self::optimize_ctx for every node in the tree.

Implementors§