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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 757 - (hide annotations)
Mon Jun 26 13:12:56 2006 UTC (13 years, 3 months ago) by woo409
File MIME type: text/plain
File size: 4149 byte(s)
+ Merge of intelc_win32 branch (revision 741:755) with trunk. Tested on iVEC altix (run_tests and py_tests all pass)

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

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26