DataVectorOps.h File Reference

Describes binary operations performed on DataVector. More...

`#include "DataAbstract.h"`
`#include "DataException.h"`
`#include "ArrayOps.h"`
`#include "LapackInverseHelper.h"`
`#include "DataTagged.h"`
`#include <complex>`

Go to the source code of this file.

## Namespaces

| escript

## Macros

#define | OPVECLAZYBODY(X)

## Functions

void | escript::matMult (const DataTypes::RealVectorType &left, const DataTypes::ShapeType &leftShape, DataTypes::RealVectorType::size_type leftOffset, const DataTypes::RealVectorType &right, const DataTypes::ShapeType &rightShape, DataTypes::RealVectorType::size_type rightOffset, DataTypes::RealVectorType &result, const DataTypes::ShapeType &resultShape)
| Perform a matrix multiply of the given views. More...
DataTypes::ShapeType | escript::determineResultShape (const DataTypes::ShapeType &left, const DataTypes::ShapeType &right)
| Determine the shape of the result array for a matrix multiplication of the given views. More...
template<typename VEC >
void | escript::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 More...
template<typename VEC >
void | escript::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 More...
void | escript::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 More...
void | escript::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 More...
template<class VEC >
void | escript::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 More...
template<class VEC >
void | escript::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. More...
template<class VEC >
void | escript::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. More...
void | escript::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 More...

void

escript::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 More...
template<class VEC >
bool | escript::checkOffset (const VEC &data, const DataTypes::ShapeType &shape, typename VEC::size_type offset)
template<class ResVEC , class LVEC , class RSCALAR >
void | escript::binaryOpVectorRightScalar (ResVEC &res, typename ResVEC::size_type resOffset, const typename ResVEC::size_type samplesToProcess, const typename ResVEC::size_type sampleSize, const LVEC &left, typename LVEC::size_type leftOffset, const RSCALAR *right, const bool rightreset, escript::ES_optype operation, bool singleleftsample)
template<>

void

escript::binaryOpVectorRightScalar (DataTypes::RealVectorType &res, typename DataTypes::RealVectorType::size_type resOffset, const typename DataTypes::RealVectorType::size_type samplesToProcess, const typename DataTypes::RealVectorType::size_type sampleSize, const DataTypes::RealVectorType &left, typename DataTypes::RealVectorType::size_type leftOffset, const DataTypes::real_t *right, const bool rightreset, escript::ES_optype operation, bool singleleftsample)

template<class ResVEC , class LSCALAR , class RVEC >
void | escript::binaryOpVectorLeftScalar (ResVEC &res, typename ResVEC::size_type resOffset, const typename ResVEC::size_type samplesToProcess, const typename ResVEC::size_type sampleSize, const LSCALAR *left, const bool leftreset, const RVEC &right, typename RVEC::size_type rightOffset, escript::ES_optype operation, bool singlerightsample)
template<>

void

escript::binaryOpVectorLeftScalar (DataTypes::RealVectorType &res, typename DataTypes::RealVectorType::size_type resOffset, const typename DataTypes::RealVectorType::size_type samplesToProcess, const typename DataTypes::RealVectorType::size_type sampleSize, const DataTypes::real_t *left, const bool leftreset, const DataTypes::RealVectorType &right, typename DataTypes::RealVectorType::size_type rightOffset, escript::ES_optype operation, bool singlerightsample)

template<class ResVEC , class LVEC , class RVEC >
void | escript::binaryOpVector (ResVEC &res, typename ResVEC::size_type resOffset, const typename ResVEC::size_type samplesToProcess, const typename ResVEC::size_type sampleSize, const LVEC &left, typename LVEC::size_type leftOffset, const bool leftreset, const RVEC &right, typename RVEC::size_type rightOffset, const bool rightreset, escript::ES_optype operation)
template<>

void

