CppAD: A C++ Algorithmic Differentiation Package  20171217
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
std_set.hpp
Go to the documentation of this file.
1 // $Id: std_set.hpp 3845 2016-11-19 01:50:47Z bradbell $
2 # ifndef CPPAD_LOCAL_STD_SET_HPP
3 # define CPPAD_LOCAL_STD_SET_HPP
4 
5 /* --------------------------------------------------------------------------
6 CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-16 Bradley M. Bell
7 
8 CppAD is distributed under multiple licenses. This distribution is under
9 the terms of the
10  Eclipse Public License Version 1.0.
11 
12 A copy of this license is included in the COPYING file of this distribution.
13 Please visit http://www.coin-or.org/CppAD/ for information on other licenses.
14 -------------------------------------------------------------------------- */
15 
16 # include <cppad/core/define.hpp>
17 
18 // needed before one can use CPPAD_ASSERT_FIRST_CALL_NOT_PARALLEL
20 
21 namespace CppAD { namespace local { // BEGIN_CPPAD_LOCAL_NAMESPACE
22 /*!
23 \file std_set.hpp
24 Two constant standard sets (currently used for concept checking).
25 */
26 
27 /*!
28 A standard set with one element.
29 */
30 template <class Scalar>
31 const std::set<Scalar>& one_element_std_set(void)
33  static std::set<Scalar> one;
34  if( one.empty() )
35  one.insert(1);
36  return one;
37 }
38 /*!
39 A standard set with a two elements.
40 */
41 template <class Scalar>
42 const std::set<Scalar>& two_element_std_set(void)
44  static std::set<Scalar> two;
45  if( two.empty() )
46  { two.insert(1);
47  two.insert(2);
48  }
49  return two;
50 }
51 
52 } } // END_CPPAD_LOCAL_NAMESPACE
53 # endif
Define processor symbols and macros that are used by CppAD.
const std::set< Scalar > & two_element_std_set(void)
A standard set with a two elements.
Definition: std_set.hpp:42
const std::set< Scalar > & one_element_std_set(void)
A standard set with one element.
Definition: std_set.hpp:31
#define CPPAD_ASSERT_FIRST_CALL_NOT_PARALLEL
Check that the first call to a routine is not during parallel execution mode.
File used to define the CppAD multi-threading allocator class.