ADOL-C: Automatic Differentiation in C/C++ 2.7.3
Loading...
Searching...
No Matches
adalloc.h
Go to the documentation of this file.
1/*----------------------------------------------------------------------------
2 ADOL-C -- Automatic Differentiation by Overloading in C++
3 File: adalloc.h
4 Revision: $Id$
5 Contents: Allocation of arrays of doubles in several dimensions
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#if !defined(ADOLC_ADALLOC_H)
16#define ADOLC_ADALLOC_H 1
17
18#include <adolc/adolcexport.h>
20
21/****************************************************************************/
22/* Now the C THINGS */
24
25/*--------------------------------------------------------------------------*/
26/* MEMORY MANAGEMENT UTILITIES */
27ADOLC_API char *populate_dpp(double ***const pointer, char *const memory,
28 size_t n, size_t m);
29ADOLC_API char *populate_dppp(double ****const pointer, char *const memory,
30 size_t n, size_t m, size_t p);
31ADOLC_API char *populate_dppp_nodata(double ****const pointer,
32 char *const memory, size_t n, size_t m);
33ADOLC_API double *myalloc1(size_t);
34ADOLC_API double **myalloc2(size_t, size_t);
35ADOLC_API double ***myalloc3(size_t, size_t, size_t);
36
37ADOLC_API void myfree1(double *);
38ADOLC_API void myfree2(double **);
39ADOLC_API void myfree3(double ***);
40
41/*--------------------------------------------------------------------------*/
42/* SPECIAL IDENTITY REPRESENTATION */
43ADOLC_API double **myallocI2(size_t);
44ADOLC_API void myfreeI2(size_t, double **);
45
46ADOLC_API unsigned int *myalloc1_uint(size_t);
47
48ADOLC_API size_t *myalloc1_ulong(size_t);
49ADOLC_API size_t **myalloc2_ulong(size_t, size_t);
50
51/****************************************************************************/
52/* INTEGER VARIANT FOR BIT PATTERN PROPAGATION */
53
54ADOLC_API void myfree1_uint(unsigned int *);
55
56ADOLC_API void myfree1_ulong(size_t *);
57ADOLC_API void myfree2_ulong(size_t **);
58
60
61/****************************************************************************/
62/* Now the C++ THINGS */
63#if defined(__cplusplus)
64
65/*--------------------------------------------------------------------------*/
66/* MEMORY MANAGEMENT UTILITIES */
67ADOLC_API inline double *myalloc(size_t n) { return myalloc1(n); }
68ADOLC_API inline double **myalloc(size_t m, size_t n) { return myalloc2(m, n); }
69ADOLC_API inline double ***myalloc(size_t m, size_t n, size_t p) {
70 return myalloc3(m, n, p);
71}
72
73ADOLC_API inline void myfree(double *A) { myfree1(A); }
74ADOLC_API inline void myfree(double **A) { myfree2(A); }
75ADOLC_API inline void myfree(double ***A) { myfree3(A); }
76
77#endif
78
79/****************************************************************************/
80#endif
ADOLC_API double ** myallocI2(size_t)
ADOLC_API double *** myalloc3(size_t, size_t, size_t)
ADOLC_API unsigned int * myalloc1_uint(size_t)
ADOLC_API char * populate_dppp_nodata(double ****const pointer, char *const memory, size_t n, size_t m)
ADOLC_API size_t ** myalloc2_ulong(size_t, size_t)
BEGIN_C_DECLS ADOLC_API char * populate_dpp(double ***const pointer, char *const memory, size_t n, size_t m)
ADOLC_API void myfree1_uint(unsigned int *)
ADOLC_API size_t * myalloc1_ulong(size_t)
ADOLC_API char * populate_dppp(double ****const pointer, char *const memory, size_t n, size_t m, size_t p)
ADOLC_API void myfree2(double **)
ADOLC_API double * myalloc1(size_t)
ADOLC_API void myfree1(double *)
ADOLC_API void myfree3(double ***)
ADOLC_API void myfree1_ulong(size_t *)
ADOLC_API double ** myalloc2(size_t, size_t)
ADOLC_API void myfree2_ulong(size_t **)
ADOLC_API void myfreeI2(size_t, double **)
#define ADOLC_API
Definition adolcexport.h:16
#define BEGIN_C_DECLS
Definition common.h:115
#define END_C_DECLS
Definition common.h:116