Functions | |
void | matMult (const DataTypes::ValueType &left, const DataTypes::ShapeType &leftShape, DataTypes::ValueType::size_type leftOffset, const DataTypes::ValueType &right, const DataTypes::ShapeType &rightShape, DataTypes::ValueType::size_type rightOffset, DataTypes::ValueType &result, const DataTypes::ShapeType &resultShape) |
Perform a matrix multiply of the given views. | |
DataTypes::ShapeType | determineResultShape (const DataTypes::ShapeType &left, const DataTypes::ShapeType &right) |
Determine the shape of the result array for a matrix multiplication of the given views. | |
template<class UnaryFunction> | |
void | unaryOp (DataTypes::ValueType &data, const DataTypes::ShapeType &shape, DataTypes::ValueType::size_type offset, UnaryFunction operation) |
Perform the unary operation on the data point specified by the given offset. Applies the specified operation to each value in the data point. Operation must be a pointer to a function. | |
template<class BinaryFunction> | |
void | binaryOp (DataTypes::ValueType &left, const DataTypes::ShapeType &leftShape, DataTypes::ValueType::size_type leftOffset, const DataTypes::ValueType &right, const DataTypes::ShapeType &rightShape, DataTypes::ValueType::size_type rightOffset, BinaryFunction operation) |
Perform the binary operation on the data points specified by the given offsets in the "left" and "right" vectors. Applies the specified operation to corresponding values in both data points. Operation must be a pointer to a function. | |
template<class BinaryFunction> | |
void | binaryOp (DataTypes::ValueType &left, const DataTypes::ShapeType &shape, DataTypes::ValueType::size_type offset, double right, BinaryFunction operation) |
Perform the binary operation on the data point specified by the given offset in the vector using the scalar value "right". Applies the specified operation to values in the data point. Operation must be a pointer to a function. | |
template<class BinaryFunction> | |
double | reductionOp (const DataTypes::ValueType &left, const DataTypes::ShapeType &shape, DataTypes::ValueType::size_type offset, BinaryFunction operation, double 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. | |
void | symmetric (const DataTypes::ValueType &in, const DataTypes::ShapeType &inShape, DataTypes::ValueType::size_type inOffset, DataTypes::ValueType &ev, const DataTypes::ShapeType &evShape, DataTypes::ValueType::size_type evOffset) |
computes a symmetric matrix from your square matrix A: (A + transpose(A)) / 2 | |
void | nonsymmetric (const DataTypes::ValueType &in, const DataTypes::ShapeType &inShape, DataTypes::ValueType::size_type inOffset, DataTypes::ValueType &ev, const DataTypes::ShapeType &evShape, DataTypes::ValueType::size_type evOffset) |
computes a nonsymmetric matrix from your square matrix A: (A - transpose(A)) / 2 | |
void | trace (const DataTypes::ValueType &in, const DataTypes::ShapeType &inShape, DataTypes::ValueType::size_type inOffset, DataTypes::ValueType &ev, const DataTypes::ShapeType &evShape, DataTypes::ValueType::size_type evOffset, int axis_offset) |
computes the trace of a matrix | |
void | transpose (const DataTypes::ValueType &in, const DataTypes::ShapeType &inShape, DataTypes::ValueType::size_type inOffset, DataTypes::ValueType &ev, const DataTypes::ShapeType &evShape, DataTypes::ValueType::size_type evOffset, int axis_offset) |
Transpose each data point of this Data object around the given axis. | |
void | swapaxes (const DataTypes::ValueType &in, const DataTypes::ShapeType &inShape, DataTypes::ValueType::size_type inOffset, DataTypes::ValueType &ev, const DataTypes::ShapeType &evShape, DataTypes::ValueType::size_type evOffset, int axis0, int axis1) |
swaps the components axis0 and axis1. | |
void | eigenvalues (const DataTypes::ValueType &in, const DataTypes::ShapeType &inShape, DataTypes::ValueType::size_type inOffset, DataTypes::ValueType &ev, const DataTypes::ShapeType &evShape, DataTypes::ValueType::size_type evOffset) |
solves a local eigenvalue problem | |
void | eigenvalues_and_eigenvectors (const DataTypes::ValueType &in, const DataTypes::ShapeType &inShape, DataTypes::ValueType::size_type inOffset, DataTypes::ValueType &ev, const DataTypes::ShapeType &evShape, DataTypes::ValueType::size_type evOffset, DataTypes::ValueType &V, const DataTypes::ShapeType &VShape, DataTypes::ValueType::size_type VOffset, const double tol=1.e-13) |
solves a local eigenvalue problem | |
bool | checkOffset (const DataTypes::ValueType &data, const DataTypes::ShapeType &shape, DataTypes::ValueType::size_type offset) |
In order to properly identify the datapoints, in most cases, the vector, shape and offset of the point must all be supplied. Note that vector in this context refers to a data vector storing datapoints not a mathematical vector. (However, datapoints within the data vector could represent scalars, vectors, matricies, ...).
void escript::DataMaths::binaryOp | ( | DataTypes::ValueType & | left, | |
const DataTypes::ShapeType & | shape, | |||
DataTypes::ValueType::size_type | offset, | |||
double | right, | |||
BinaryFunction | operation | |||
) | [inline] |
Perform the binary operation on the data point specified by the given offset in the vector using the scalar value "right". Applies the specified operation to values in the data point. Operation must be a pointer to a function.
Called by escript::binaryOp.
left | - vector containing the datapoints | |
shape | - shape of datapoint in the vector | |
offset | - beginning of datapoint in the vector | |
right | - scalar value for the right hand side of the operation | |
operation | - Input - Operation to apply. Must be a pointer to a function. |
References checkOffset(), EsysAssert, escript::DataTypes::noValues(), and escript::DataVector::size().
Referenced by escript::binaryOp().
void escript::DataMaths::binaryOp | ( | DataTypes::ValueType & | left, | |
const DataTypes::ShapeType & | leftShape, | |||
DataTypes::ValueType::size_type | leftOffset, | |||
const DataTypes::ValueType & | right, | |||
const DataTypes::ShapeType & | rightShape, | |||
DataTypes::ValueType::size_type | rightOffset, | |||
BinaryFunction | operation | |||
) | [inline] |
Perform the binary operation on the data points specified by the given offsets in the "left" and "right" vectors. Applies the specified operation to corresponding values in both data points. Operation must be a pointer to a function.
Called by escript::binaryOp.
left,right | - vectors containing the datapoints | |
leftShape,rightShape | - shapes of datapoints in the vectors | |
leftOffset,rightOffset | - beginnings of datapoints in the vectors | |
operation | - Input - Operation to apply. Must be a pointer to a function. |
References checkOffset(), EsysAssert, escript::DataTypes::noValues(), and escript::DataVector::size().
bool escript::DataMaths::checkOffset | ( | const DataTypes::ValueType & | data, | |
const DataTypes::ShapeType & | shape, | |||
DataTypes::ValueType::size_type | offset | |||
) | [inline] |
Inline function definitions.
References escript::DataTypes::noValues(), and escript::DataVector::size().
Referenced by binaryOp(), reductionOp(), and unaryOp().
DataTypes::ShapeType escript::DataMaths::determineResultShape | ( | const DataTypes::ShapeType & | left, | |
const DataTypes::ShapeType & | right | |||
) |
Determine the shape of the result array for a matrix multiplication of the given views.
left,right | - shapes of the left and right matricies |
References escript::DataTypes::getRank().
void escript::DataMaths::eigenvalues | ( | const DataTypes::ValueType & | in, | |
const DataTypes::ShapeType & | inShape, | |||
DataTypes::ValueType::size_type | inOffset, | |||
DataTypes::ValueType & | ev, | |||
const DataTypes::ShapeType & | evShape, | |||
DataTypes::ValueType::size_type | evOffset | |||
) | [inline] |
solves a local eigenvalue problem
in | - vector containing the input matrix | |
inShape | - shape of the input matrix | |
inOffset | - the beginning of the input matrix within the vector "in" | |
ev | - vector to store the eigenvalues | |
evShape | - expected shape of the eigenvalues | |
evOffset | - starting location for storing the eigenvalues in vector ev |
References escript::eigenvalues1(), escript::eigenvalues2(), escript::eigenvalues3(), and escript::DataTypes::getRelIndex().
Referenced by escript::DataTagged::eigenvalues(), escript::DataExpanded::eigenvalues(), and escript::DataConstant::eigenvalues().
void escript::DataMaths::eigenvalues_and_eigenvectors | ( | const DataTypes::ValueType & | in, | |
const DataTypes::ShapeType & | inShape, | |||
DataTypes::ValueType::size_type | inOffset, | |||
DataTypes::ValueType & | ev, | |||
const DataTypes::ShapeType & | evShape, | |||
DataTypes::ValueType::size_type | evOffset, | |||
DataTypes::ValueType & | V, | |||
const DataTypes::ShapeType & | VShape, | |||
DataTypes::ValueType::size_type | VOffset, | |||
const double | tol = 1.e-13 | |||
) | [inline] |
solves a local eigenvalue problem
in | - vector containing the input matrix | |
inShape | - shape of the input matrix | |
inOffset | - the beginning of the input matrix within the vector "in" | |
ev | - vector to store the eigenvalues | |
evShape | - expected shape of the eigenvalues | |
evOffset | - starting location for storing the eigenvalues in ev | |
V | - vector to store the eigenvectors | |
VShape | - expected shape of the eigenvectors | |
VOffset | - starting location for storing the eigenvectors in V | |
tol | - Input - eigenvalues with relative difference tol are treated as equal |
References escript::eigenvalues_and_eigenvectors1(), escript::eigenvalues_and_eigenvectors2(), escript::eigenvalues_and_eigenvectors3(), and escript::DataTypes::getRelIndex().
Referenced by escript::DataTagged::eigenvalues_and_eigenvectors(), escript::DataExpanded::eigenvalues_and_eigenvectors(), and escript::DataConstant::eigenvalues_and_eigenvectors().
void escript::DataMaths::matMult | ( | const DataTypes::ValueType & | left, | |
const DataTypes::ShapeType & | leftShape, | |||
DataTypes::ValueType::size_type | leftOffset, | |||
const DataTypes::ValueType & | right, | |||
const DataTypes::ShapeType & | rightShape, | |||
DataTypes::ValueType::size_type | rightOffset, | |||
DataTypes::ValueType & | result, | |||
const DataTypes::ShapeType & | resultShape | |||
) |
Perform a matrix multiply of the given views.
NB: Only multiplies together the two given datapoints, would need to call this over all data-points to multiply the entire Data objects involved.
left,right | - vectors containing the datapoints | |
leftShape,rightShape | - shapes of datapoints in the vectors | |
leftOffset,rightOffset | - beginnings of datapoints in the vectors | |
result | - Vector to store the resulting datapoint in | |
resultShape | - expected shape of the resulting datapoint |
References escript::DataTypes::getRank(), and escript::DataTypes::getRelIndex().
void escript::DataMaths::nonsymmetric | ( | const DataTypes::ValueType & | in, | |
const DataTypes::ShapeType & | inShape, | |||
DataTypes::ValueType::size_type | inOffset, | |||
DataTypes::ValueType & | ev, | |||
const DataTypes::ShapeType & | evShape, | |||
DataTypes::ValueType::size_type | evOffset | |||
) | [inline] |
computes a nonsymmetric matrix from your square matrix A: (A - transpose(A)) / 2
in | - vector containing the matrix A | |
inShape | - shape of the matrix A | |
inOffset | - the beginning of A within the vector in | |
ev | - vector to store the output matrix | |
evShape | - expected shape of the output matrix | |
evOffset | - starting location for storing ev in vector ev |
References escript::DataTypes::getRank(), and escript::DataTypes::getRelIndex().
Referenced by escript::DataTagged::nonsymmetric(), escript::DataExpanded::nonsymmetric(), escript::DataConstant::nonsymmetric(), escript::DataLazy::resolveNodeNP1OUT(), and escript::DataLazy::resolveNP1OUT().
double escript::DataMaths::reductionOp | ( | const DataTypes::ValueType & | left, | |
const DataTypes::ShapeType & | shape, | |||
DataTypes::ValueType::size_type | offset, | |||
BinaryFunction | operation, | |||
double | initial_value | |||
) | [inline] |
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.
Called by escript::algorithm.
left | - vector containing the datapoint | |
shape | - shape of datapoints in the vector | |
offset | - beginning of datapoint in the vector | |
operation | - Input - Operation to apply. Must be a pointer to a function. | |
initial_value |
References checkOffset(), EsysAssert, escript::DataTypes::noValues(), and escript::DataVector::size().
Referenced by escript::algorithm(), and escript::dp_algorithm().
void escript::DataMaths::swapaxes | ( | const DataTypes::ValueType & | in, | |
const DataTypes::ShapeType & | inShape, | |||
DataTypes::ValueType::size_type | inOffset, | |||
DataTypes::ValueType & | ev, | |||
const DataTypes::ShapeType & | evShape, | |||
DataTypes::ValueType::size_type | evOffset, | |||
int | axis0, | |||
int | axis1 | |||
) | [inline] |
swaps the components axis0 and axis1.
in | - vector containing the input matrix | |
inShape | - shape of the input matrix | |
inOffset | - the beginning of the input matrix within the vector "in" | |
ev | - vector to store the output matrix | |
evShape | - expected shape of the output matrix | |
evOffset | - starting location for storing the output matrix in vector ev | |
axis0 | - axis index | |
axis1 | - axis index |
References escript::DataTypes::getRank(), and escript::DataTypes::getRelIndex().
Referenced by escript::DataLazy::resolveNodeNP1OUT_2P(), escript::DataLazy::resolveNP1OUT_2P(), escript::DataTagged::swapaxes(), escript::DataExpanded::swapaxes(), and escript::DataConstant::swapaxes().
void escript::DataMaths::symmetric | ( | const DataTypes::ValueType & | in, | |
const DataTypes::ShapeType & | inShape, | |||
DataTypes::ValueType::size_type | inOffset, | |||
DataTypes::ValueType & | ev, | |||
const DataTypes::ShapeType & | evShape, | |||
DataTypes::ValueType::size_type | evOffset | |||
) | [inline] |
computes a symmetric matrix from your square matrix A: (A + transpose(A)) / 2
in | - vector containing the matrix A | |
inShape | - shape of the matrix A | |
inOffset | - the beginning of A within the vector in | |
ev | - vector to store the output matrix | |
evShape | - expected shape of the output matrix | |
evOffset | - starting location for storing ev in vector ev |
References escript::DataTypes::getRank(), and escript::DataTypes::getRelIndex().
Referenced by finley::SystemMatrixAdapter::escriptToPasoOptions(), escript::DataLazy::resolveNodeNP1OUT(), escript::DataLazy::resolveNP1OUT(), escript::DataTagged::symmetric(), escript::DataExpanded::symmetric(), and escript::DataConstant::symmetric().
void escript::DataMaths::trace | ( | const DataTypes::ValueType & | in, | |
const DataTypes::ShapeType & | inShape, | |||
DataTypes::ValueType::size_type | inOffset, | |||
DataTypes::ValueType & | ev, | |||
const DataTypes::ShapeType & | evShape, | |||
DataTypes::ValueType::size_type | evOffset, | |||
int | axis_offset | |||
) | [inline] |
computes the trace of a matrix
in | - vector containing the input matrix | |
inShape | - shape of the input matrix | |
inOffset | - the beginning of the input matrix within the vector "in" | |
ev | - vector to store the output matrix | |
evShape | - expected shape of the output matrix | |
evOffset | - starting location for storing the output matrix in vector ev | |
axis_offset |
References escript::DataTypes::getRank(), escript::DataTypes::getRelIndex(), and escript::DataTypes::noValues().
Referenced by escript::DataLazy::resolveNodeNP1OUT_P(), escript::DataLazy::resolveNP1OUT_P(), escript::DataTagged::trace(), escript::DataExpanded::trace(), and escript::DataConstant::trace().
void escript::DataMaths::transpose | ( | const DataTypes::ValueType & | in, | |
const DataTypes::ShapeType & | inShape, | |||
DataTypes::ValueType::size_type | inOffset, | |||
DataTypes::ValueType & | ev, | |||
const DataTypes::ShapeType & | evShape, | |||
DataTypes::ValueType::size_type | evOffset, | |||
int | axis_offset | |||
) | [inline] |
Transpose each data point of this Data object around the given axis.
in | - vector containing the input matrix | |
inShape | - shape of the input matrix | |
inOffset | - the beginning of the input matrix within the vector "in" | |
ev | - vector to store the output matrix | |
evShape | - expected shape of the output matrix | |
evOffset | - starting location for storing the output matrix in vector ev | |
axis_offset |
References escript::DataTypes::getRank(), and escript::DataTypes::getRelIndex().
Referenced by escript::DataLazy::resolveNodeNP1OUT_P(), escript::DataLazy::resolveNP1OUT_P(), escript::DataTagged::transpose(), escript::DataExpanded::transpose(), and escript::DataConstant::transpose().
void escript::DataMaths::unaryOp | ( | DataTypes::ValueType & | data, | |
const DataTypes::ShapeType & | shape, | |||
DataTypes::ValueType::size_type | offset, | |||
UnaryFunction | operation | |||
) | [inline] |
Perform the unary operation on the data point specified by the given offset. Applies the specified operation to each value in the data point. Operation must be a pointer to a function.
Called by escript::unaryOp.
data | - vector containing the datapoint | |
shape | - shape of the point | |
offset | - offset of the point within data | |
operation | - Input - Operation to apply. Must be a pointer to a function. |
References checkOffset(), EsysAssert, escript::DataTypes::noValues(), and escript::DataVector::size().