TMB Documentation  v1.9.11
Public Member Functions | Static Public Attributes | List of all members
TMBad::global::Operator< ninput_, noutput_ > Struct Template Reference

Operator with input/output dimension known at compile time. More...

#include <global.hpp>

Public Member Functions

void dependencies_updating (Args<> &args, Dependencies &dep) const
 Default implementation of OperatorPure::dependencies_updating()
 
void * operator_data ()
 Return operator specific dynamic information (optional)
 
OperatorPureother_fuse (OperatorPure *self, OperatorPure *other)
 How to fuse this operator (self) with another (other)
 
void print (print_config cfg)
 Print this operator (optional)
 

Static Public Attributes

static const bool add_forward_replay_copy = false
 Should this operator replay it self by invoking the copy CTOR ?
 
static const bool add_static_identifier = false
 Should this operator have a static identifier ?
 
static const bool allow_remap = true
 Is it safe to remap the inputs of this operator? More...
 
static const int dependent_variable = false
 Is output of this operator a dependent variable ?
 
static const bool dynamic = false
 Does this operator require dynamic allocation ?
 
static const bool elimination_protected = false
 Protect this operator from elimination by the tape optimizer ?
 
static const bool have_dependencies = false
 Have dependencies member been defined ?
 
static const bool have_eval = false
 Does this class have an eval member from which to define forward ?
 
static const bool have_forward_incr_reverse_decr = false
 Have forward_incr and reverse_incr members been defined ?
 
static const bool have_forward_mark_reverse_mark = false
 Have forward_mark and reverse_mark members been defined ?
 
static const bool have_forward_reverse = true
 Have forward and reverse members been defined ?
 
static const bool have_increment_decrement = false
 Have increment and decrement members been defined ?
 
static const bool have_input_size_output_size = false
 Have input_size and output_size members been defined ?
 
static const bool implicit_dependencies = false
 Does this operator have implicit dependencies? More...
 
static const int independent_variable = false
 Is output of this operator an independent variable ?
 
static const bool is_constant = false
 Is this a constant operator ?
 
static const bool is_linear = false
 Is this a linear operator ?
 
static const int max_fuse_depth = 2
 How many times can this operator be doubled ?
 
static const int ninput = ninput_
 Number of operator inputs.
 
static const int noutput = noutput_
 Number of operator outputs.
 
static const bool smart_pointer = false
 Is this operator a 'smart pointer' (with reference counting) ?
 
static const bool updating = false
 This operator may update existing variables ? More...
 

Detailed Description

template<int ninput_, int noutput_ = 1>
struct TMBad::global::Operator< ninput_, noutput_ >

Operator with input/output dimension known at compile time.

Definition at line 1491 of file global.hpp.

Member Data Documentation

§ allow_remap

template<int ninput_, int noutput_ = 1>
const bool TMBad::global::Operator< ninput_, noutput_ >::allow_remap = true
static

Is it safe to remap the inputs of this operator?

In general it is illegal to remap operators that assume a certain memory layout of its inputs, e.g. BLAS routines. Make sure to set to false for those cases.

Definition at line 1519 of file global.hpp.

§ implicit_dependencies

template<int ninput_, int noutput_ = 1>
const bool TMBad::global::Operator< ninput_, noutput_ >::implicit_dependencies = false
static

Does this operator have implicit dependencies?

Signify that this operator uses indirect inputs

  • and that all these inputs are available through the dependencies() function (in particular have_dependencies must be true in this case)
  • and that these indirect dependencies should be used to auto implement the marker routines forward_mark_reverse_mark.
    Note
    FIXME: I think allow_remap can eventually be deprecated?

Definition at line 1530 of file global.hpp.

§ updating

template<int ninput_, int noutput_ = 1>
const bool TMBad::global::Operator< ninput_, noutput_ >::updating = false
static

This operator may update existing variables ?

An 'updating' operator is allowed to update (increment/decrement) certain ('updatable') variables already on the tape. In general this property breaks basic principles of reverse mode AD unless the following extra requirement is satisfied:

  • Once an updatable variable have been read it may no longer be updated.

This requrement always holds for the derivative variables during reverse replay. We note that 'updating' operators are considered an extension to the standard AD framework. In particular, a more complex dependency anlysis is required:

  • Updating operators must have implicit_dependencies=true.
  • The updating flag must be inherited by derivatives.
  • The updating flag signifies that necessary derivative workspaces are added to the tape prior to any reverse replay.
  • An updating operator must implement the member dependencies_updating() defining which variables are updated.

Definition at line 1574 of file global.hpp.


The documentation for this struct was generated from the following file:
License: GPL v2