/[escript]/trunk/escript/src/DataC.h
ViewVC logotype

Contents of /trunk/escript/src/DataC.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1388 - (show annotations)
Fri Jan 11 07:45:58 2008 UTC (11 years, 7 months ago) by trankine
File MIME type: text/plain
File size: 4489 byte(s)
And get the *(&(*&(* name right
1
2 /* $Id$ */
3
4 /*******************************************************
5 *
6 * Copyright 2003-2007 by ACceSS MNRF
7 * Copyright 2007 by University of Queensland
8 *
9 * http://esscc.uq.edu.au
10 * Primary Business: Queensland, Australia
11 * Licensed under the Open Software License version 3.0
12 * http://www.opensource.org/licenses/osl-3.0.php
13 *
14 *******************************************************/
15
16 #if !defined escript_DataC_20040611_H
17 #define escript_DataC_20040611_H
18 #include "system_dep.h"
19
20 #define ESCRIPT_MAX_DATA_RANK 4
21 /**
22 \brief
23 Provide a wrapper around a Data object so Data may be accessed from C.
24
25 Description:
26 Provide a wrapper around a Data object so Data may be accessed from C.
27
28 */
29 struct escriptDataC {
30 void* m_dataPtr;
31 };
32
33 typedef struct escriptDataC escriptDataC;
34
35 /**
36 \brief
37 Return the function space type code.
38 \param data Input - C wrapper for Data.
39 */
40 ESCRIPT_DLL_API int getFunctionSpaceType(escriptDataC* data);
41
42 /**
43 \brief
44 sets the int variable _fs_ the function space type of _data_ if the data are not empty.
45 \param _fs_ Input/Output - variable to be updated.
46 \param _data_ Input - C wrapper for Data.
47 */
48 #define updateFunctionSpaceType(_fs_,_data_) _fs_=(isEmpty(_data_) ? _fs_ : getFunctionSpaceType(_data_))
49
50 /**
51 \brief
52 is true if the function space type of _data_ is equal to _fs_ or is empty
53 \param _fs_ Input - function space type to checked against
54 \param _data_ Input - C wrapper for Data.
55 */
56 #define functionSpaceTypeEqual(_fs_,_data_) ( (isEmpty(_data_) || _fs_==getFunctionSpaceType(_data_)) ) ? 1 : 0
57
58 /**
59 \brief
60 Returns the true if the data are empty or data is NULL.
61 \param data Input - C wrapper for Data.
62 */
63 ESCRIPT_DLL_API int isEmpty(escriptDataC* data);
64
65 /**
66 \brief
67 Return true if the input shape matches the data point shape for data
68 \param data Input - C wrapper for Data.
69 \param rank Input - number of dimensions.
70 \param dimensions Input -
71 */
72 ESCRIPT_DLL_API int isDataPointShapeEqual(escriptDataC* data, int rank, int* dimensions);
73 /**
74 \brief
75 Return true if the number of data points per sample and the number
76 of samples equal the input values. In the case that data is empty or NULL,
77 true is returned.
78 \param data Input - C wrapper for Data.
79 \param numDataPointsPerSample Input - number of data points per sample
80 \param numSamples Input - number of samples
81 */
82 ESCRIPT_DLL_API int numSamplesEqual(escriptDataC* data, int numDataPointsPerSample,
83 int numSamples);
84
85 /**
86 \brief
87 Returns the number of data points per sample
88 \param data Input - C wrapper for Data.
89 */
90 ESCRIPT_DLL_API int getNumDataPointsPerSample(escriptDataC* data);
91
92 /**
93 \brief
94 Returns the rank of the point data for the data.
95 \param data Input - C wrapper for Data.
96 */
97 ESCRIPT_DLL_API int getDataPointRank(escriptDataC* data);
98
99 /**
100 \brief
101 Returns the value of the i-th component of the shape of the point data.
102 \param data Input - C wrapper for Data.
103 \param i Input - index of shape component.
104 */
105 ESCRIPT_DLL_API int getDataPointShape(escriptDataC* data,int i);
106
107 /**
108 \brief
109 Return the number of doubles needed for each data point.
110 \param data Input - C wrapper for Data.
111 */
112 ESCRIPT_DLL_API int getDataPointSize(escriptDataC* data);
113 /**
114 \brief
115 Return the number of doubles stored for the Data object.
116 Argument data may be NULL, in which case 0 is returnd.
117 \param data Input - C wrapper for Data.
118 */
119 ESCRIPT_DLL_API int getLength(escriptDataC* data);
120 /**
121 \brief
122 Return true if data is expanded.
123 Argument data may be NULL, in which case false is returnd.
124 \param data Input - C wrapper for Data.
125 */
126 ESCRIPT_DLL_API int isExpanded(escriptDataC* data);
127 /**
128 \brief
129 Return a pointer to the data for the given sample number.
130 if data is empty NULL is returned.
131 data may be NULL, in which case NULL is returnd.
132 \param data Input - C wrapper for Data.
133 \param sampleNo Input - The sample number.
134 */
135 ESCRIPT_DLL_API double* getSampleData(escriptDataC* data, int sampleNo);
136 /**
137 \brief
138 Return a pointer to the data for the given sample number.
139 Fast version of getSampledata: does no error checking.
140 \param data Input - C wrapper for Data.
141 \param sampleNo Input - The sample number.
142 */
143 ESCRIPT_DLL_API double* getSampleDataFast(escriptDataC* data, int sampleNo);
144 #endif

Properties

Name Value
svn:eol-style native
svn:keywords Author Date Id Revision

  ViewVC Help
Powered by ViewVC 1.1.26