source: trunk/ADOL-C/src/adouble_tl_hov.cpp @ 762

Last change on this file since 762 was 762, checked in by mbanovic, 7 months ago

Merged branch "medipacksupport" from "git" into "svn"

The following commits were merged:

commit 0d1b5eec2cca8afdeea3cdffa196efb6cfd60a53
Merge: 72d114b 33bfdb5
Author: Kshitij Kulshreshtha <kshitij@…>
Date: Mon Nov 5 10:03:04 2018 +0000

Merge branch 'medipackSupport' into 'medipacksupport'

Medipack support

See merge request adol-c/adol-c!26

commit 33bfdb5a006c782489bfef1b651ca3bdbceefaf2
Merge: ac55eab cf82982
Author: Max Sagebaum <max.sagebaum@…>
Date: Tue Oct 30 11:19:31 2018 +0100

Merge branch 'medipackSupport' into temp

commit ac55eab9dd8cb8c84926ee56456076392a047c1a
Merge: 72d114b caaac60
Author: Max Sagebaum <max.sagebaum@…>
Date: Tue Oct 30 11:14:09 2018 +0100

Merge remote-tracking branch 'origin/master' into temp

commit cf82982421aaa7d83405ffa3d0c9b6ef88251d0c
Merge: 6aeca20 caaac60
Author: Max Sagebaum <max.sagebaum@…>
Date: Tue Oct 30 11:13:25 2018 +0100

Merge remote-tracking branch 'origin/master' into medipackSupport

commit 6aeca205c2448b4bbc915eb76153ebde19448573
Author: Max Sagebaum <max.sagebaum@…>
Date: Tue Oct 23 22:30:28 2018 +0200

Added suport for ZOS, FOS, FOV forward and reverse.

commit caaac60da4c61b370d106c68064d38c42a7cb6e3
Merge: cc2e0b3 70fc288
Author: Kshitij Kulshreshtha <kshitij@…>
Date: Mon Oct 8 08:53:40 2018 +0000

Merge branch 'fix_adtl_hov_refcntr' into 'master'

Fix undefined reference to adtl_hov::refcounter::refcnt

See merge request adol-c/adol-c!24

commit 70fc288b9ab95b16d3179fcf239ee2208ae1a2c4
Author: Jean-Paul Pelteret <jppelteret@…>
Date: Mon Oct 1 20:53:03 2018 +0200

Fix undefined reference to adtl_hov::refcounter::refcnt

commit cc2e0b3154fb6e62580def4501c4cf3f3d8e32ef
Merge: d7400f5 7c7f24b
Author: Kshitij Kulshreshtha <kshitij@…>
Date: Mon Oct 1 12:26:39 2018 +0000

Merge branch 'docu' into 'master'

Refactor tapeless to traceless

See merge request adol-c/adol-c!23

commit ca397962cde23bde80e03924893e09c84d8728bf
Merge: 9cbc432 d7400f5
Author: Max Sagebaum <max.sagebaum@…>
Date: Fri Sep 28 10:07:41 2018 +0200

Merge remote-tracking branch 'origin/master' into medipackSupport

commit 9cbc4324e0d3e19f97ba5c5474121f0189e60f83
Author: Max Sagebaum <max.sagebaum@…>
Date: Thu Sep 27 14:38:30 2018 +0200

Missing MeDiPack? initialization on trace_on.

commit 76c30290365830d2370a354af949f3bf42df3885
Author: Max Sagebaum <max.sagebaum@…>
Date: Thu Sep 27 09:55:42 2018 +0200

Null pointer fix for initialization.

commit 7c7f24b25479870d58ff19d78a6e394ca28ddb58
Author: mflehmig <martin.schroschk@…>
Date: Thu Sep 20 13:16:06 2018 +0200

Refactor tapeless to traceless

As far as I can see, the official wording is traceless forward mode.
Additonally, the latex label and refs changed to 'traceless'.

commit 72d114b7ac42b8ac493030cedd1df8c9746ba5d4
Author: Max Sagebaum <max.sagebaum@…>
Date: Thu Oct 19 09:25:19 2017 +0200

Added support for MeDiPack? library.

