pub struct RenderHandle<F: Function, T = ()> { /* private fields */ }Expand description
A RenderHandle contains lazily-populated tapes for rendering
This can be cheaply cloned, although it is usually passed by mutable reference to a recursive function.
The most recent simplification is cached for reuse (if the trace matches).
Implementations§
Source§impl<F: Function, T> RenderHandle<F, T>
impl<F: Function, T> RenderHandle<F, T>
Sourcepub fn new(shape: Shape<F, T>) -> Self
pub fn new(shape: Shape<F, T>) -> Self
Build a new RenderHandle for the given shape
None of the tapes are populated here.
Sourcepub fn i_tape(
&mut self,
storage: &mut Vec<F::TapeStorage>,
) -> &ShapeTape<<F::IntervalEval as TracingEvaluator>::Tape>
pub fn i_tape( &mut self, storage: &mut Vec<F::TapeStorage>, ) -> &ShapeTape<<F::IntervalEval as TracingEvaluator>::Tape>
Returns a tape for tracing interval evaluation
Sourcepub fn f_tape(
&mut self,
storage: &mut Vec<F::TapeStorage>,
) -> &ShapeTape<<F::FloatSliceEval as BulkEvaluator>::Tape>
pub fn f_tape( &mut self, storage: &mut Vec<F::TapeStorage>, ) -> &ShapeTape<<F::FloatSliceEval as BulkEvaluator>::Tape>
Returns a tape for bulk float evaluation
Sourcepub fn g_tape(
&mut self,
storage: &mut Vec<F::TapeStorage>,
) -> &ShapeTape<<F::GradSliceEval as BulkEvaluator>::Tape>
pub fn g_tape( &mut self, storage: &mut Vec<F::TapeStorage>, ) -> &ShapeTape<<F::GradSliceEval as BulkEvaluator>::Tape>
Returns a tape for bulk gradient evaluation
Sourcepub fn simplify(
&mut self,
trace: &F::Trace,
workspace: &mut F::Workspace,
shape_storage: &mut Vec<F::Storage>,
tape_storage: &mut Vec<F::TapeStorage>,
) -> &mut Self
pub fn simplify( &mut self, trace: &F::Trace, workspace: &mut F::Workspace, shape_storage: &mut Vec<F::Storage>, tape_storage: &mut Vec<F::TapeStorage>, ) -> &mut Self
Simplifies the shape with the given trace
As an internal optimization, this may reuse a previous simplification if the trace matches.
Trait Implementations§
Auto Trait Implementations§
impl<F, T> Freeze for RenderHandle<F, T>where
F: Freeze,
<<F as Function>::IntervalEval as TracingEvaluator>::Tape: Freeze,
<<F as Function>::FloatSliceEval as BulkEvaluator>::Tape: Freeze,
<<F as Function>::GradSliceEval as BulkEvaluator>::Tape: Freeze,
<F as Function>::Trace: Freeze,
impl<F, T> RefUnwindSafe for RenderHandle<F, T>where
F: RefUnwindSafe,
T: RefUnwindSafe,
<<F as Function>::IntervalEval as TracingEvaluator>::Tape: RefUnwindSafe,
<<F as Function>::FloatSliceEval as BulkEvaluator>::Tape: RefUnwindSafe,
<<F as Function>::GradSliceEval as BulkEvaluator>::Tape: RefUnwindSafe,
<F as Function>::Trace: RefUnwindSafe,
impl<F, T> Send for RenderHandle<F, T>where
T: Send,
impl<F, T> Sync for RenderHandle<F, T>where
T: Sync,
impl<F, T> Unpin for RenderHandle<F, T>where
F: Unpin,
T: Unpin,
<<F as Function>::IntervalEval as TracingEvaluator>::Tape: Unpin,
<<F as Function>::FloatSliceEval as BulkEvaluator>::Tape: Unpin,
<<F as Function>::GradSliceEval as BulkEvaluator>::Tape: Unpin,
<F as Function>::Trace: Unpin,
impl<F, T> UnsafeUnpin for RenderHandle<F, T>where
F: UnsafeUnpin,
<<F as Function>::IntervalEval as TracingEvaluator>::Tape: UnsafeUnpin,
<<F as Function>::FloatSliceEval as BulkEvaluator>::Tape: UnsafeUnpin,
<<F as Function>::GradSliceEval as BulkEvaluator>::Tape: UnsafeUnpin,
<F as Function>::Trace: UnsafeUnpin,
impl<F, T> UnwindSafe for RenderHandle<F, T>where
F: UnwindSafe,
T: UnwindSafe,
<<F as Function>::IntervalEval as TracingEvaluator>::Tape: UnwindSafe,
<<F as Function>::FloatSliceEval as BulkEvaluator>::Tape: UnwindSafe,
<<F as Function>::GradSliceEval as BulkEvaluator>::Tape: UnwindSafe,
<F as Function>::Trace: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.