CppAD: A C++ Algorithmic Differentiation Package 20110419
default.hpp
Go to the documentation of this file.
00001 /* $Id$ */
00002 # ifndef CPPAD_DEFAULT_INCLUDED
00003 # define CPPAD_DEFAULT_INCLUDED
00004 
00005 /* --------------------------------------------------------------------------
00006 CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-11 Bradley M. Bell
00007 
00008 CppAD is distributed under multiple licenses. This distribution is under
00009 the terms of the 
00010                     Common Public License Version 1.0.
00011 
00012 A copy of this license is included in the COPYING file of this distribution.
00013 Please visit http://www.coin-or.org/CppAD/ for information on other licenses.
00014 -------------------------------------------------------------------------- */
00015 
00016 /*
00017 ------------------------------------------------------------------------------
00018 
00019 $begin Default$$
00020 $spell
00021 $$
00022 
00023 $section AD Default Constructor$$
00024 
00025 $index AD, default construct$$
00026 $index construct, default$$
00027 $index default, constructor$$
00028 
00029 $head Syntax$$
00030 $syntax%AD<%Base%> %x%;%$$
00031 
00032 
00033 $head Purpose$$
00034 Constructs an AD object with an unspecified value.
00035 Directly after this construction,
00036 the object is a $xref/glossary/Parameter/parameter/$$.
00037 
00038 
00039 $head Example$$
00040 $children%
00041         example/default.cpp
00042 %$$
00043 The file
00044 $xref/Default.cpp/$$
00045 contains an example and test of this operation.
00046 It returns true if it succeeds and false otherwise.
00047 
00048 $end
00049 ------------------------------------------------------------------------------
00050 */
00051 //  BEGIN CppAD namespace
00052 namespace CppAD {
00053 
00054 // default constructor
00055 //
00056 // Initilaize id_ to CPPAD_MAX_NUM_THREADS, so that following conditions hold 
00057 // id_ != 0 , id_ % CPPAD_MAX_NUM_THREADS == 0, id_ != any recording tape id.
00058 // taddr_ is not used, set anyway to avoid compile warning.
00059 // value_ = 0 so complex of AD will work, see comments in not_complex_ad.cpp.
00060 template <class Base>
00061 inline AD<Base>::AD(void) 
00062 : value_(Base(0))
00063 , id_(CPPAD_MAX_NUM_THREADS)
00064 , taddr_(0)
00065 { }     
00066 
00067 } // END CppAD namespace
00068 
00069 # endif