source: trunk/ADOL-C/include/adolc/internal/adubfunc.h @ 708

Last change on this file since 708 was 658, checked in by kulshres, 4 years ago

few fixes

  • adubref must not be created by user or copied
  • adubref destructor was missing
  • we can have an explicit cast since we have a function to conver adub to adub*
  • erf() was not protected by ATRIG_ERF
  • fix function declarations in psdrivers.h

Signed-off-by: Kshitij Kulshreshtha <kshitij@…>

File size: 4.8 KB
Line 
1/*----------------------------------------------------------------------------
2 ADOL-C -- Automatic Differentiation by Overloading in C++
3 File:     adubfunc.h
4 Revision: $Id$
5 Contents: operators and functions returning temporaries
6 
7 Copyright (c) Kshitij Kulshreshtha
8
9 This file is part of ADOL-C. This software is provided as open source.
10 Any use, reproduction, or distribution of the software constitutes
11 recipient's acceptance of the terms of the accompanying license file.
12
13----------------------------------------------------------------------------*/
14
15#if defined(_IN_CLASS_) && _IN_CLASS_
16#if defined(_IN_BADOUBLE_) || defined(_IN_ADUB_)
17    /*--------------------------------------------------------------------------*/
18    /* Comparison (friends) */
19#if defined(ADOLC_ADVANCED_BRANCHING)
20    friend ADOLC_DLL_EXPORT adub operator != ( const badouble&, const badouble& );
21    friend ADOLC_DLL_EXPORT adub operator == ( const badouble&, const badouble& );
22    friend ADOLC_DLL_EXPORT adub operator <= ( const badouble&, const badouble& );
23    friend ADOLC_DLL_EXPORT adub operator >= ( const badouble&, const badouble& );
24    friend ADOLC_DLL_EXPORT adub operator >  ( const badouble&, const badouble& );
25    friend ADOLC_DLL_EXPORT adub operator <  ( const badouble&, const badouble& );
26#endif
27    /*--------------------------------------------------------------------------*/
28    /* sign operators (friends) */
29    friend ADOLC_DLL_EXPORT adub operator + ( const badouble& x );
30    friend ADOLC_DLL_EXPORT adub operator - ( const badouble& x );
31
32    /*--------------------------------------------------------------------------*/
33    /* binary operators (friends) */
34    friend ADOLC_DLL_EXPORT adub operator + ( const badouble&, const badouble& );
35    friend ADOLC_DLL_EXPORT adub operator + ( double, const badouble& );
36    friend ADOLC_DLL_EXPORT adub operator + ( const badouble&, double );
37    friend ADOLC_DLL_EXPORT adub operator - ( const badouble&, const badouble& );
38    inline friend adub operator - ( const badouble&, double );
39    friend ADOLC_DLL_EXPORT adub operator - ( double, const badouble& );
40    friend ADOLC_DLL_EXPORT adub operator * ( const badouble&, const badouble& );
41    friend ADOLC_DLL_EXPORT adub operator * ( double, const badouble& );
42    inline friend adub operator * ( const badouble&, double );
43    inline friend adub operator / ( const badouble&, double );
44    friend ADOLC_DLL_EXPORT adub operator / ( const badouble&, const badouble& );
45    friend ADOLC_DLL_EXPORT adub operator / ( double, const badouble& );
46
47    /*--------------------------------------------------------------------------*/
48    /* unary operators (friends) */
49    friend ADOLC_DLL_EXPORT adub exp  ( const badouble& );
50    friend ADOLC_DLL_EXPORT adub log  ( const badouble& );
51    friend ADOLC_DLL_EXPORT adub sqrt ( const badouble& );
52    friend ADOLC_DLL_EXPORT adub sin  ( const badouble& );
53    friend ADOLC_DLL_EXPORT adub cos  ( const badouble& );
54    friend ADOLC_DLL_EXPORT adub tan  ( const badouble& );
55    friend ADOLC_DLL_EXPORT adub asin ( const badouble& );
56    friend ADOLC_DLL_EXPORT adub acos ( const badouble& );
57    friend ADOLC_DLL_EXPORT adub atan ( const badouble& );
58
59    /*--------------------------------------------------------------------------*/
60    /* special operators (friends) */
61    /* no internal use of condassign: */
62    friend ADOLC_DLL_EXPORT adub    pow   ( const badouble&, double );
63    friend ADOLC_DLL_EXPORT adub    log10 ( const badouble& );
64
65    /* Additional ANSI C standard Math functions Added by DWJ on 8/6/90 */
66    friend ADOLC_DLL_EXPORT adub sinh  ( const badouble& );
67    friend ADOLC_DLL_EXPORT adub cosh  ( const badouble& );
68    friend ADOLC_DLL_EXPORT adub tanh  ( const badouble& );
69#if defined(ATRIG_ERF)
70    friend ADOLC_DLL_EXPORT adub asinh ( const badouble& );
71    friend ADOLC_DLL_EXPORT adub acosh ( const badouble& );
72    friend ADOLC_DLL_EXPORT adub atanh ( const badouble& );
73    friend ADOLC_DLL_EXPORT adub erf   ( const badouble& );
74#endif
75
76    friend ADOLC_DLL_EXPORT adub fabs  ( const badouble& );
77    friend ADOLC_DLL_EXPORT adub ceil  ( const badouble& );
78    friend ADOLC_DLL_EXPORT adub floor ( const badouble& );
79
80    friend ADOLC_DLL_EXPORT adub fmax ( const badouble&, const badouble& );
81    friend ADOLC_DLL_EXPORT adub fmax ( double, const badouble& );
82    friend ADOLC_DLL_EXPORT adub fmax ( const badouble&, double );
83    friend ADOLC_DLL_EXPORT adub fmin ( const badouble&, const badouble& );
84    friend ADOLC_DLL_EXPORT adub fmin ( double, const badouble& );
85    friend ADOLC_DLL_EXPORT adub fmin ( const badouble&, double );
86
87    friend ADOLC_DLL_EXPORT adub ldexp ( const badouble&, int );
88    friend ADOLC_DLL_EXPORT adub frexp ( const badouble&, int* );
89
90    /*--------------------------------------------------------------------------*/
91#endif
92#endif
Note: See TracBrowser for help on using the repository browser.