CppAD: A C++ Algorithmic Differentiation Package  20130102
std_set.hpp
Go to the documentation of this file.
00001 // $Id$
00002 # ifndef CPPAD_STD_SET_INCLUDED
00003 # define CPPAD_STD_SET_INCLUDED
00004 
00005 /* --------------------------------------------------------------------------
00006 CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-12 Bradley M. Bell
00007 
00008 CppAD is distributed under multiple licenses. This distribution is under
00009 the terms of the 
00010                     Eclipse 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 # include <cppad/local/define.hpp>
00017 
00018 // needed before one can use CPPAD_ASSERT_FIRST_CALL_NOT_PARALLEL
00019 # include <cppad/thread_alloc.hpp>
00020 
00021 CPPAD_BEGIN_NAMESPACE
00022 /*!
00023 \defgroup std_set_hpp std_set.hpp
00024 \{
00025 \file std_set.hpp
00026 Two constant standard sets (currently used for concept checking).
00027 */
00028 
00029 /*!
00030 A standard set with one element.
00031 */
00032 template <class Scalar>
00033 const std::set<Scalar>& one_element_std_set(void)
00034 {    CPPAD_ASSERT_FIRST_CALL_NOT_PARALLEL;
00035      static std::set<Scalar> one;
00036      if( one.empty() )
00037           one.insert(1);
00038      return one;
00039 }  
00040 /*!
00041 A standard set with a two elements.
00042 */
00043 template <class Scalar>
00044 const std::set<Scalar>& two_element_std_set(void)
00045 {    CPPAD_ASSERT_FIRST_CALL_NOT_PARALLEL;
00046      static std::set<Scalar> two;
00047      if( two.empty() )
00048      {    two.insert(1);
00049           two.insert(2);
00050      }
00051      return two;
00052 }  
00053 
00054 /*! \} */
00055 CPPAD_END_NAMESPACE
00056 # endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines