source: trunk/ADOL-C/src/adalloc.h @ 71

Last change on this file since 71 was 42, checked in by awalther, 10 years ago

set svn keywords property

  • Property svn:keywords set to Author Date Id Revision
File size: 2.9 KB
Line 
1/*----------------------------------------------------------------------------
2 ADOL-C -- Automatic Differentiation by Overloading in C++
3 File:     adalloc.h
4 Revision: $Id: adalloc.h 42 2009-07-15 18:37:17Z awalther $
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 <common.h>
19
20/****************************************************************************/
21/*                                                         Now the C THINGS */
22BEGIN_C_DECLS
23
24/*--------------------------------------------------------------------------*/
25/*                                              MEMORY MANAGEMENT UTILITIES */
26ADOLC_DLL_EXPORT double    *myalloc1(int);
27ADOLC_DLL_EXPORT double   **myalloc2(int, int);
28ADOLC_DLL_EXPORT double  ***myalloc3(int, int, int);
29
30ADOLC_DLL_EXPORT void myfree1(double   *);
31ADOLC_DLL_EXPORT void myfree2(double  **);
32ADOLC_DLL_EXPORT void myfree3(double ***);
33
34/*--------------------------------------------------------------------------*/
35/*                                          SPECIAL IDENTITY REPRESENTATION */
36ADOLC_DLL_EXPORT double   **myallocI2(int);
37ADOLC_DLL_EXPORT void myfreeI2(int, double**);
38
39ADOLC_DLL_EXPORT unsigned int * myalloc1_uint(int);
40
41ADOLC_DLL_EXPORT unsigned long int *  myalloc1_ulong(int);
42ADOLC_DLL_EXPORT unsigned long int ** myalloc2_ulong(int, int);
43
44
45/****************************************************************************/
46/*                              INTEGER VARIANT FOR BIT PATTERN PROPAGATION */
47
48ADOLC_DLL_EXPORT void myfree1_uint(unsigned int*);
49
50ADOLC_DLL_EXPORT void myfree1_ulong(unsigned long int *);
51ADOLC_DLL_EXPORT void myfree2_ulong(unsigned long int **);
52
53END_C_DECLS
54
55/****************************************************************************/
56/*                                                       Now the C++ THINGS */
57#if defined(__cplusplus)
58
59/*--------------------------------------------------------------------------*/
60/*                                              MEMORY MANAGEMENT UTILITIES */
61inline double   * myalloc(int n) {
62    return myalloc1(n);
63}
64inline double  ** myalloc(int m, int n) {
65    return myalloc2(m,n);
66}
67inline double *** myalloc(int m, int n, int p) {
68    return myalloc3(m,n,p);
69}
70
71inline void myfree(double   *A) {
72    myfree1(A);
73}
74inline void myfree(double  **A) {
75    myfree2(A);
76}
77inline void myfree(double ***A) {
78    myfree3(A);
79}
80
81#endif
82
83/****************************************************************************/
84#endif
Note: See TracBrowser for help on using the repository browser.