CppAD: A C++ Algorithmic Differentiation Package  20171217
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
ordered.hpp
Go to the documentation of this file.
1 // $Id$
2 # ifndef CPPAD_CORE_ORDERED_HPP
3 # define CPPAD_CORE_ORDERED_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 namespace CppAD { // BEGIN_CPPAD_NAMESPACE
19 
20 /*!
21 \file ordered.hpp
22 Check and AD values ordering properties relative to zero.
23 */
24 
25 // GreaterThanZero ============================================================
26 /*!
27 Check if an AD<Base> is greater than zero.
28 
29 \param x
30 value we are checking.
31 
32 \return
33 returns true iff the \c x is greater than zero.
34 */
35 template <class Base>
37 bool GreaterThanZero(const AD<Base> &x)
38 { return GreaterThanZero(x.value_); }
39 // GreaterThanOrZero =========================================================
40 /*!
41 Check if an AD<Base> is greater than or equal zero.
42 
43 \param x
44 value we are checking.
45 
46 \return
47 returns true iff the \c x is greater than or equal zero.
48 */
49 template <class Base>
52 { return GreaterThanOrZero(x.value_); }
53 // LessThanZero ============================================================
54 /*!
55 Check if an AD<Base> is less than zero.
56 
57 \param x
58 value we are checking.
59 
60 \return
61 returns true iff the \c x is less than zero.
62 */
63 template <class Base>
65 bool LessThanZero(const AD<Base> &x)
66 { return LessThanZero(x.value_); }
67 // LessThanOrZero =========================================================
68 /*!
69 Check if an AD<Base> is less than or equal zero.
70 
71 \param x
72 value we are checking.
73 
74 \return
75 returns true iff the \c x is less than or equal zero.
76 */
77 template <class Base>
79 bool LessThanOrZero(const AD<Base> &x)
80 { return LessThanOrZero(x.value_); }
81 // abs_geq =========================================================
82 /*!
83 Check if absolute value of one AD<Base> is greater or equal another.
84 
85 \param x
86 value we are checking if it is greater than or equal other.
87 
88 \param y
89 value we are checking if it is less than other.
90 
91 \return
92 returns true iff the absolute value of \c x is greater than or equal
93 absolute value of \c y.
94 */
95 template <class Base>
97 bool abs_geq(const AD<Base>& x, const AD<Base>& y)
98 { return abs_geq(x.value_, y.value_); }
99 // ============================================================================
100 } // END_CPPAD_NAMESPACE
101 # endif
102 
Define processor symbols and macros that are used by CppAD.
Base value_
Definition: ad.hpp:38
Definition: ad.hpp:34
bool GreaterThanOrZero(const std::complex< double > &x)
#define CPPAD_INLINE_FRIEND_TEMPLATE_FUNCTION
A version of the inline command that works with MC compiler.
Definition: define.hpp:43
bool abs_geq(const std::complex< double > &x, const std::complex< double > &y)
bool LessThanOrZero(const std::complex< double > &x)
bool LessThanZero(const std::complex< double > &x)
bool GreaterThanZero(const std::complex< double > &x)