EzShape

Trait EzShape 

Source
pub trait EzShape<F: Function> {
    // Required methods
    fn ez_point_tape(
        &self,
    ) -> ShapeTape<<F::PointEval as TracingEvaluator>::Tape>;
    fn ez_interval_tape(
        &self,
    ) -> ShapeTape<<F::IntervalEval as TracingEvaluator>::Tape>;
    fn ez_float_slice_tape(
        &self,
    ) -> ShapeTape<<F::FloatSliceEval as BulkEvaluator>::Tape>;
    fn ez_grad_slice_tape(
        &self,
    ) -> ShapeTape<<F::GradSliceEval as BulkEvaluator>::Tape>;
    fn ez_simplify(&self, trace: &F::Trace) -> Result<Self, Error>
       where Self: Sized;
}
Expand description

Extension trait for working with a shape without thinking much about memory

All of the Shape functions that use significant amounts of memory pedantically require you to pass in storage for reuse. This trait allows you to ignore that, at the cost of performance; we require that all storage types implement Default, so these functions do the boilerplate for you.

This trait is automatically implemented for every Shape, but must be imported separately as a speed-bump to using it everywhere.

Required Methods§

Source

fn ez_point_tape(&self) -> ShapeTape<<F::PointEval as TracingEvaluator>::Tape>

Returns an evaluation tape for a point evaluator

Source

fn ez_interval_tape( &self, ) -> ShapeTape<<F::IntervalEval as TracingEvaluator>::Tape>

Returns an evaluation tape for an interval evaluator

Source

fn ez_float_slice_tape( &self, ) -> ShapeTape<<F::FloatSliceEval as BulkEvaluator>::Tape>

Returns an evaluation tape for a float slice evaluator

Source

fn ez_grad_slice_tape( &self, ) -> ShapeTape<<F::GradSliceEval as BulkEvaluator>::Tape>

Returns an evaluation tape for a float slice evaluator

Source

fn ez_simplify(&self, trace: &F::Trace) -> Result<Self, Error>
where Self: Sized,

Computes a simplified tape using the given trace

Implementors§

Source§

impl<F: Function, T> EzShape<F> for Shape<F, T>