------------------------------------- lines 6-64 of file: example/class.cpp ------------------------------------- {xrst_begin_parent class_example} {xrst_spell var } Example Documenting a Class ########################### {xrst_comment |tab| is defined as part of rst_prolog in xrst.toml for this project } Syntax ****** | |tab| ``ad_double`` *var* ( *value* , *derivative* ) | |tab| ``ad_double`` *other* ( *value* , *derivative* ) | |tab| *var*.\ ``value``\ () | |tab| *var*.\ ``derivative``\ () | |tab| *var* + *other* | |tab| *var* - *other* | |tab| *var* * *other* | |tab| *var* / *other* Prototype ********* {xrst_literal , // BEGIN_CTOR, END_CTOR // BEGIN_VALUE, END_VALUE // BEGIN_DERIVATIVE, END_DERIVATIVE // BEGIN_ADD, END_ADD // BEGIN_SUB, END_SUB // BEGIN_MUL, END_MUL // BEGIN_DIV, END_DIV } Discussion ********** The class ``ad_double`` implements forward mode Algorithm Differentiation (AD) for the add, subtract, multiply and divide operations. Example ******* The function :ref:`example_ad_double-name` is an example for using this class. Test **** The main program :ref:`test_ad_double-name` runs the example above. {xrst_comment Hide the table of contents for the children of this page because they are discussed under Example and Test above } {xrst_toc_hidden } This Example File ***************** {xrst_literal} {xrst_end class_example}