DataEmpty.h
Go to the documentation of this file.
/*****************************************************************************
*
* Copyright (c) 2003-2017 by The University of Queensland
* http://www.uq.edu.au
*
* Primary Business: Queensland, Australia
* Licensed under the Apache License, version 2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Development until 2012 by Earth Systems Science Computational Center (ESSCC)
* Development 2012-2013 by School of Earth Sciences
* Development from 2014 by Centre for Geoscience Computing (GeoComp)
*
*****************************************************************************/
#ifndef __ESCRIPT_DATAEMPTY_H__
#define __ESCRIPT_DATAEMPTY_H__
#include "system_dep.h"
#include "DataReady.h"
namespace escript {
class DataEmpty : public DataReady {
typedef DataReady parent;
public:
ESCRIPT_DLL_API
DataEmpty();
ESCRIPT_DLL_API
virtual
~DataEmpty();
ESCRIPT_DLL_API
virtual
std::string
toString() const;
ESCRIPT_DLL_API
virtual
DataAbstract*
deepCopy() const;
ESCRIPT_DLL_API
virtual
DataAbstract*
zeroedCopy() const;
ESCRIPT_DLL_API
virtual
DataTypes::RealVectorType::size_type
getPointOffset(int sampleNo,
int dataPointNo) const;
ESCRIPT_DLL_API
virtual
DataTypes::RealVectorType::size_type
getPointOffset(int sampleNo,
int dataPointNo);
ESCRIPT_DLL_API
virtual
DataTypes::RealVectorType::size_type
getLength() const;
ESCRIPT_DLL_API
virtual
DataAbstract*
getSlice(const DataTypes::RegionType& region) const;
ESCRIPT_DLL_API
virtual
void
setSlice(const DataAbstract* value,
const DataTypes::RegionType& region);
ESCRIPT_DLL_API
int
matrixInverse(DataAbstract* out) const;
void
dump(const std::string fileName) const;
ESCRIPT_DLL_API
bool
hasNaN() const
{
return false;
}
ESCRIPT_DLL_API
void
replaceNaN(DataTypes::real_t value)
{
}
ESCRIPT_DLL_API
void
replaceNaN(DataTypes::cplx_t value)
{
}
protected:
ESCRIPT_DLL_API
virtual DataTypes::RealVectorType&
getVectorRW();
ESCRIPT_DLL_API
virtual const DataTypes::RealVectorType&
getVectorRO() const;
ESCRIPT_DLL_API
virtual DataTypes::CplxVectorType&
getVectorRWC();
ESCRIPT_DLL_API
virtual const DataTypes::CplxVectorType&
getVectorROC() const;
virtual DataTypes::RealVectorType&
getTypedVectorRW(DataTypes::real_t dummy);
virtual const DataTypes::RealVectorType&
getTypedVectorRO(DataTypes::real_t dummy) const;
virtual DataTypes::CplxVectorType&
getTypedVectorRW(DataTypes::cplx_t dummy);
virtual const DataTypes::CplxVectorType&
getTypedVectorRO(DataTypes::cplx_t dummy) const;
private:
// /**
/* \brief
Throw a standard exception. This function is called if an attempt
is made to use functions of DataEmpty that are not valid.*/
// */
// void
// throwStandardException(const std::string& functionName) const;
};
} // end of namespace
#endif // __ESCRIPT_DATAEMPTY_H__
escript::DataEmpty::setSlice
virtual void setSlice(const DataAbstract *value, const DataTypes::RegionType &region)
Set the current Data object according to the specified slice from the given input value...
Definition: DataEmpty.cpp:95
escript::DataEmpty::zeroedCopy
virtual DataAbstract * zeroedCopy() const
Return an object with the same type, domain (and tags if appropriate) as this, but all values are zer...
Definition: DataEmpty.cpp:60
escript::DataEmpty::getSlice
virtual DataAbstract * getSlice(const DataTypes::RegionType &region) const
Factory method that returns a newly created DataEmpty sliced from the current Data object according t...
Definition: DataEmpty.cpp:88
escript::DataReady
Definition: DataReady.h:35
escript::DataTypes::DataVectorAlt< real_t >::size_type
DataTypes::vec_size_type size_type
Definition: DataVectorAlt.h:49
escript::DataTypes::RegionType
std::vector< std::pair< int, int > > RegionType
Definition: DataTypes.h:43
escript
Definition: AbstractContinuousDomain.cpp:22
escript::DataEmpty::getVectorRO
virtual const DataTypes::RealVectorType & getVectorRO() const
Definition: DataEmpty.cpp:117
escript::DataEmpty::getTypedVectorRO
virtual const DataTypes::RealVectorType & getTypedVectorRO(DataTypes::real_t dummy) const
Definition: DataEmpty.cpp:147
escript::DataEmpty
Implements the DataAbstract interface for an empty Data object.
Definition: DataEmpty.h:33
escript::DataEmpty::getVectorRW
virtual DataTypes::RealVectorType & getVectorRW()
Provide access to underlying storage. Internal use only!
Definition: DataEmpty.cpp:110
escript::DataEmpty::toString
virtual std::string toString() const
Return a textual representation of the Data object.
Definition: DataEmpty.cpp:47
escript::DataEmpty::replaceNaN
void replaceNaN(DataTypes::real_t value)
replaces all NaN values with value
Definition: DataEmpty.h:161
DataReady.h
escript::DataEmpty::hasNaN
bool hasNaN() const
return true if data contains NaN.
Definition: DataEmpty.h:154
system_dep.h
escript::DataEmpty::~DataEmpty
virtual ~DataEmpty()
Destructor for DataEmpty.
Definition: DataEmpty.cpp:42
escript::DataTypes::DataVectorAlt< real_t >
escript::DataEmpty::replaceNaN
void replaceNaN(DataTypes::cplx_t value)
replaces all NaN values with value
Definition: DataEmpty.h:168
escript::DataEmpty::getVectorRWC
virtual DataTypes::CplxVectorType & getVectorRWC()
Definition: DataEmpty.cpp:125
escript::DataEmpty::matrixInverse
int matrixInverse(DataAbstract *out) const
invert square matricies
Definition: DataEmpty.cpp:102
escript::DataEmpty::getPointOffset
virtual DataTypes::RealVectorType::size_type getPointOffset(int sampleNo, int dataPointNo) const
Return the offset for the given sample. NB: This will throw an exception as obviously an empty Data o...
Definition: DataEmpty.cpp:66
escript::DataTypes::cplx_t
std::complex< real_t > cplx_t
complex data type
Definition: DataTypes.h:53
escript::DataEmpty::getLength
virtual DataTypes::RealVectorType::size_type getLength() const
Return the number of doubles stored for the Data object. As this is an empty Data object...
Definition: DataEmpty.cpp:82
ESCRIPT_DLL_API
#define ESCRIPT_DLL_API
Definition: escriptcore/src/system_dep.h:29
escript::DataAbstract
Definition: DataAbstract.h:61
escript::DataEmpty::dump
void dump(const std::string fileName) const
dumps the object into a netCDF file
Definition: DataEmpty.cpp:171
escript::DataEmpty::parent
DataReady parent
Definition: DataEmpty.h:34
escript::DataEmpty::getTypedVectorRW
virtual DataTypes::RealVectorType & getTypedVectorRW(DataTypes::real_t dummy)
These versions use the type system rather than method name to determine return type.
Definition: DataEmpty.cpp:140
escript::DataEmpty::deepCopy
virtual DataAbstract * deepCopy() const
Return a deep copy of the current object.
Definition: DataEmpty.cpp:54
escript::DataEmpty::getVectorROC
virtual const DataTypes::CplxVectorType & getVectorROC() const
Definition: DataEmpty.cpp:132
escript::DataTypes::real_t
double real_t
type of all real-valued scalars in escript
Definition: DataTypes.h:50
escript::DataEmpty::DataEmpty
DataEmpty()
Default constructor for DataEmpty.
Definition: DataEmpty.cpp:36