Changeset 605 for trunk/ADOL-C/include


Ignore:
Timestamp:
May 11, 2015 5:55:32 AM (4 years ago)
Author:
kulshres
Message:

merge branch 'master' of 'gitclone' into 'svn'

The following commits were merged:

commit 34ee2eb90cc10b6058c8ef531042d82e73fddbc7
Author: Kshitij Kulshreshtha <kshitij@…>
Date: Thu May 7 11:02:52 2015 +0200

add extra void* argument in ext_diff_fct_v2

This is only for use by the user's own evaluation
routines and is completely opaque to ADOL-C.

The user is responsible for making sure it doesn't
kill his code.

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

commit da07c215cc32cf3c239e111c0a8764dec59580d3
Author: Kshitij Kulshreshtha <kshitij@…>
Date: Thu May 7 10:04:21 2015 +0200

force users to use -std=c++11 in their code too

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

commit 40748fda778e351f97050d7f5214e028bc1b8a0d
Merge: 88d480c 5ff49e4
Author: Kshitij Kulshreshtha <kshitij@…>
Date: Wed May 6 13:44:50 2015 +0200

Merge branch 'master' of sommerfeld.math.upb.de:Git/adolc

commit 88d480cf5e91b16279aa2dd3a26f0ffea4f26572
Author: Kshitij Kulshreshtha <kshitij@…>
Date: Wed May 6 13:44:41 2015 +0200

add explicit downcasts from badouble to double

These are to be used only in very special cases.
Like when I/O is required, different from the default
I/O provided. Or to make certain variables passive.
The explicit specifier makes sure that the compiler
does not automatically do any type changes without
the user saying so in the code.

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

commit 4e660e12e8387f60f29b4cc62bed7fb61c61b1fb
Author: Kshitij Kulshreshtha <kshitij@…>
Date: Tue May 5 16:53:33 2015 +0200

Revert "create a configure flag for user-IO in traceless mode"

We decided to introduce explicit casting to double from adouble
and adtl::adouble before output, if the user wants anything but default
behaviour here.

This reverts commit 26a981c2aa80ea6be5a474b93a2f30e9ccf2479b.

commit 5ff49e405c275d024f90b5a177b28df1de226997
Author: Kshitij Kulshreshtha <kshitij@…>
Date: Fri Apr 24 11:45:23 2015 +0200

change order of includes and configure tests for mingw compatibility

This change allows me to compile ADOL-C using a mingw32-w64 cross compiler
when also using the mingw compiled boost library.

Native Visual studio support for using boost is still untested.

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

commit cf341fcb23a1abba4b83fbf89b3743035635afe2
Author: Kshitij Kulshreshtha <kshitij@…>
Date: Thu Apr 23 11:22:52 2015 +0200

fix ext_diff_fct.cpp to compile again.

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

commit 26a981c2aa80ea6be5a474b93a2f30e9ccf2479b
Author: Kshitij Kulshreshtha <kshitij@…>
Date: Tue Apr 14 12:57:09 2015 +0200

create a configure flag for user-IO in traceless mode

some implementations don't like to read/write gradient information
so allow the user to define their own stream operators if they wish

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

