/[escript]/trunk/escript/src/DataEmpty.cpp
ViewVC logotype

Contents of /trunk/escript/src/DataEmpty.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 854 - (show annotations)
Thu Sep 21 05:29:42 2006 UTC (13 years ago) by gross
File size: 1755 byte(s)
Some modifications to the binary operations +,-,*/, pow. 
The code is a bit simpler now and more efficient has there is
no reseising required now. the resizing method has been removed as
it is very, very inefficient. Even serial code should be faster now.
It is now forbidden to do an inplace update of scalar data object with an object 
of rank >0 as this is very slow (and does not make much sense). 


1 //$Id$
2
3 /*
4 ************************************************************
5 * Copyright 2006 by ACcESS MNRF *
6 * *
7 * http://www.access.edu.au *
8 * Primary Business: Queensland, Australia *
9 * Licensed under the Open Software License version 3.0 *
10 * http://www.opensource.org/licenses/osl-3.0.php *
11 * *
12 ************************************************************
13 */
14
15 #include "DataEmpty.h"
16 #include "DataException.h"
17
18 namespace escript {
19
20 DataEmpty::DataEmpty() :
21 DataAbstract(FunctionSpace())
22 {
23 resetPointDataView();
24 }
25
26 DataEmpty::~DataEmpty()
27 {
28 }
29
30 std::string
31 DataEmpty::toString() const
32 {
33 return "(Empty Data)";
34 }
35
36 DataArrayView::ValueType::size_type
37 DataEmpty::getPointOffset(int sampleNo,
38 int dataPointNo) const
39 {
40 throwStandardException("getPointOffset");
41 return 0;
42 }
43
44 DataArrayView
45 DataEmpty::getDataPoint(int sampleNo,
46 int dataPointNo)
47 {
48 throwStandardException("getDataPoint");
49 return getPointDataView();
50 }
51
52 DataArrayView::ValueType::size_type
53 DataEmpty::getLength() const
54 {
55 return 0;
56 }
57
58 DataAbstract*
59 DataEmpty::getSlice(const DataArrayView::RegionType& region) const
60 {
61 throwStandardException("getSlice");
62 return 0;
63 }
64
65 void
66 DataEmpty::setSlice(const DataAbstract* value,
67 const DataArrayView::RegionType& region)
68 {
69 throwStandardException("setSlice");
70 }
71
72 void
73 DataEmpty::throwStandardException(const std::string& functionName) const
74 {
75 throw DataException("Error - "+functionName+" function call invalid for DataEmpty.");
76 }
77
78 } // end of namespace

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26