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

Annotation of /trunk/escript/src/DataArray.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: 3607 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 82 /*
2 elspeth 615 ************************************************************
3     * Copyright 2006 by ACcESS MNRF *
4     * *
5     * http://www.access.edu.au *
6     * Primary Business: Queensland, Australia *
7     * Licensed under the Open Software License version 3.0 *
8     * http://www.opensource.org/licenses/osl-3.0.php *
9     * *
10     ************************************************************
11 jgs 82 */
12 jgs 108
13 jgs 82 #if !defined escript_DataArray_20040421_H
14     #define escript_DataArray_20040421_H
15 woo409 757 #include "system_dep.h"
16 jgs 82
17     #include "DataArrayView.h"
18    
19     #include <boost/python/object.hpp>
20 jgs 474 #include <boost/python/numeric.hpp>
21 jgs 478 #include <boost/scoped_ptr.hpp>
22 jgs 82
23     namespace escript {
24    
25     /**
26     \brief
27 jgs 108 DataArray contains a DataArrayView plus the vector of data values
28     associated with the View.
29 jgs 82
30     Description:
31 jgs 108 DataArray implements the management of the underlying data values contained in
32     an escript Data object. It consists of a vector (m_data) which holds all the individual
33     data values, plus a DataArrayView (m_dataView) which defines the shape of the data
34     points contained in the Data object.
35 jgs 82
36     */
37    
38     class DataArray {
39    
40     public:
41 jgs 108
42 jgs 82 /**
43     \brief
44     Default constructor for DataArray.
45    
46     Description:
47 jgs 108 Default constructor for DataArray.
48     Creates a data vector containing a single value, plus a DataArrayView
49     which presents this data value as a scalar Data object.
50 jgs 82 */
51 woo409 757 ESCRIPT_DLL_API
52 jgs 82 DataArray(double value=0.0);
53    
54 jgs 108 /**
55 jgs 82 \brief
56     Constructor for DataArray.
57    
58     Description:
59 jgs 108 Constructor for DataArray of given shape.
60     Assigns each element of the shape the given value.
61 jgs 82 */
62 woo409 757 ESCRIPT_DLL_API
63 jgs 82 DataArray(const DataArrayView::ShapeType& shape,
64     double value=0.0);
65    
66     /**
67     \brief
68     Copy constructor for DataArray.
69    
70     Description:
71 jgs 108 Copy constructor for DataArray.
72     Takes a DataArray and performs a deep copy.
73 jgs 82 */
74 woo409 757 ESCRIPT_DLL_API
75 jgs 82 DataArray(const DataArray& value);
76    
77     /**
78     \brief
79     Constructor for DataArray.
80    
81     Description:
82     Constructor for DataArray.
83 jgs 108 Takes a DataArrayView and performs a deep copy.
84 jgs 82 */
85 woo409 757 ESCRIPT_DLL_API
86 jgs 82 DataArray(const DataArrayView& value);
87    
88     /**
89     \brief
90     Constructor for DataArray.
91    
92     Description:
93     Constructor for DataArray.
94     Takes a boost::python::object.
95    
96     Throws:
97 jgs 108 A DataException if a DataArray cannot be created from the python object.
98 jgs 82 */
99 woo409 757 ESCRIPT_DLL_API
100 jgs 82 DataArray(const boost::python::object& value);
101    
102     /**
103     \brief
104     Constructor for DataArray.
105    
106     Description:
107     Constructor for DataArray.
108     Takes a boost::python::numeric::array.
109     */
110 woo409 757 ESCRIPT_DLL_API
111 jgs 82 DataArray(const boost::python::numeric::array& value);
112    
113     /**
114     \brief
115 jgs 108 Return a reference to the DataArrayView.
116 jgs 82 */
117 woo409 757 ESCRIPT_DLL_API
118 jgs 82 const DataArrayView&
119     getView() const;
120    
121 woo409 757 ESCRIPT_DLL_API
122 jgs 82 DataArrayView&
123     getView();
124    
125     /**
126     \brief
127 jgs 108 Return a reference to the the data vector.
128 jgs 82 */
129 woo409 757 ESCRIPT_DLL_API
130 jgs 82 const DataArrayView::ValueType&
131     getData() const;
132    
133 woo409 757 ESCRIPT_DLL_API
134 jgs 82 DataArrayView::ValueType&
135     getData();
136    
137     protected:
138    
139     private:
140    
141     /**
142     \brief
143 jgs 108 Performs initialisation common to DataArray.
144 jgs 82 */
145     void
146     initialise(const boost::python::numeric::array& value);
147    
148     //
149 jgs 108 // data vector
150 jgs 82 DataArrayView::ValueType m_data;
151    
152     //
153 jgs 108 // pointer to view of the data vector
154     // this is a DataArrayView
155 jgs 82 boost::scoped_ptr<DataArrayView> m_dataView;
156    
157     };
158    
159     } // end of namespace
160     #endif

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26