use crate::algebra::{Binding, Solution};
use anyhow::Result;
#[derive(Debug, Default)]
pub struct ParallelStats {
pub parallel_operations: usize,
pub work_items_processed: usize,
pub thread_utilization: f64,
pub parallel_speedup: f64,
pub cache_hits: usize,
pub cache_misses: usize,
}
pub trait ParallelSolutionIterator: Send + Sync {
fn par_process<F>(&self, f: F) -> Result<Solution>
where
F: Fn(&Binding) -> Option<Binding> + Send + Sync;
fn par_filter<F>(&self, f: F) -> Result<Solution>
where
F: Fn(&Binding) -> bool + Send + Sync;
fn par_extend<F>(&self, f: F) -> Result<Solution>
where
F: Fn(&Binding) -> Vec<Binding> + Send + Sync;
}