Skip to main content

Tape

Struct Tape 

pub struct Tape<T: TapeStorage> {
    data: Box<TapeData<T>>,
}

Fields§

§data: Box<TapeData<T>>

Implementations§

§

impl<T: TapeStorage> Tape<T>

pub const UNIT: u32

pub const NEG: u32

pub const SLOT_MASK: u32

pub const MAX_VARIABLES: u32

pub const DEFAULT_STATEMENTS: usize = 256

pub const DEFAULT_OPERATIONS: usize = 512

pub fn new(_activate: bool) -> Self

pub fn with_capacity(n_statements: usize, n_operations: usize) -> Self

fn data_ptr(&self) -> *mut TapeData<T>

pub fn activate(&mut self)

pub fn deactivate(&mut self)

pub fn is_active(&self) -> bool

pub(crate) fn get_active() -> Option<*mut TapeData<T>>

pub fn deactivate_all()

pub fn activate_guard(&mut self) -> TapeGuard<T>

pub fn record(&mut self) -> TapeGuard<T>

Methods from Deref<Target = TapeData<T>>§

pub fn register_variable(&mut self) -> u32

pub fn push_nullary(&mut self) -> u32

pub fn push_unary_unit(&mut self, operand_slot: u32, neg: bool) -> u32

pub fn push_binary_unit( &mut self, s1: u32, neg1: bool, s2: u32, neg2: bool, ) -> u32

pub fn push_operands_unit_bounded( &mut self, n_max: usize, operands: impl IntoIterator<Item = (u32, bool)>, )

pub fn push_unary(&mut self, multiplier: T, operand_slot: u32) -> u32

pub fn push_binary(&mut self, m1: T, s1: u32, m2: T, s2: u32) -> u32

pub fn push_operand(&mut self, multiplier: T, operand_slot: u32)

pub fn push_operands_bounded( &mut self, n_max: usize, operands: impl IntoIterator<Item = (T, u32)>, )

pub fn end_statement(&mut self) -> u32

pub fn new_recording(&mut self)

pub fn compute_adjoints(&mut self)

pub fn compute_adjoints_vector(&self, n_dir: usize, derivs: &mut [T])

fn compute_adjoints_to_impl(&mut self, target_pos: u32, start: u32)

pub fn clear_derivatives(&mut self)

pub fn derivative(&self, slot: u32) -> T

pub fn set_derivative(&mut self, slot: u32, value: T)

pub fn num_variables(&self) -> u32

pub fn num_operations(&self) -> usize

pub fn num_statements(&self) -> usize

pub fn memory(&self) -> usize

Trait Implementations§

§

impl<T: TapeStorage> Deref for Tape<T>

§

type Target = TapeData<T>

The resulting type after dereferencing.
§

fn deref(&self) -> &TapeData<T>

Dereferences the value.
§

impl<T: TapeStorage> DerefMut for Tape<T>

§

fn deref_mut(&mut self) -> &mut TapeData<T>

Mutably dereferences the value.
§

impl<T: TapeStorage> Drop for Tape<T>

§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more

Auto Trait Implementations§

§

impl<T> Freeze for Tape<T>

§

impl<T> RefUnwindSafe for Tape<T>
where T: RefUnwindSafe,

§

impl<T> Send for Tape<T>

§

impl<T> Sync for Tape<T>

§

impl<T> Unpin for Tape<T>

§

impl<T> UnsafeUnpin for Tape<T>

§

impl<T> UnwindSafe for Tape<T>
where T: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.