Morpheus 1.0.0
Dynamic matrix type and algorithms for sparse matrices
All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Modules Pages
Functions
DenseVector Algorithms

Algorithms for the DenseVector container. More...

Collaboration diagram for DenseVector Algorithms:

Functions

template<typename ExecSpace , typename Vector1 , typename Vector2 >
Vector2::value_type Morpheus::dot (typename Vector1::size_type n, const Vector1 &x, const Vector2 &y)
 Computes the dot product of two vectors. More...
 
template<typename ExecSpace , typename Vector >
Vector::value_type Morpheus::reduce (const Vector &in, typename Vector::size_type size)
 Performs a sum reduction on the contents of a vector. More...
 
template<typename ExecSpace , typename Vector1 , typename Vector2 , typename Vector3 >
void Morpheus::waxpby (const size_t n, const typename Vector1::value_type alpha, const Vector1 &x, const typename Vector2::value_type beta, const Vector2 &y, Vector3 &w)
 Computes the update of a vector with the sum of two scaled vectors where: w = alpha*x + beta*y. More...
 

Detailed Description

Algorithms for the DenseVector container.

Function Documentation

◆ dot()

template<typename ExecSpace , typename Vector1 , typename Vector2 >
Vector2::value_type Morpheus::dot ( typename Vector1::size_type  n,
const Vector1 &  x,
const Vector2 &  y 
)
inline

Computes the dot product of two vectors.

Template Parameters
ExecSpaceExecution space to run the algorithm
Vector1Type of vector x
Vector2Type of vector y
Parameters
nThe number of vector elements to run the operation for
xThe first input vector
yThe second input vector
Returns
Vector2::value_type Scalar value of the result

◆ reduce()

template<typename ExecSpace , typename Vector >
Vector::value_type Morpheus::reduce ( const Vector &  in,
typename Vector::size_type  size 
)

Performs a sum reduction on the contents of a vector.

Template Parameters
ExecSpaceExecution space to run the algorithm
VectorType of input vector
Parameters
inThe input vector
sizeThe number of vector elements to run the operation for
Returns
Vector::value_type Scalar value of the result

◆ waxpby()

template<typename ExecSpace , typename Vector1 , typename Vector2 , typename Vector3 >
void Morpheus::waxpby ( const size_t  n,
const typename Vector1::value_type  alpha,
const Vector1 &  x,
const typename Vector2::value_type  beta,
const Vector2 &  y,
Vector3 &  w 
)
inline

Computes the update of a vector with the sum of two scaled vectors where: w = alpha*x + beta*y.

Template Parameters
ExecSpaceExecution space to run the algorithm
Vector1Type of vector x
Vector2Type of vector y
Vector3Type of vector w
Parameters
nThe number of vector elements to run the operation for
alphaScalar applied to x
xThe first input vector
betaScalar applied to y
yThe second input vector
wThe output vector