#include <source/mathops/array/ArrayDataBasicOps.h>
Inheritance diagram for SAMRAI::math::ArrayDataBasicOps< DIM, TYPE >:
Public Member Functions | |
ArrayDataBasicOps () | |
~ArrayDataBasicOps () | |
void | scale (pdat::ArrayData< DIM, TYPE > &dst, const TYPE &alpha, const pdat::ArrayData< DIM, TYPE > &src, const hier::Box< DIM > &box) const |
void | addScalar (pdat::ArrayData< DIM, TYPE > &dst, const pdat::ArrayData< DIM, TYPE > &src, const TYPE &alpha, const hier::Box< DIM > &box) const |
void | add (pdat::ArrayData< DIM, TYPE > &dst, const pdat::ArrayData< DIM, TYPE > &src1, const pdat::ArrayData< DIM, TYPE > &src2, const hier::Box< DIM > &box) const |
void | subtract (pdat::ArrayData< DIM, TYPE > &dst, const pdat::ArrayData< DIM, TYPE > &src1, const pdat::ArrayData< DIM, TYPE > &src2, const hier::Box< DIM > &box) const |
void | multiply (pdat::ArrayData< DIM, TYPE > &dst, const pdat::ArrayData< DIM, TYPE > &src1, const pdat::ArrayData< DIM, TYPE > &src2, const hier::Box< DIM > &box) const |
void | divide (pdat::ArrayData< DIM, TYPE > &dst, const pdat::ArrayData< DIM, TYPE > &src1, const pdat::ArrayData< DIM, TYPE > &src2, const hier::Box< DIM > &box) const |
void | reciprocal (pdat::ArrayData< DIM, TYPE > &dst, const pdat::ArrayData< DIM, TYPE > &src, const hier::Box< DIM > &box) const |
void | linearSum (pdat::ArrayData< DIM, TYPE > &dst, const TYPE &alpha, const pdat::ArrayData< DIM, TYPE > &src1, const TYPE &beta, const pdat::ArrayData< DIM, TYPE > &src2, const hier::Box< DIM > &box) const |
void | axpy (pdat::ArrayData< DIM, TYPE > &dst, const TYPE &alpha, const pdat::ArrayData< DIM, TYPE > &src1, const pdat::ArrayData< DIM, TYPE > &src2, const hier::Box< DIM > &box) const |
void | axmy (pdat::ArrayData< DIM, TYPE > &dst, const TYPE &alpha, const pdat::ArrayData< DIM, TYPE > &src1, const pdat::ArrayData< DIM, TYPE > &src2, const hier::Box< DIM > &box) const |
TYPE | min (const pdat::ArrayData< DIM, TYPE > &data, const hier::Box< DIM > &box) const |
TYPE | max (const pdat::ArrayData< DIM, TYPE > &data, const hier::Box< DIM > &box) const |
void | setRandomValues (pdat::ArrayData< DIM, TYPE > &dst, const TYPE &width, const TYPE &low, const hier::Box< DIM > &box) const |
These operations typically apply only to the numerical standard built-in types, such as double, float, and int, and the complex type (which may or may not be a built-in type depending on the C++ compiler). Thus, this templated class should only be used to instantiate objects with those types as the template parameter. Those operations whose implementations depend of the data type are specialized for each numerical type. To use this class with other standard types or user-defined types (which may or may not make sense), the member functions must be specialized so that the correct operations are performed.
SAMRAI::math::ArrayDataBasicOps< DIM, TYPE >::ArrayDataBasicOps | ( | ) |
Empty constructor and destructor.
SAMRAI::math::ArrayDataBasicOps< DIM, TYPE >::~ArrayDataBasicOps | ( | ) |
void SAMRAI::math::ArrayDataBasicOps< DIM, TYPE >::scale | ( | pdat::ArrayData< DIM, TYPE > & | dst, | |
const TYPE & | alpha, | |||
const pdat::ArrayData< DIM, TYPE > & | src, | |||
const hier::Box< DIM > & | box | |||
) | const |
Set dst = alpha * src, elementwise.
void SAMRAI::math::ArrayDataBasicOps< DIM, TYPE >::addScalar | ( | pdat::ArrayData< DIM, TYPE > & | dst, | |
const pdat::ArrayData< DIM, TYPE > & | src, | |||
const TYPE & | alpha, | |||
const hier::Box< DIM > & | box | |||
) | const |
Set dst = src + alpha, elementwise.
void SAMRAI::math::ArrayDataBasicOps< DIM, TYPE >::add | ( | pdat::ArrayData< DIM, TYPE > & | dst, | |
const pdat::ArrayData< DIM, TYPE > & | src1, | |||
const pdat::ArrayData< DIM, TYPE > & | src2, | |||
const hier::Box< DIM > & | box | |||
) | const |
Set dst = src1 + src2, elementwise.
void SAMRAI::math::ArrayDataBasicOps< DIM, TYPE >::subtract | ( | pdat::ArrayData< DIM, TYPE > & | dst, | |
const pdat::ArrayData< DIM, TYPE > & | src1, | |||
const pdat::ArrayData< DIM, TYPE > & | src2, | |||
const hier::Box< DIM > & | box | |||
) | const |
Set dst = src1 - src2, elementwise.
void SAMRAI::math::ArrayDataBasicOps< DIM, TYPE >::multiply | ( | pdat::ArrayData< DIM, TYPE > & | dst, | |
const pdat::ArrayData< DIM, TYPE > & | src1, | |||
const pdat::ArrayData< DIM, TYPE > & | src2, | |||
const hier::Box< DIM > & | box | |||
) | const |
Set dst = src1 * src2, elementwise.
void SAMRAI::math::ArrayDataBasicOps< DIM, TYPE >::divide | ( | pdat::ArrayData< DIM, TYPE > & | dst, | |
const pdat::ArrayData< DIM, TYPE > & | src1, | |||
const pdat::ArrayData< DIM, TYPE > & | src2, | |||
const hier::Box< DIM > & | box | |||
) | const |
Set dst = src1 / src2, elementwise. No check for division by zero.
void SAMRAI::math::ArrayDataBasicOps< DIM, TYPE >::reciprocal | ( | pdat::ArrayData< DIM, TYPE > & | dst, | |
const pdat::ArrayData< DIM, TYPE > & | src, | |||
const hier::Box< DIM > & | box | |||
) | const |
Set dst = 1 / src, elementwise. No check for division by zero.
void SAMRAI::math::ArrayDataBasicOps< DIM, TYPE >::linearSum | ( | pdat::ArrayData< DIM, TYPE > & | dst, | |
const TYPE & | alpha, | |||
const pdat::ArrayData< DIM, TYPE > & | src1, | |||
const TYPE & | beta, | |||
const pdat::ArrayData< DIM, TYPE > & | src2, | |||
const hier::Box< DIM > & | box | |||
) | const |
Set dst = alpha * src1 + beta * src2, elementwise.
void SAMRAI::math::ArrayDataBasicOps< DIM, TYPE >::axpy | ( | pdat::ArrayData< DIM, TYPE > & | dst, | |
const TYPE & | alpha, | |||
const pdat::ArrayData< DIM, TYPE > & | src1, | |||
const pdat::ArrayData< DIM, TYPE > & | src2, | |||
const hier::Box< DIM > & | box | |||
) | const |
Set dst = alpha * src1 + src2, elementwise.
void SAMRAI::math::ArrayDataBasicOps< DIM, TYPE >::axmy | ( | pdat::ArrayData< DIM, TYPE > & | dst, | |
const TYPE & | alpha, | |||
const pdat::ArrayData< DIM, TYPE > & | src1, | |||
const pdat::ArrayData< DIM, TYPE > & | src2, | |||
const hier::Box< DIM > & | box | |||
) | const |
Set dst = alpha * src1 - src2, elementwise.
TYPE SAMRAI::math::ArrayDataBasicOps< DIM, TYPE >::min | ( | const pdat::ArrayData< DIM, TYPE > & | data, | |
const hier::Box< DIM > & | box | |||
) | const |
Return the minimum array data entry. If data is complex, return the array data entry with the minimum norm.
TYPE SAMRAI::math::ArrayDataBasicOps< DIM, TYPE >::max | ( | const pdat::ArrayData< DIM, TYPE > & | data, | |
const hier::Box< DIM > & | box | |||
) | const |
Return the maximum array data entry. If data is complex, return the array data entry with the maximum norm.
void SAMRAI::math::ArrayDataBasicOps< DIM, TYPE >::setRandomValues | ( | pdat::ArrayData< DIM, TYPE > & | dst, | |
const TYPE & | width, | |||
const TYPE & | low, | |||
const hier::Box< DIM > & | box | |||
) | const |
Set dst to random values. If the data is int, each element of dst is set as dst = mrand48(). If the data is double or float, each element of dst is set as dst = width * drand48() + low. If the data is complex, each element of dst is set as dst = dcomplex(rval, ival), where rval = real(width) * drand48() + real(low), and ival = imag(width) * drand48() + imag(low).