20 #ifndef __ESCRIPT_DATA_H__
21 #define __ESCRIPT_DATA_H__
34 #include <boost/python/object.hpp>
35 #include <boost/python/tuple.hpp>
36 #include <boost/math/special_functions/bessel.hpp>
38 #ifndef ESCRIPT_MAX_DATA_RANK
39 #define ESCRIPT_MAX_DATA_RANK 4
170 Data(
const boost::python::object& value,
193 Data(boost::python::object value,
194 boost::python::object par1=boost::python::object(),
195 boost::python::object par2=boost::python::object(),
196 boost::python::object par3=boost::python::object());
270 const boost::python::object
271 getValueOfDataPointAsTuple(
int dataPointNo);
278 setValueOfDataPointToPyObject(
int dataPointNo,
const boost::python::object& py_object);
285 setValueOfDataPointToArray(
int dataPointNo,
const boost::python::object&);
301 const boost::python::object
302 getValueOfGlobalDataPointAsTuple(
int procNo,
int dataPointNo);
309 setTupleForGlobalDataPoint(
int id,
int proc, boost::python::object);
317 getTagNumber(
int dpno);
374 replaceNaNPython(boost::python::object obj);
386 replaceInfPython(boost::python::object obj);
413 actsExpanded()
const;
465 return m_data->getFunctionSpace();
489 return getFunctionSpace().getDomain();
503 return getFunctionSpace().getDomainPython();
514 return m_data->getRank();
525 return getNumSamples() * getNumDataPointsPerSample();
535 return m_data->getNumSamples();
546 return m_data->getNumDPPSample();
558 (numDataPointsPerSample==getNumDataPointsPerSample() && numSamples==getNumSamples()));
572 return (getDataPointShape()==givenShape);
582 return m_data->getNoValues();
591 dump(
const std::string fileName)
const;
599 const boost::python::object
600 toListOfTuples(
bool scalarastuple=
true);
656 return m_data->getSampleDataByTag(tag, dummy);
663 return m_data->getSampleDataByTag(tag, dummy);
674 getDataPointRO(
int sampleNo,
int dataPointNo);
683 getDataPointRW(
int sampleNo,
int dataPointNo);
696 return m_data->getPointOffset(sampleNo,dataPointNo);
707 return m_data->getShape();
714 const boost::python::tuple
715 getShapeTuple()
const;
722 getShapeProduct()
const;
731 getDataPointSize()
const;
747 return m_data->getNumSamples()==0;
759 setTaggedValueByName(std::string name,
760 const boost::python::object& value);
772 setTaggedValue(
int tagKey,
773 const boost::python::object& value);
786 setTaggedValueFromCPP(
int tagKey,
793 setTaggedValueFromCPP(
int tagKey,
803 copyWithMask(
const Data& other,
855 nonuniforminterp(boost::python::object in, boost::python::object out,
bool check_boundaries);
858 nonuniformslope(boost::python::object in, boost::python::object out,
bool check_boundaries);
876 boost::python::object
877 integrateToTuple_const()
const;
884 boost::python::object
902 wherePositive()
const;
910 whereNegative()
const;
918 whereNonNegative()
const;
926 whereNonPositive()
const;
1039 const boost::python::tuple
1040 minGlobalDataPoint()
const;
1049 const boost::python::tuple
1050 maxGlobalDataPoint()
const;
1102 trace(
int axis_offset)
const;
1130 const boost::python::tuple
1139 swapaxes(
const int axis0,
const int axis1)
const;
1195 besselFirstKind(
int order);
1203 besselSecondKind(
int order);
1343 powD(
const Data& right)
const;
1353 powO(
const boost::python::object& right)
const;
1364 rpowO(
const boost::python::object& left)
const;
1372 Data& operator+=(
const Data& right);
1373 Data& operator+=(
const boost::python::object& right);
1375 Data& operator=(
const Data& other);
1383 Data& operator-=(
const Data& right);
1384 Data& operator-=(
const boost::python::object& right);
1392 Data& operator*=(
const Data& right);
1393 Data& operator*=(
const boost::python::object& right);
1401 Data& operator/=(
const Data& right);
1402 Data& operator/=(
const boost::python::object& right);
1414 Data truedivO(
const boost::python::object& right);
1420 Data rtruedivO(
const boost::python::object& left);
1426 boost::python::object __add__(
const boost::python::object& right);
1433 boost::python::object __sub__(
const boost::python::object& right);
1439 boost::python::object __rsub__(
const boost::python::object& right);
1445 boost::python::object __mul__(
const boost::python::object& right);
1451 boost::python::object __div__(
const boost::python::object& right);
1457 boost::python::object __rdiv__(
const boost::python::object& right);
1463 matrixInverse()
const;
1470 probeInterpolation(
const FunctionSpace& functionspace)
const;
1488 getItem(
const boost::python::object& key)
const;
1502 setItemD(
const boost::python::object& key,
1506 setItemO(
const boost::python::object& key,
1507 const boost::python::object& value);
1516 template <
class UnaryFunction>
1540 setSlice(
const Data& value,
1557 get_MPIRank(
void)
const;
1566 get_MPISize(
void)
const;
1574 get_MPIComm(
void)
const;
1582 borrowData(
void)
const;
1585 borrowDataPtr(
void)
const;
1588 borrowReadyPtr(
void)
const;
1633 getNumberOfTaggedValues()
const;
1643 void init_from_data_and_fs(
const Data& inData,
1646 template <
typename S>
1648 maskWorker(
Data& other2,
Data& mask2,
S sentinel);
1650 template <
class BinaryOp>
1667 template<
typename Scalar>
1668 boost::python::object
1672 calc_minGlobalDataPoint(
int& ProcNo,
int& DataPointNo)
const;
1675 calc_maxGlobalDataPoint(
int& ProcNo,
int& DataPointNo)
const;
1680 minval_nonlazy()
const;
1684 maxval_nonlazy()
const;
1697 return m_data->operandCheck(*(right.
m_data.get()));
1705 template <
class BinaryFunction>
1708 reduction(BinaryFunction operation,
1718 template <
class BinaryFunction>
1721 dp_algorithm(BinaryFunction operation,
1730 typeMatchLeft(
Data& right)
const;
1738 typeMatchRight(
const Data& right);
1789 ESYS_ASSERT(dr!=0,
"error casting to DataReady.");
1797 ESYS_ASSERT(dr!=0,
"error casting to DataReady.");
1808 DataReady_ptr dr=REFCOUNTNS::dynamic_pointer_cast<DataReady>(m_data);
1809 ESYS_ASSERT(dr.get()!=0,
"error casting to DataReady.");
1817 ESYS_ASSERT(dr.get()!=0,
"error casting to DataReady.");
1837 #ifdef SLOWSHARECHECK
1838 return m_data->isShared();
1840 return !m_data.unique();
1849 if (omp_in_parallel())
1851 throw DataException(
"Please do not call forceResolve() in a parallel region.");
1865 if (omp_in_parallel())
1867 throw DataException(
"Programming error. Please do not run exclusiveWrite() in multi-threaded sections.");
1877 m_data->exclusivewritecalled=
true;
1886 if (isLazy() || isShared())
1888 std::ostringstream oss;
1889 oss <<
"Programming error. ExclusiveWrite required - please call requireWrite() isLazy=" << isLazy() <<
" isShared()=" << isShared();
1907 #ifdef IKNOWWHATIMDOING
1910 template <
typename S>
1917 #ifdef IKNOWWHATIMDOING
1934 long seed,
const boost::python::tuple& filter);
1960 throw DataException(
"Error, attempt to acquire RW access to lazy data. Please call requireWrite() first.");
1963 if (!
getReady()->exclusivewritecalled)
1965 throw DataException(
"Error, call to Data::getSampleDataRW without a preceeding call to requireWrite/exclusiveWrite.");
1977 throw DataException(
"Error, attempt to acquire RW access to lazy data. Please call requireWrite() first.");
1980 if (!
getReady()->exclusivewritecalled)
1982 throw DataException(
"Error, call to Data::getSampleDataRW without a preceeding call to requireWrite/exclusiveWrite.");
1998 return &((*res)[offset]);
2010 throw DataException(
"Programming error: complex lazy objects are not supported.");
2022 throw DataException(
"Programmer error - getDataRO must not be called on Lazy Data.");
2040 throw DataException(
"Programmer error - getDataRO must not be called on Lazy Data.");
2067 Data
operator+(
const Data& left,
const Data& right);
2075 Data
operator-(
const Data& left,
const Data& right);
2083 Data
operator*(
const Data& left,
const Data& right);
2091 Data
operator/(
const Data& left,
const Data& right);
2100 Data
operator+(
const Data& left,
const boost::python::object& right);
2109 Data
operator-(
const Data& left,
const boost::python::object& right);
2118 Data
operator*(
const Data& left,
const boost::python::object& right);
2127 Data
operator/(
const Data& left,
const boost::python::object& right);
2136 Data
operator+(
const boost::python::object& left,
const Data& right);
2145 Data
operator-(
const boost::python::object& left,
const Data& right);
2154 Data
operator*(
const boost::python::object& left,
const Data& right);
2163 Data
operator/(
const boost::python::object& left,
const Data& right);
2172 std::ostream&
operator<<(std::ostream& o,
const Data& data);
2198 return *
this / right;
2236 template <
class BinaryFunction>
2243 ESYS_ASSERT(leftC!=0,
"Programming error - casting to DataExpanded.");
2251 const auto& vec=data.
getTypedVectorRO(
typename BinaryFunction::first_argument_type(0));
2255 #pragma omp parallel private(local_current_value)
2257 local_current_value=initial_value;
2258 #pragma omp for private(i,j) schedule(static)
2259 for (i=0;i<numSamples;i++) {
2260 for (j=0;j<numDPPSample;j++) {
2265 #pragma omp critical
2266 global_current_value=operation(global_current_value,local_current_value);
2268 return global_current_value;
2271 ESYS_ASSERT(leftC!=0,
"Programming error - casting to DataTagged.");
2276 const auto& vec=data.
getTypedVectorRO(
typename BinaryFunction::first_argument_type(0));
2280 for (std::list<int>::const_iterator i=used.begin();i!=used.end();++i)
2283 DataTagged::DataMapType::const_iterator it=lookup.find(
tag);
2284 if ((
tag==0) || (it==lookup.end()))
2293 return current_value;
2296 ESYS_ASSERT(leftC!=0,
"Programming error - casting to DataConstant.");
2299 throw DataException(
"Error - Operations (algorithm) not permitted on instances of DataEmpty.");
2301 throw DataException(
"Error - Operations not permitted on instances of DataLazy.");
2303 throw DataException(
"Error - Data encapsulates an unknown type.");
2315 template <
class BinaryFunction>
2321 throw DataException(
"Error - Operations (dp_algorithm) not permitted on instances of DataEmpty.");
2327 ESYS_ASSERT(dataE!=0,
"Programming error - casting data to DataExpanded.");
2328 ESYS_ASSERT(resultE!=0,
"Programming error - casting result to DataExpanded.");
2342 #pragma omp parallel for private(i,j) schedule(static)
2343 for (i=0;i<numSamples;i++) {
2344 for (j=0;j<numDPPSample;j++) {
2355 ESYS_ASSERT(dataT!=0,
"Programming error - casting data to DataTagged.");
2364 for (DataTagged::DataMapType::const_iterator i=lookup.begin(); i!=lookup.end(); i++) {
2374 return Data(resultT);
2380 ESYS_ASSERT(dataC!=0,
"Programming error - casting data to DataConstant.");
2381 ESYS_ASSERT(resultC!=0,
"Programming error - casting result to DataConstant.");
2390 throw DataException(
"Error - Operations not permitted on instances of DataLazy.");
2392 throw DataException(
"Error - Data encapsulates an unknown type.");
#define ESYS_ASSERT(a, b)
EsysAssert is a MACRO that will throw an exception if the boolean condition specified is false.
Definition: Assert.h:79
Describes binary operations performed on DataVector.
int MPI_Op
Definition: EsysMPI.h:46
int MPI_Comm
Definition: EsysMPI.h:44
#define S(_J_, _I_)
Definition: ShapeFunctions.cpp:122
Definition: DataAbstract.h:63
virtual DataAbstract * deepCopy() const =0
Return a deep copy of the current object.
int getNumDPPSample() const
Return the number of data points per sample.
Definition: DataAbstract.h:612
const DataTypes::ShapeType & getShape() const
Return the shape information for the point data.
Definition: DataAbstract.h:642
int getNumSamples() const
Return the number of samples.
Definition: DataAbstract.h:623
const FunctionSpace & getFunctionSpace() const
Return the function space associated with this Data object.
Definition: DataAbstract.h:635
DataConstant stores a single data point which represents the entire function space.
Definition: DataConstant.h:38
virtual DataTypes::RealVectorType & getTypedVectorRW(DataTypes::real_t dummy)
These versions use the type system rather than method name to determine return type.
Definition: DataConstant.cpp:865
virtual const DataTypes::RealVectorType & getTypedVectorRO(DataTypes::real_t dummy) const
Definition: DataConstant.cpp:872
Definition: DataException.h:28
Give a short description of what DataExpanded does.
Definition: DataExpanded.h:44
virtual DataTypes::RealVectorType::size_type getPointOffset(int sampleNo, int dataPointNo) const
Return the offset for the given given data point. This returns the offset in bytes for the given poin...
Definition: DataExpanded.cpp:622
virtual const DataTypes::RealVectorType & getTypedVectorRO(DataTypes::real_t dummy) const
Definition: DataExpanded.cpp:1532
virtual DataTypes::RealVectorType & getTypedVectorRW(DataTypes::real_t dummy)
These versions use the type system rather than method name to determine return type.
Definition: DataExpanded.cpp:1526
Wraps an expression tree of other DataObjects. The data will be evaluated when required.
Definition: DataLazy.h:49
const DataTypes::RealVectorType * resolveSample(int sampleNo, size_t &roffset) const
Compute the value of the expression for the given sample.
Definition: DataLazy.cpp:2336
Definition: DataReady.h:37
const DataTypes::real_t * getSampleDataRO(DataTypes::RealVectorType::size_type sampleNo, DataTypes::real_t dummy=0) const
Definition: DataReady.h:218
virtual const DataTypes::RealVectorType & getTypedVectorRO(DataTypes::real_t dummy) const =0
DataTypes::real_t * getSampleDataRW(DataTypes::RealVectorType::size_type sampleNo, DataTypes::real_t dummy=0)
Return the sample data for the given sample number.
Definition: DataReady.h:204
Simulates a full dataset accessible via sampleNo and dataPointNo.
Definition: DataTagged.h:46
virtual DataTypes::RealVectorType & getTypedVectorRW(DataTypes::real_t dummy)
These versions use the type system rather than method name to determine return type.
Definition: DataTagged.cpp:1669
DataTypes::RealVectorType::size_type getDefaultOffset() const
Returns the offset in the structure which stores the default value.
Definition: DataTagged.h:724
std::map< int, int > DataMapType
Definition: DataTagged.h:58
DataTypes::RealVectorType::size_type getOffsetForTag(int tag) const
getOffsetForTag
Definition: DataTagged.cpp:995
const DataMapType & getTagLookup() const
getTagLookup
Definition: DataTagged.h:762
DataTypes::RealVectorType::reference getDataByTagRW(int tag, DataTypes::RealVectorType::size_type i, DataTypes::real_t dummy=0)
getDataByTag
Definition: DataTagged.cpp:1017
virtual const DataTypes::RealVectorType & getTypedVectorRO(DataTypes::real_t dummy) const
Definition: DataTagged.cpp:1676
const ElementType & const_reference
Definition: DataVectorAlt.h:52
ElementType & reference
Definition: DataVectorAlt.h:51
DataTypes::vec_size_type size_type
Definition: DataVectorAlt.h:50
Data represents a collection of datapoints.
Definition: Data.h:64
bool m_lazy
Definition: Data.h:1776
friend Data condEvalWorker(escript::Data &mask, escript::Data &trueval, escript::Data &falseval, S sentinel)
bool hasNoSamples() const
Return true if this object contains no samples. This is not the same as isEmpty()
Definition: Data.h:745
Data dp_algorithm(BinaryFunction operation, DataTypes::real_t initial_value) const
Reduce each data-point in this Data object using the given operation. Return a Data object with the s...
Definition: Data.h:2318
Domain_ptr getDomainPython() const
Return the domain. TODO: For internal use only. This should be removed.
Definition: Data.h:501
DataAbstract_ptr m_data
Definition: Data.h:1781
const DataReady * getReady() const
Definition: Data.h:1786
DataTypes::real_t * getSampleDataRW(DataTypes::RealVectorType::size_type sampleNo, DataTypes::real_t dummy=0)
Return the sample data for the given sample no. Please do not use this unless you NEED to access samp...
Definition: Data.h:1956
DataTypes::real_t reduction(BinaryFunction operation, DataTypes::real_t initial_value) const
Perform the specified reduction algorithm on every element of every data point in this Data object ac...
Definition: Data.h:2239
DataTypes::CplxVectorType::const_reference getDataAtOffsetRO(DataTypes::CplxVectorType::size_type i, DataTypes::cplx_t dummy)
const DataTypes::real_t * getSampleDataRO(DataTypes::RealVectorType::size_type sampleNo, DataTypes::real_t dummy=0) const
Return the sample data for the given sample no. Please do not use this unless you NEED to access samp...
Definition: Data.h:1991
void tag()
If possible convert this Data to DataTagged. This will only allow Constant data to be converted to ta...
Definition: Data.cpp:1204
const DataTypes::ShapeType & getDataPointShape() const
Return a reference to the data point shape.
Definition: Data.h:705
bool isDataPointShapeEqual(int rank, const int *dimensions) const
Returns true if the shape matches the vector (dimensions[0],..., dimensions[rank-1])....
Definition: Data.h:567
Data truedivD(const Data &right)
Newer style division operator for python.
Definition: Data.h:2196
DataReady * getReady()
Definition: Data.h:1794
DataTypes::CplxVectorType::reference getDataAtOffsetRW(DataTypes::CplxVectorType::size_type i, DataTypes::cplx_t dummy)
const FunctionSpace & getFunctionSpace() const
Return the function space.
Definition: Data.h:463
void exclusiveWrite()
if another object is sharing out member data make a copy to work with instead. This code should only ...
Definition: Data.h:1862
DataReady_ptr getReadyPtr()
Definition: Data.h:1806
int getNumSamples() const
Return the number of samples.
Definition: Data.h:533
int getNumDataPoints() const
Return the number of data points.
Definition: Data.h:523
boost::python::object integrateWorker() const
int getNoValues() const
Return the number of values in the shape for this object.
Definition: Data.h:580
void checkExclusiveWrite()
checks if caller can have exclusive write to the object
Definition: Data.h:1884
DataTypes::real_t * getSampleDataByTag(int tag, DataTypes::real_t dummy=0)
Return the sample data for the given tag. If an attempt is made to access data that isn't tagged an e...
Definition: Data.h:654
int getNumDataPointsPerSample() const
Return the number of data points per sample.
Definition: Data.h:544
bool isConstant() const
Return true if this Data is constant.
Definition: Data.cpp:1139
void forceResolve()
Definition: Data.h:1844
Data truedivO(const boost::python::object &right)
Newer style division operator for python.
Definition: Data.h:2208
const_Domain_ptr getDomain() const
Return the domain.
Definition: Data.h:487
escript::Data getXFromFunctionSpace() const
Returns the spatial locations of the data points.
Definition: Data.h:474
bool isTagged() const
Return true if this Data is tagged.
Definition: Data.cpp:1125
bool m_protected
Definition: Data.h:1775
bool isExpanded() const
Return true if this Data is expanded.
Definition: Data.cpp:1111
bool isLazy() const
Return true if this Data is lazy.
Definition: Data.cpp:1146
void unaryOp2(UnaryFunction operation)
Perform the given unary operation on every element of every data point in this Data object.
DataTypes::cplx_t * getSampleDataRW(DataTypes::RealVectorType::size_type sampleNo, DataTypes::cplx_t dummy)
bool isEmpty() const
Definition: Data.cpp:1132
unsigned int getDataPointRank() const
Return the rank of the point data.
Definition: Data.h:512
const_DataReady_ptr getReadyPtr() const
Definition: Data.h:1814
DataTypes::real_t lazyAlgWorker(DataTypes::real_t init)
bool numSamplesEqual(int numDataPointsPerSample, int numSamples) const
Returns true if the number of data points per sample and the number of samples match the respective a...
Definition: Data.h:555
Data rtruedivO(const boost::python::object &left)
Newer style division operator for python.
Definition: Data.h:2221
void operandCheck(const Data &right) const
Check *this and the right operand are compatible. Throws an exception if they aren't.
Definition: Data.h:1695
const DataTypes::cplx_t * getSampleDataRO(DataTypes::CplxVectorType::size_type sampleNo, DataTypes::cplx_t dummy) const
bool isShared() const
Definition: Data.h:1835
Data()
Default constructor. Creates a DataEmpty object.
Definition: Data.cpp:246
friend Data randomData(const boost::python::tuple &shape, const FunctionSpace &what, long seed, const boost::python::tuple &filter)
Create a new Expanded Data object filled with pseudo-random data.
DataTypes::RealVectorType::size_type getDataOffset(int sampleNo, int dataPointNo)
Return the offset for the given sample and point within the sample.
Definition: Data.h:693
const DataTypes::real_t * getDataRO(DataTypes::real_t dummy=0) const
Return a pointer to the beginning of the underlying data.
Definition: Data.h:2018
DataTypes::cplx_t * getSampleDataByTag(int tag, DataTypes::cplx_t dummy)
Definition: Data.h:661
Definition: FunctionSpace.h:36
escript::Data getX() const
Returns the spatial locations of the data points.
Definition: FunctionSpace.cpp:229
std::list< int > getListOfTagsSTL() const
Returns an stl list of the tags used in this function space.
Definition: FunctionSpace.cpp:335
(Testing use only) Provides a domain to wrap a collection of values.
Definition: TestDomain.h:43
Definition: WrappedArray.h:33
#define ESCRIPT_DLL_API
Definition: escriptcore/src/system_dep.h:30
std::complex< real_t > cplx_t
complex data type
Definition: DataTypes.h:55
std::vector< std::pair< int, int > > RegionType
Definition: DataTypes.h:45
double real_t
type of all real-valued scalars in escript
Definition: DataTypes.h:52
static const ShapeType scalarShape
Use this instead of creating empty shape objects for scalars.
Definition: DataTypes.h:48
std::vector< int > ShapeType
The shape of a single datapoint.
Definition: DataTypes.h:44
Definition: AbstractContinuousDomain.cpp:23
std::ostream & operator<<(std::ostream &o, const Data &data)
Output operator.
Definition: Data.cpp:3679
DataTypes::real_t reductionOpVector(const DataTypes::RealVectorType &left, const DataTypes::ShapeType &leftShape, DataTypes::RealVectorType::size_type offset, BinaryFunction operation, DataTypes::real_t initial_value)
Perform the given data point reduction operation on the data point specified by the given offset into...
Definition: DataVectorOps.h:1397
void eigenvalues_and_eigenvectors(const DataTypes::RealVectorType &in, const DataTypes::ShapeType &inShape, DataTypes::RealVectorType::size_type inOffset, DataTypes::RealVectorType &ev, const DataTypes::ShapeType &evShape, DataTypes::RealVectorType::size_type evOffset, DataTypes::RealVectorType &V, const DataTypes::ShapeType &VShape, DataTypes::RealVectorType::size_type VOffset, const double tol=1.e-13)
solves a local eigenvalue problem
Definition: DataVectorOps.h:750
Data C_GeneralTensorProduct(Data &arg_0, Data &arg_1, int axis_offset=0, int transpose=0)
Compute a tensor product of two Data objects.
Definition: Data.cpp:3686
Data operator*(const AbstractSystemMatrix &left, const Data &right)
Definition: AbstractSystemMatrix.cpp:60
void eigenvalues(const DataTypes::RealVectorType &in, const DataTypes::ShapeType &inShape, typename DataTypes::RealVectorType::size_type inOffset, DataTypes::RealVectorType &ev, const DataTypes::ShapeType &evShape, typename DataTypes::RealVectorType::size_type evOffset)
solves a local eigenvalue problem
Definition: DataVectorOps.h:639
boost::shared_ptr< const DataReady > const_DataReady_ptr
Definition: DataAbstract.h:60
void symmetric(const VEC &in, const DataTypes::ShapeType &inShape, typename VEC::size_type inOffset, VEC &ev, const DataTypes::ShapeType &evShape, typename VEC::size_type evOffset)
computes a symmetric matrix from your square matrix A: (A + transpose(A)) / 2
Definition: DataVectorOps.h:103
boost::shared_ptr< DataAbstract > DataAbstract_ptr
Definition: DataAbstract.h:52
void swapaxes(const VEC &in, const DataTypes::ShapeType &inShape, typename VEC::size_type inOffset, VEC &ev, const DataTypes::ShapeType &evShape, typename VEC::size_type evOffset, int axis0, int axis1)
swaps the components axis0 and axis1.
Definition: DataVectorOps.h:488
T1 conjugate(const T2 i)
Definition: ArrayOps.h:734
boost::shared_ptr< const AbstractDomain > const_Domain_ptr
Definition: AbstractDomain.h:44
void transpose(const VEC &in, const DataTypes::ShapeType &inShape, typename VEC::size_type inOffset, VEC &ev, const DataTypes::ShapeType &evShape, typename VEC::size_type evOffset, int axis_offset)
Transpose each data point of this Data object around the given axis.
Definition: DataVectorOps.h:343
Data operator/(const Data &left, const Data &right)
Operator/ Takes two Data objects.
Definition: Data.cpp:3374
Data condEval(escript::Data &mask, escript::Data &trueval, escript::Data &falseval)
Definition: Data.cpp:5644
void antisymmetric(const VEC &in, const DataTypes::ShapeType &inShape, typename VEC::size_type inOffset, VEC &ev, const DataTypes::ShapeType &evShape, typename VEC::size_type evOffset)
computes a antisymmetric matrix from your square matrix A: (A - transpose(A)) / 2
Definition: DataVectorOps.h:152
Data operator-(const Data &left, const Data &right)
Operator- Takes two Data objects.
Definition: Data.cpp:3355
DataTypes::real_t rpow(DataTypes::real_t x, DataTypes::real_t y)
Definition: Data.h:2056
Data randomData(const boost::python::tuple &shape, const FunctionSpace &what, long seed, const boost::python::tuple &filter)
Create a new Expanded Data object filled with pseudo-random data.
Definition: Data.cpp:5868
void antihermitian(const DataTypes::CplxVectorType &in, const DataTypes::ShapeType &inShape, typename DataTypes::CplxVectorType::size_type inOffset, DataTypes::CplxVectorType &ev, const DataTypes::ShapeType &evShape, typename DataTypes::CplxVectorType::size_type evOffset)
computes a antihermitian matrix from your square matrix A: (A - adjoint(A)) / 2
Definition: DataVectorOps.cpp:963
Data C_TensorBinaryOperation(Data const &arg_0, Data const &arg_1, ES_optype operation)
Compute a tensor operation with two Data objects.
Definition: Data.cpp:6351
boost::shared_ptr< AbstractDomain > Domain_ptr
Definition: AbstractDomain.h:41
Data operator+(const Data &left, const Data &right)
Operator+ Takes two Data objects.
Definition: Data.cpp:3345
ES_optype
Definition: ES_optype.h:30
void trace(const VEC &in, const DataTypes::ShapeType &inShape, typename VEC::size_type inOffset, VEC &ev, const DataTypes::ShapeType &evShape, typename VEC::size_type evOffset, int axis_offset)
computes the trace of a matrix
Definition: DataVectorOps.h:242
Data C_TensorUnaryOperation(Data const &arg_0, escript::ES_optype operation, DataTypes::real_t tol=0)
Definition: Data.cpp:6075
void hermitian(const DataTypes::CplxVectorType &in, const DataTypes::ShapeType &inShape, DataTypes::CplxVectorType::size_type inOffset, DataTypes::CplxVectorType &ev, const DataTypes::ShapeType &evShape, DataTypes::CplxVectorType::size_type evOffset)
computes an hermitian matrix from your square matrix A: (A + adjoint(A)) / 2
Definition: DataVectorOps.cpp:916
boost::shared_ptr< DataReady > DataReady_ptr
Definition: DataAbstract.h:57
void copy(dim_t N, double *out, const double *in)
out = in
Definition: PasoUtil.h:88