Enable it with the configure options:
--enable-medipack --with-medipack=<path to MeDiPack?>

Tutorial on a how to use will follow.

commit b4ca76279d28407f29901d40953d02a0c5c9140e
Author: Max Sagebaum <max.sagebaum@…>
Date: Mon May 7 14:45:13 2018 +0200

Added support for cbrt function.

commit bc7b8ca61865058fac097410fd94a44fba281131
Author: Max Sagebaum <max.sagebaum@…>
Date: Thu Mar 1 10:31:18 2018 +0100

Changes for new interface.

commit cd1e82778c8540221b24559d5097bf6d00597e19
Author: Max Sagebaum <max.sagebaum@…>
Date: Thu Nov 16 14:31:07 2017 +0100

Changes to new MeDiPack? interface for adjoint values.

commit 55bcb0ffd5a9496817bffac0bd2c9489ed8ce992
Author: Max Sagebaum <max.sagebaum@…>
Date: Thu Oct 19 09:25:19 2017 +0200

Added support for MeDiPack? library.

Enable it with the configure options:
--enable-medipack --with-medipack=<path to MeDiPack?>

Tutorial on a how to use will follow.

File size: 2.5 KB
Line 
1/*----------------------------------------------------------------------------
2 ADOL-C -- Automatic Differentiation by Overloading in C++
3 File:     adouble.cpp
4 Revision: $Id$
5 Contents: adouble_tl.cpp contains that definitions of procedures used to
6           define various tapeless adouble operations.
7           These operations actually have two purposes.
8           The first purpose is to actual compute the function, just as
9           the same code written for double precision (single precision -
10           complex - interval) arithmetic would.  The second purpose is
11           to compute directional derivatives in forward mode of
12           automatic differentiation.
13
14 Copyright (c) Andrea Walther, Andreas Griewank, Andreas Kowarz,
15               Hristo Mitev, Sebastian Schlenkrich, Jean Utke, Olaf Vogel,
16               Benjamin Letschert, Benjamin Jurgelucks
17
18 This file is part of ADOL-C. This software is provided as open source.
19 Any use, reproduction, or distribution of the software constitutes
20 recipient's acceptance of the terms of the accompanying license file.
21
22----------------------------------------------------------------------------*/
23
24#include <adolc/adtl_hov.h>
25#include <cmath>
26#include <iostream>
27#include <limits>
28#include "dvlparms.h"
29
30using std::cout;
31
32extern "C" void adolc_exit(int errorcode, const char *what, const char* function, const char *file, int line);
33
34namespace adtl_hov {
35
36
37size_t adouble::numDir = 1;
38size_t adouble::degree = 1;
39
40#ifdef USE_ADTL_REFCOUNTING
41size_t refcounter::refcnt = 0;
42#endif
43
44
45/*
46#if USE_BOOST_POOL
47boost::pool<boost::default_user_allocator_new_delete>* adouble::advalpool = new
48boost::pool<boost::default_user_allocator_new_delete>((adouble::numDir+1) * sizeof(double), 32, 10000);
49#endif
50*/
51/*******************  i/o operations  ***************************************/
52ostream& operator << ( ostream& out, const adouble& a) {
53        out << "Value: " << a.val;
54        out << " ADValues (" << adouble::numDir << "): ";
55        FOR_I_EQ_0_LT_NUMDIR
56            out << a.ADVAL_I << " ";
57        out << "(a)";
58    return out;
59}
60
61istream& operator >> ( istream& in, adouble& a) {
62        char c;
63        do in >> c;
64        while (c!=':' && !in.eof());
65        in >> a.val;
66        unsigned int num;
67        do in >> c;
68        while (c!='(' && !in.eof());
69        in >> num;
70        if (num>adouble::numDir)
71        {
72            cout << "ADOL-C error: to many directions in input\n";
73            adolc_exit(-1,"",__func__,__FILE__,__LINE__);
74        }
75        do in >> c;
76        while (c!=':' && !in.eof());
77        FOR_I_EQ_0_LT_NUMDIR
78            in >> a.ADVAL_I;
79        do in >> c;
80        while (c!=')' && !in.eof());
81        return in;
82}
83
84}
Note: See TracBrowser for help on using the repository browser.