CppAD: A C++ Algorithmic Differentiation Package
20130102
|
00001 /* $Id$ */ 00002 # ifndef CPPAD_ORDERED_INCLUDED 00003 # define CPPAD_ORDERED_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 CPPAD_BEGIN_NAMESPACE 00019 00020 /*! 00021 \defgroup ordered_hpp ordered.hpp 00022 \{ 00023 \file ordered.hpp 00024 Check and AD values ordering properties relative to zero. 00025 */ 00026 00027 // GreaterThanZero ============================================================ 00028 /*! 00029 Check if an AD<Base> is greater than zero. 00030 00031 \param x 00032 value we are checking. 00033 00034 \return 00035 returns true iff the \c x is greater than zero. 00036 */ 00037 template <class Base> 00038 CPPAD_INLINE_FRIEND_TEMPLATE_FUNCTION 00039 bool GreaterThanZero(const AD<Base> &x) 00040 { return GreaterThanZero(x.value_); } 00041 // GreaterThanOrZero ========================================================= 00042 /*! 00043 Check if an AD<Base> is greater than or equal zero. 00044 00045 \param x 00046 value we are checking. 00047 00048 \return 00049 returns true iff the \c x is greater than or equal zero. 00050 */ 00051 template <class Base> 00052 CPPAD_INLINE_FRIEND_TEMPLATE_FUNCTION 00053 bool GreaterThanOrZero(const AD<Base> &x) 00054 { return GreaterThanOrZero(x.value_); } 00055 // LessThanZero ============================================================ 00056 /*! 00057 Check if an AD<Base> is less than zero. 00058 00059 \param x 00060 value we are checking. 00061 00062 \return 00063 returns true iff the \c x is less than zero. 00064 */ 00065 template <class Base> 00066 CPPAD_INLINE_FRIEND_TEMPLATE_FUNCTION 00067 bool LessThanZero(const AD<Base> &x) 00068 { return LessThanZero(x.value_); } 00069 // LessThanOrZero ========================================================= 00070 /*! 00071 Check if an AD<Base> is less than or equal zero. 00072 00073 \param x 00074 value we are checking. 00075 00076 \return 00077 returns true iff the \c x is less than or equal zero. 00078 */ 00079 template <class Base> 00080 CPPAD_INLINE_FRIEND_TEMPLATE_FUNCTION 00081 bool LessThanOrZero(const AD<Base> &x) 00082 { return LessThanOrZero(x.value_); } 00083 // abs_geq ========================================================= 00084 /*! 00085 Check if absolute value of one AD<Base> is greater or equal another. 00086 00087 \param x 00088 value we are checking if it is greater than or equal other. 00089 00090 \param y 00091 value we are checking if it is less than other. 00092 00093 \return 00094 returns true iff the absolute value of \c x is greater than or equal 00095 absolute value of \c y. 00096 */ 00097 template <class Base> 00098 CPPAD_INLINE_FRIEND_TEMPLATE_FUNCTION 00099 bool abs_geq(const AD<Base>& x, const AD<Base>& y) 00100 { return abs_geq(x.value_, y.value_); } 00101 // ============================================================================ 00102 /*! \} */ 00103 CPPAD_END_NAMESPACE 00104 # endif 00105