source: trunk/test_more/extern_value.cpp @ 3008

Last change on this file since 3008 was 2756, checked in by bradbell, 7 years ago

Make testing of numeric limits more robust by
using external functions, instead of arrays, for storing temporary values.

extern_value.cpp: external functions for getting and setting values.

  • Property svn:keywords set to Id
File size: 1.2 KB
Line 
1/* $Id: extern_value.cpp 2756 2013-02-27 18:49:28Z bradbell $ */
2/* --------------------------------------------------------------------------
3CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-13 Bradley M. Bell
4
5CppAD is distributed under multiple licenses. This distribution is under
6the terms of the
7                    Eclipse Public License Version 1.0.
8
9A copy of this license is included in the COPYING file of this distribution.
10Please visit http://www.coin-or.org/CppAD/ for information on other licenses.
11-------------------------------------------------------------------------- */
12
13# include <cppad/cppad.hpp>
14# include "extern_value.hpp"
15
16# define INSTANTIATE(Type) template class extern_value< Type >
17
18template <class Type> 
19extern_value<Type>::extern_value(Type value)
20{       value_ = value; }
21
22template <class Type> 
23void extern_value<Type>::set(Type value)
24{       value_ = value; }
25
26template <class Type> 
27Type extern_value<Type>::get(void)
28{       return value_; }
29
30INSTANTIATE( float );
31INSTANTIATE( double );
32INSTANTIATE( std::complex<float> );
33INSTANTIATE( std::complex<double> );
34//
35INSTANTIATE( CppAD::AD< float > );
36INSTANTIATE( CppAD::AD< double > );
37INSTANTIATE( CppAD::AD< std::complex<float> > );
38INSTANTIATE( CppAD::AD< std::complex<double> > );
Note: See TracBrowser for help on using the repository browser.