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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1698 - (show annotations)
Tue Aug 12 01:13:16 2008 UTC (11 years, 1 month ago) by jfenwick
File MIME type: text/plain
File size: 1578 byte(s)
Branch commit DO NOT PANIC.

Moved shapeToString and noValues from DataArrayView to 
DataTypes{.h,.cpp}


1
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 // 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
62 } // End DataTypes
63
64
65 } // end of namespace
66
67 #endif

  ViewVC Help
Powered by ViewVC 1.1.26