TMB Documentation  v1.9.11
Public Types | Public Member Functions | Public Attributes | List of all members
TMBad::op_info Struct Reference

Bitwise collection of selected operator flags. More...

#include <global.hpp>

Public Types

typedef int IntRep
 Type used for internal integer representation.
 
enum  op_flag {
  dynamic, smart_pointer, is_linear, is_constant,
  independent_variable, dependent_variable, allow_remap, elimination_protected,
  updating, op_flag_count
}
 Enumeration of selected boolean flags in global::Operator More...
 

Public Member Functions

bool test (op_flag f) const
 Test if a given flag is set.
 

Public Attributes

IntRep code
 Internal integer representation.
 

Detailed Description

Bitwise collection of selected operator flags.

These flags are available for any operator in the operation_stack.

Definition at line 732 of file global.hpp.

Member Enumeration Documentation

§ op_flag

Enumeration of selected boolean flags in global::Operator

Enumerator
dynamic 

Does this operator require dynamic allocation ?

smart_pointer 

Is this operator a 'smart pointer' (with reference counting) ?

is_linear 

Is this a linear operator ?

is_constant 

Is this a constant operator ?

independent_variable 

Is output of this operator an independent variable ?

dependent_variable 

Is output of this operator a dependent variable ?

allow_remap 

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.

elimination_protected 

Protect this operator from elimination by the tape optimizer ?

updating 

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.
op_flag_count 

Mark end of enum.

Definition at line 738 of file global.hpp.


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