escript::binaryOpVector (DataTypes::RealVectorType &res, typename DataTypes::RealVectorType::size_type resOffset, const typename DataTypes::RealVectorType::size_type samplesToProcess, const typename DataTypes::RealVectorType::size_type sampleSize, const DataTypes::RealVectorType &left, typename DataTypes::RealVectorType::size_type leftOffset, const bool leftreset, const DataTypes::RealVectorType &right, typename DataTypes::RealVectorType::size_type rightOffset, const bool rightreset, escript::ES_optype operation)

template<class ResELT , class LELT , class RELT >
void | escript::binaryOpVectorLazyArithmeticHelper (ResELT *res, const LELT *left, const RELT *right, const size_t chunksize, const size_t onumsteps, const size_t numsteps, const size_t resultStep, const size_t leftstep, const size_t rightstep, const size_t oleftstep, const size_t orightstep, size_t lroffset, size_t rroffset, escript::ES_optype operation)
template<class ResELT , class LELT , class RELT >
void | escript::binaryOpVectorLazyRelationalHelper (ResELT *res, const LELT *left, const RELT *right, const size_t chunksize, const size_t onumsteps, const size_t numsteps, const size_t resultStep, const size_t leftstep, const size_t rightstep, const size_t oleftstep, const size_t orightstep, size_t lroffset, size_t rroffset, escript::ES_optype operation)
template<class ResVEC , class LVEC , class RVEC >
void | escript::binaryOpVectorTagged (ResVEC &res, const typename ResVEC::size_type samplesToProcess, const typename ResVEC::size_type DPPSample, const typename ResVEC::size_type DPSize, const LVEC &left, bool leftscalar, const RVEC &right, bool rightscalar, bool lefttagged, const DataTagged &tagsource, escript::ES_optype operation)
template<>

void

escript::binaryOpVectorTagged (DataTypes::RealVectorType &res, const typename DataTypes::RealVectorType::size_type samplesToProcess, const typename DataTypes::RealVectorType::size_type DPPSample, const typename DataTypes::RealVectorType::size_type DPSize, const DataTypes::RealVectorType &left, const bool leftscalar, const DataTypes::RealVectorType &right, const bool rightscalar, const bool lefttagged, const DataTagged &tagsource, escript::ES_optype operation)

template<class BinaryFunction >
DataTypes::real_t | escript::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 the view. Reduces all elements of the data point using the given operation, returning the result as a scalar. Operation must be a pointer to a function. More...
int | escript::matrix_inverse (const DataTypes::RealVectorType &in, const DataTypes::ShapeType &inShape, DataTypes::RealVectorType::size_type inOffset, DataTypes::RealVectorType &out, const DataTypes::ShapeType &outShape, DataTypes::RealVectorType::size_type outOffset, int count, LapackInverseHelper &helper)
| computes the inverses of square (up to 3x3) matricies More...
void | escript::matrixInverseError (int err)
| throws an appropriate exception based on failure of matrix_inverse. More...
bool | escript::vectorHasNaN (const DataTypes::RealVectorType &in, DataTypes::RealVectorType::size_type inOffset, size_t count)
| returns true if the vector contains NaN More...

## Detailed Description

Describes binary operations performed on DataVector.

For operations on DataReady see BinaryDataReadyOp.h. For operations on double* see ArrayOps.h.

## Macro Definition Documentation

## OPVECLAZYBODY

#define OPVECLAZYBODY | ( |  | X | ) |

Value:
for (size_t j=0;j<onumsteps;++j)\
{\
for (size_t i=0;i<numsteps;++i,res+=resultStep) \
{ \
for (size_t s=0; s<chunksize; ++s)\
{\
res[s] = X;\
}\
/* tensor_binary_operation< TYPE >(chunksize, &((*left)[lroffset]), &((*right)[rroffset]), resultp, X);*/ \
lroffset+=leftstep; \
rroffset+=rightstep; \
}\
lroffset+=oleftstep;\
rroffset+=orightstep;\
}

Referenced by escript::binaryOpVectorLazyArithmeticHelper(), and escript::binaryOpVectorLazyRelationalHelper().