CppAD: A C++ Algorithmic Differentiation Package  20130918
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-14 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 namespace CppAD { // BEGIN_CPPAD_NAMESPACE
00022 /*!
00023 \file std_set.hpp
00024 Two constant standard sets (currently used for concept checking).
00025 */
00026 
00027 /*!
00028 A standard set with one element.
00029 */
00030 template <class Scalar>
00031 const std::set<Scalar>& one_element_std_set(void)
00032 {    CPPAD_ASSERT_FIRST_CALL_NOT_PARALLEL;
00033      static std::set<Scalar> one;
00034      if( one.empty() )
00035           one.insert(1);
00036      return one;
00037 }  
00038 /*!
00039 A standard set with a two elements.
00040 */
00041 template <class Scalar>
00042 const std::set<Scalar>& two_element_std_set(void)
00043 {    CPPAD_ASSERT_FIRST_CALL_NOT_PARALLEL;
00044      static std::set<Scalar> two;
00045      if( two.empty() )
00046      {    two.insert(1);
00047           two.insert(2);
00048      }
00049      return two;
00050 }  
00051 
00052 } // END_CPPAD_NAMESPACE
00053 # endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines