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

Contents of /trunk/esys2/escript/src/Data/DataArray.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 82 - (show annotations)
Tue Oct 26 06:53:54 2004 UTC (15 years, 1 month ago) by jgs
File MIME type: text/plain
File size: 3337 byte(s)
Initial revision

1 /*
2 ******************************************************************************
3 * *
4 * COPYRIGHT ACcESS 2004 - All Rights Reserved *
5 * *
6 * This software is the property of ACcESS. No part of this code *
7 * may be copied in any form or by any means without the expressed written *
8 * consent of ACcESS. Copying, use or modification of this software *
9 * by any unauthorised person is illegal unless that person has a software *
10 * license agreement with ACcESS. *
11 * *
12 ******************************************************************************
13 */
14
15 #if !defined escript_DataArray_20040421_H
16 #define escript_DataArray_20040421_H
17
18 #include "DataArrayView.h"
19
20 #include <boost/scoped_ptr.hpp>
21 #include <boost/python/object.hpp>
22
23 namespace escript {
24
25 /**
26 \brief
27 DataArray contains a DataArrayView plus the Vector data associated with the view.
28
29 Description:
30
31 */
32
33 class DataArray {
34
35 public:
36 /**
37 \brief
38 Default constructor for DataArray.
39
40 Description:
41 Default constructor for DataArray. Creates a scalar.
42 */
43 DataArray(double value=0.0);
44
45 /**
46 \brief
47 Constructor for DataArray.
48
49 Description:
50 Constructor for DataArray of shape "shape".
51 Assigns each element the given value.
52 */
53 DataArray(const DataArrayView::ShapeType& shape,
54 double value=0.0);
55
56 /**
57 \brief
58 Copy constructor for DataArray.
59
60 Description:
61 Copy constructor for DataArray. Takes a DataArray.
62 */
63 DataArray(const DataArray& value);
64
65 /**
66 \brief
67 Constructor for DataArray.
68
69 Description:
70 Constructor for DataArray.
71 Takes a DataArrayView.
72 */
73 DataArray(const DataArrayView& value);
74
75 /**
76 \brief
77 Constructor for DataArray.
78
79 Description:
80 Constructor for DataArray.
81 Takes a boost::python::object.
82
83 Throws:
84 A DataException if a DataArray cannot be created from the python object
85 */
86 DataArray(const boost::python::object& value);
87
88 /**
89 \brief
90 Constructor for DataArray.
91
92 Description:
93 Constructor for DataArray.
94 Takes a boost::python::numeric::array.
95 */
96 DataArray(const boost::python::numeric::array& value);
97
98 /**
99 \brief
100 Return the DataArrayView of the data.
101 */
102 const DataArrayView&
103 getView() const;
104
105 /**
106 \brief
107 Return the DataArrayView of the data.
108 Non-const version.
109 */
110 DataArrayView&
111 getView();
112
113 /**
114 \brief
115 Return the data.
116 */
117 const DataArrayView::ValueType&
118 getData() const;
119
120 /**
121 \brief
122 Return the data, non-const version.
123 */
124 DataArrayView::ValueType&
125 getData();
126
127 protected:
128
129 private:
130
131 /**
132 \brief
133 Performs initialisation common of DataArray.
134 */
135 void
136 initialise(const boost::python::numeric::array& value);
137
138 //
139 // data
140 DataArrayView::ValueType m_data;
141
142 //
143 // view of the data
144 boost::scoped_ptr<DataArrayView> m_dataView;
145
146 };
147
148 } // end of namespace
149 #endif

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26