/[escript]/branches/arrayview_from_1695_trunk/escript/src/DataTypes.h
ViewVC logotype

Annotation of /branches/arrayview_from_1695_trunk/escript/src/DataTypes.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1704 - (hide annotations)
Thu Aug 14 05:35:32 2008 UTC (11 years, 1 month ago) by jfenwick
File MIME type: text/plain
File size: 1686 byte(s)
Branch commit:

DataTagged::addTag() = Add a tag with default value. (All uses that I can find 
apart from test code only require this anyway).

DataAbstract now knows its own shape, rank and number of values and have accessors 
for them.
Data Objects also have acessors for these but query their DataAbstracts for the 
answers.

Data::getDataAtOffset() = access to a particular point in the underlying array. (At 
the moment this call references the DataArrayView, but that will change when I have 
everything else working).

DataTagged::getDataByTag() = same but search by tag.
DataTagged::getDefaultValue() = returns default value without obvious reference to 
DataArrayView


C_GeneralTensorProduct_J  is my temporary copy of C_GeneralTensorProduct for 
experimentation.
It and a number of other temporary functions live in JoelMods.cpp_ for now.


1 jfenwick 1697
2     /* $Id$ */
3    
4     /*******************************************************
5     *
6     * Copyright 2003-2008 by ACceSS MNRF
7     * Copyright 2008 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_DataTypes_20080811_H
17     #define escript_DataTypes_20080811_H
18     #include "system_dep.h"
19     #include "DataVector.h"
20     #include <vector>
21    
22     namespace escript {
23    
24     namespace DataTypes {
25     //
26     // Some basic types which define the data values and view shapes.
27     typedef DataVector ValueType;
28     typedef std::vector<int> ShapeType;
29     typedef std::vector<std::pair<int, int> > RegionType;
30     typedef std::vector<std::pair<int, int> > RegionLoopRangeType;
31     static const int maxRank=4;
32    
33 jfenwick 1698 // This file contains static functions moved from DataArrayView
34     /**
35     \brief
36     Calculate the number of values for the given shape.
37     */
38     ESCRIPT_DLL_API
39     int
40     noValues(const DataTypes::ShapeType& shape);
41    
42     /**
43     \brief
44     Calculate the number of values for the given region.
45     */
46     ESCRIPT_DLL_API
47     int
48     noValues(const DataTypes::RegionLoopRangeType& region);
49    
50     /**
51     \brief
52     Return the given shape as a string.
53    
54     \param shape - Input.
55     */
56     ESCRIPT_DLL_API
57     std::string
58     shapeToString(const DataTypes::ShapeType& shape);
59    
60    
61 jfenwick 1704 ESCRIPT_DLL_API
62     inline
63     int
64     getRank(const DataTypes::ShapeType& shape)
65     {
66     return shape.size();
67     }
68 jfenwick 1698
69 jfenwick 1697 } // End DataTypes
70    
71    
72     } // end of namespace
73    
74     #endif

  ViewVC Help
Powered by ViewVC 1.1.26