source: trunk/ADOL-C/include/adolc/common.h @ 375

Last change on this file since 375 was 375, checked in by kulshres, 8 years ago

Move some options out of usrparms.h

These should be set using the configure script arguments and are
now in a new generated header file that will be installed via
make install. This include ATRIG_ERF, and the typedefs for locint/revreal
A new option ADOLC_ADVANCED_BRANCHING is also created.

ADOLC_USE_CALLOC goes into config.h as this is only required for build
but not after installation

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

  • Property svn:keywords set to Author Date Id Revision
File size: 3.6 KB
Line 
1/*----------------------------------------------------------------------------
2 ADOL-C -- Automatic Differentiation by Overloading in C++
3 File:     common.h
4 Revision: $Id: common.h 375 2012-12-14 11:22:48Z kulshres $
5 Contents: Common (global) ADOL-C header 
6 
7 Copyright (c) Andrea Walther, Andreas Griewank, Andreas Kowarz,
8               Hristo Mitev, Sebastian Schlenkrich, Jean Utke, Olaf Vogel
9 
10 This file is part of ADOL-C. This software is provided as open source.
11 Any use, reproduction, or distribution of the software constitutes
12 recipient's acceptance of the terms of the accompanying license file.
13 
14----------------------------------------------------------------------------*/
15
16#if !defined(ADOLC_COMMON_H)
17#define ADOLC_COMMON_H 1
18
19#include <stdint.h>
20/*--------------------------------------------------------------------------*/
21/* standard includes */
22#if !defined(__cplusplus)
23#   include <stdlib.h>
24#   include <stdio.h>
25#else
26#   include <cstdlib>
27#   include <cstdio>
28    using namespace std;
29#endif
30
31/*--------------------------------------------------------------------------*/
32/* type definitions */
33    typedef unsigned int uint;
34
35/*--------------------------------------------------------------------------*/
36/* OpenMP includes */
37#if defined(_OPENMP)
38#include <omp.h>
39#endif
40
41/*--------------------------------------------------------------------------*/
42/* system dependend configuration */
43#if defined(ADOLC_INTERNAL)
44#   if HAVE_CONFIG_H
45#       include "config.h"
46
47/*      malloc/calloc/realloc replacments */
48#       undef ADOLC_NO_MALLOC
49#       undef ADOLC_NO_REALLOC
50#       if !defined(HAVE_MALLOC)
51#           define ADOLC_NO_MALLOC 1
52#       else
53#           if (HAVE_MALLOC == 0)
54#               define ADOLC_NO_MALLOC 1
55#           endif /* HAVE_MALLOC == 0 */
56#       endif /* HAVE_MALLOC */
57#       if !defined(HAVE_REALLOC)
58#           define ADOLC_NO_REALLOC 1
59#       else
60#           if (HAVE_REALLOC == 0)
61#               define ADOLC_NO_REALLOC 1
62#           endif /* HAVE_REALLOC == 0 */
63#       endif /* HAVE_REALLOC */
64
65#       if defined(ADOLC_NO_MALLOC)
66#           include "malloc.h"
67#           define malloc rpl_malloc
68#           define calloc rpl_calloc
69#       endif /* ADOLC_NO_MALLOC */
70#       if defined(ADOLC_NO_REALLOC)
71#           include "malloc.h"
72#           define realloc rpl_realloc
73#       endif /* ADOLC_NO_REALLOC */
74
75#   endif /* HAVE_CONFIG_H */
76#endif /* ADOLC_INTERNAL */
77
78/*--------------------------------------------------------------------------*/
79/* developer and user parameters */
80#include <adolc/dvlparms.h>
81#include <adolc/usrparms.h>
82#include <adolc/adolc_settings.h>
83
84/*--------------------------------------------------------------------------*/
85/* windows dll exports/imports */
86#if defined(ADOLC_DLL)
87#       define ADOLC_DLL_EXPORT __declspec(dllexport)
88#else
89#       define ADOLC_DLL_EXPORT
90#endif
91
92/*--------------------------------------------------------------------------*/
93/* further helpful macros */
94#if defined(__cplusplus)
95#  define BEGIN_C_DECLS extern "C" {
96#  define END_C_DECLS   }
97#else
98#  define BEGIN_C_DECLS
99#  define END_C_DECLS
100#endif
101
102#define MAXDEC(a,b) do { register revreal __r = (b); if ( __r > (a) ) (a) = __r; } while (0)
103#define MAXDECI(a,b) do { register int __r = (b); if ( __r > (a) ) (a) = __r; } while (0)
104#define MINDECR(a,b) do { register revreal __r = (b); if ( __r < (a) ) (a) = __r; } while (0)
105#define MINDEC(a,b) do { register int __r = (b); if ( __r < (a) ) (a) = __r; } while (0)
106
107#define MAX_ADOLC(a,b) ( (a)<(b)? (b):(a) )
108#define MIN_ADOLC(a,b) ( (a)>(b)? (b):(a) )
109
110/*--------------------------------------------------------------------------*/
111#endif
112
Note: See TracBrowser for help on using the repository browser.