Location:
trunk/ADOL-C/include/adolc
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/ADOL-C/include/adolc/adouble.h

    r603 r605  
    2525/*                                                         THIS FILE IS C++ */
    2626#ifdef __cplusplus
     27#if __cplusplus < 201103L
     28#error "please use -std=c++11 compiler flag with a C++11 compliant compiler"
     29#endif
    2730
    2831#include <cstdio>
     
    104107        return getValue();
    105108    }
     109    explicit operator double();
     110    explicit operator double const&();
     111    explicit operator double&&();
    106112    void setValue ( const double );
    107113    /* badouble& operator = ( const adouble& );
     
    306312    }
    307313#endif
    308 
    309314};
    310315
  • trunk/ADOL-C/include/adolc/adtl.h

    r604 r605  
    2222#include <list>
    2323#include <stdexcept>
     24
     25#if __cplusplus < 201103L
     26#error "please use -std=c++11 compiler flag with a C++11 compliant compiler"
     27#endif
    2428
    2529using std::ostream;
     
    204208    inline double getADValue(const unsigned int p) const;
    205209    inline void setADValue(const unsigned int p, const double v);
     210    inline explicit operator double const&();
     211    inline explicit operator double&&();
     212    inline explicit operator double();
    206213
    207214protected:
     
    15921599
    15931600/*******************  getter / setter  **************************************/
     1601inline adouble::operator double const & () {
     1602    if (no_do_val()) {
     1603        fprintf(DIAG_OUT, "ADOL-C error: Tapeless: Incorrect mode, call setMode(enum Mode mode)\n");
     1604        throw logic_error("incorrect function call, errorcode=1");
     1605    }
     1606    return val;
     1607}
     1608
     1609inline adouble::operator double && () {
     1610    if (no_do_val()) {
     1611        fprintf(DIAG_OUT, "ADOL-C error: Tapeless: Incorrect mode, call setMode(enum Mode mode)\n");
     1612        throw logic_error("incorrect function call, errorcode=1");
     1613    }
     1614    return (double&&)val;
     1615}
     1616
     1617inline adouble::operator double() {
     1618    if (no_do_val()) {
     1619        fprintf(DIAG_OUT, "ADOL-C error: Tapeless: Incorrect mode, call setMode(enum Mode mode)\n");
     1620        throw logic_error("incorrect function call, errorcode=1");
     1621    }
     1622    return val;
     1623}
     1624
     1625
    15941626inline double adouble::getValue() const {
    15951627    if (no_do_val()) {
  • trunk/ADOL-C/include/adolc/externfcts2.h

    r600 r605  
    2222BEGIN_C_DECLS
    2323
    24 typedef int (ADOLC_ext_fct_v2) (int iArrLen, int *iArr, int nin, int nout, int *insz, double **x, int *outsz, double **y);
    25 typedef int (ADOLC_ext_fct_v2_fos_forward)(int iArrLen, int* iArr, int nin, int nout, int *insz, double **x, double **xp, int *outsz, double **y, double **yp);
    26 typedef int (ADOLC_ext_fct_v2_fov_forward)(int iArrLen, int* iArr, int nin, int nout, int *insz, double **x, int ndir, double ***Xp, int *outsz, double **y, double ***Yp);
    27 typedef int (ADOLC_ext_fct_v2_fos_reverse)(int iArrLen, int* iArr, int nout, int nin, int *outsz, double **up, int *insz, double **zp, double **x, double **y);
    28 typedef int (ADOLC_ext_fct_v2_fov_reverse)(int iArrLen, int* iArr, int nout, int nin, int *outsz, int dir, double ***Up, int *insz, double ***Zp, double **x, double **y);
     24typedef int (ADOLC_ext_fct_v2) (int iArrLen, int *iArr, int nin, int nout, int *insz, double **x, int *outsz, double **y, void* ctx);
     25typedef int (ADOLC_ext_fct_v2_fos_forward)(int iArrLen, int* iArr, int nin, int nout, int *insz, double **x, double **xp, int *outsz, double **y, double **yp, void *ctx);
     26typedef int (ADOLC_ext_fct_v2_fov_forward)(int iArrLen, int* iArr, int nin, int nout, int *insz, double **x, int ndir, double ***Xp, int *outsz, double **y, double ***Yp, void* ctx);
     27typedef int (ADOLC_ext_fct_v2_fos_reverse)(int iArrLen, int* iArr, int nout, int nin, int *outsz, double **up, int *insz, double **zp, double **x, double **y, void *ctx);
     28typedef int (ADOLC_ext_fct_v2_fov_reverse)(int iArrLen, int* iArr, int nout, int nin, int *outsz, int dir, double ***Up, int *insz, double ***Zp, double **x, double **y, void* ctx);
    2929
    3030/* The following two aren't implemented */
    31 typedef int (ADOLC_ext_fct_v2_hos_forward)(int iArrLen, int* iArr, int nin, int nout, int *insz, double **x, int degree, double ***Xp, int *outsz, double **y, double ***Yp);
    32 typedef int (ADOLC_ext_fct_v2_hov_forward)(int iArrLen, int* iArr, int nin, int nout, int *insz, double **x, int degree, int ndir, double ****Xp, int *outsz, double **y, double ****Yp);
     31typedef int (ADOLC_ext_fct_v2_hos_forward)(int iArrLen, int* iArr, int nin, int nout, int *insz, double **x, int degree, double ***Xp, int *outsz, double **y, double ***Yp, void* ctx);
     32typedef int (ADOLC_ext_fct_v2_hov_forward)(int iArrLen, int* iArr, int nin, int nout, int *insz, double **x, int degree, int ndir, double ****Xp, int *outsz, double **y, double ****Yp, void *ctx);
    3333
    3434typedef struct {
     
    166166  char dp_y_priorRequired;
    167167  /**
     168   * This is a opaque context pointer that the user may set and use
     169   * in his implementation of the above functions
     170   */
     171  void* context;
     172  /**
    168173   * This is an all-memory pointer for allocating and deallocating
    169174   * all other pointers can point to memory within here.
     
    185190ADOLC_DLL_EXPORT void edf_zero(ext_diff_fct_v2 *edfct);
    186191
     192inline void edf_set_opaque_context(ext_diff_fct_v2 *edfct, void *ctx) {
     193    edfct->context = ctx;
     194}
     195
    187196#endif
    188197#endif
Note: See TracChangeset for help on using the changeset viewer.