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

Last change on this file since 748 was 748, checked in by kulshres, 20 months ago

Merge branch 'activity' of 'gitclone' into 'svn'

The following commits were merged:
commit fc84dcabde90416ff32e8b08a06b7dad775e06bf
Author: Kshitij Kulshreshtha <kshitij@…>
Date: Fri Aug 4 10:36:17 2017 +0200

more debugging activity analysis

sign of coval is important in all cases, so I can't change it only
in one case.

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

commit b5f80a477d085d84c67ee71e2cf84ce6d926b858
Author: Kshitij Kulshreshtha <kshitij@…>
Date: Thu Aug 3 18:24:40 2017 +0200

correct some sign changes

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

commit e8642818244e33f0a4204fdffa936cc7195fc5bc
Author: Kshitij Kulshreshtha <kshitij@…>
Date: Thu Aug 3 14:57:46 2017 +0200

add activity tracking to parameters

parameters are always active since they can be changed after tracing
is complete using set_param_vec, just like independent variables.

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

commit ae9f196ebbf225cd9a5e62e26266c2cbbbc8a5b2
Author: Kshitij Kulshreshtha <kshitij@…>
Date: Wed Aug 2 17:58:15 2017 +0200

add activity tracking to conditional assignments

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

commit c4b610de2500e949271d3bf60f04b5d34a229807
Author: Kshitij Kulshreshtha <kshitij@…>
Date: Mon Jul 31 13:50:05 2017 +0200

simplify some operations during activity tracking

especially assignment from adub. make that equivalent to construction
from adub, by stealing rhs location. The problem with not stealing that
location would be to restore rhs previous activity before rhs was created
so that we can replace lhs into the previous operation. Since we don't have
a way of recreating activities from before, it's better to steal the
location of rhs and free the lhs location for reuse later.

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

commit 8e2ad08100254ee4309209d6c807928d6cab94ee
Author: Kshitij Kulshreshtha <kshitij@…>
Date: Fri Jul 28 14:06:30 2017 +0200

add activity checking code in the operators and functions for adouble

conditional assignments do not track activity at the moment. Next step
is to make the parameters active too.

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

commit b8b6411ba29892d10d36bfe7a4d2abcbeb59ff67
Author: Kshitij Kulshreshtha <kshitij@…>
Date: Fri Jul 28 13:59:36 2017 +0200

add a buffer in globalTapeVars to track activity of live variables

it is managed by the StoreManager? class for allocation and deallocation

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

commit 569a7f28227991f8029e89b989c6f04415e8bd1a
Author: Kshitij Kulshreshtha <kshitij@…>
Date: Fri Jul 28 13:58:32 2017 +0200

Add option to enable activity tracking in adouble class

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

File size: 4.7 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    inline friend 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.