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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 478 - (show annotations)
Tue Jan 31 02:21:49 2006 UTC (13 years, 4 months ago) by jgs
File MIME type: text/plain
File size: 4288 byte(s)
rationalise #includes

1 /* $Id$ */
2 /*
3 ******************************************************************************
4 * *
5 * COPYRIGHT ACcESS 2004 - All Rights Reserved *
6 * *
7 * This software is the property of ACcESS. No part of this code *
8 * may be copied in any form or by any means without the expressed written *
9 * consent of ACcESS. Copying, use or modification of this software *
10 * by any unauthorised person is illegal unless that person has a software *
11 * license agreement with ACcESS. *
12 * *
13 ******************************************************************************
14 */
15
16 #if !defined escript_DataC_20040611_H
17 #define escript_DataC_20040611_H
18
19 #define ESCRIPT_MAX_DATA_RANK 4
20 /**
21 \brief
22 Provide a wrapper around a Data object so Data may be accessed from C.
23
24 Description:
25 Provide a wrapper around a Data object so Data may be accessed from C.
26
27 */
28 struct escriptDataC {
29 void* m_dataPtr;
30 };
31
32 typedef struct escriptDataC escriptDataC;
33
34 /**
35 \brief
36 Return the function space type code.
37 \param data Input - C wrapper for Data.
38 */
39 int getFunctionSpaceType(escriptDataC* data);
40
41 /**
42 \brief
43 sets the int variable _fs_ the function space type of _data_ if the data are not empty.
44 \param _fs_ Input/Output - variable to be updated.
45 \param _data_ Input - C wrapper for Data.
46 */
47 #define updateFunctionSpaceType(_fs_,_data_) _fs_=(isEmpty(_data_) ? _fs_ : getFunctionSpaceType(_data_))
48
49 /**
50 \brief
51 is true if the function space type of _data_ is equal to _fs_ or is empty
52 \param _fs_ Input - function space type to checked against
53 \param _data_ Input - C wrapper for Data.
54 */
55 #define functionSpaceTypeEqual(_fs_,_data_) ( (isEmpty(_data_) || _fs_==getFunctionSpaceType(_data_)) ) ? 1 : 0
56
57 /**
58 \brief
59 Returns the true if the data are empty or data is NULL.
60 \param data Input - C wrapper for Data.
61 */
62 int isEmpty(escriptDataC* data);
63
64 /**
65 \brief
66 Return true if the input shape matches the data point shape for data
67 \param data Input - C wrapper for Data.
68 \param rank Input - number of dimensions.
69 \param dimensions Input -
70 */
71 int isDataPointShapeEqual(escriptDataC* data, int rank, int* dimensions);
72 /**
73 \brief
74 Return true if the number of data points per sample and the number
75 of samples equal the input values. In the case that data is empty or NULL,
76 true is returned.
77 \param data Input - C wrapper for Data.
78 \param numDataPointsPerSample Input - number of data points per sample
79 \param numSamples Input - number of samples
80 */
81 int numSamplesEqual(escriptDataC* data, int numDataPointsPerSample,
82 int numSamples);
83
84 /**
85 \brief
86 Returns the rank of the point data for the data.
87 \param data Input - C wrapper for Data.
88 */
89 int getDataPointRank(escriptDataC* data);
90
91 /**
92 \brief
93 Returns the value of the i-th component of the shape of the point data.
94 \param data Input - C wrapper for Data.
95 \param i Input - index of shape component.
96 */
97 int getDataPointShape(escriptDataC* data,int i);
98
99 /**
100 \brief
101 Return the number of doubles needed for each data point.
102 \param data Input - C wrapper for Data.
103 */
104 int getDataPointSize(escriptDataC* data);
105 /**
106 \brief
107 Return the number of doubles stored for the Data object.
108 Argument data may be NULL, in which case 0 is returnd.
109 \param data Input - C wrapper for Data.
110 */
111 int getLength(escriptDataC* data);
112 /**
113 \brief
114 Return true if data is expanded.
115 Argument data may be NULL, in which case false is returnd.
116 \param data Input - C wrapper for Data.
117 */
118 int isExpanded(escriptDataC* data);
119 /**
120 \brief
121 Return a pointer to the data for the given sample number.
122 if data is empty NULL is returned.
123 data may be NULL, in which case NULL is returnd.
124 \param data Input - C wrapper for Data.
125 \param sampleNo Input - The sample number.
126 */
127 double* getSampleData(escriptDataC* data, int sampleNo);
128
129 #endif

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26