Discontinuous Galerkin Library
#include "dg/algorithm.h"
|
BLAS Level 1 routines. More...
Functions | |
template<class Functor , class ContainerType , class ... ContainerTypes> | |
auto | vdot (Functor f, const ContainerType &x, const ContainerTypes &...xs) -> std::invoke_result_t< Functor, dg::get_value_type< ContainerType >, dg::get_value_type< ContainerTypes >... > |
\( \sum_i f(x_{0i}, x_{1i}, ...)\) Extended Precision transform reduce | |
template<class ContainerType1 , class ContainerType2 > | |
auto | dot (const ContainerType1 &x, const ContainerType2 &y) |
\( x^T y\) Binary reproducible Euclidean dot product between two vectors | |
template<class ContainerType , class OutputType , class BinaryOp , class UnaryOp = IDENTITY> | |
OutputType | reduce (const ContainerType &x, OutputType zero, BinaryOp binary_op, UnaryOp unary_op=UnaryOp()) |
\( f(x_0) \otimes f(x_1) \otimes \dots \otimes f(x_{N-1}) \) Custom (transform) reduction | |
template<class ContainerTypeIn , class ContainerTypeOut > | |
void | copy (const ContainerTypeIn &source, ContainerTypeOut &target) |
\( y=x \) | |
template<class ContainerType , class value_type > | |
void | scal (ContainerType &x, value_type alpha) |
\( x = \alpha x\) | |
template<class ContainerType , class value_type > | |
void | plus (ContainerType &x, value_type alpha) |
\( x = x + \alpha \) | |
template<class ContainerType , class ContainerType1 , class value_type , class value_type1 > | |
void | axpby (value_type alpha, const ContainerType1 &x, value_type1 beta, ContainerType &y) |
\( y = \alpha x + \beta y\) | |
template<class ContainerType , class ContainerType1 , class ContainerType2 , class value_type , class value_type1 , class value_type2 > | |
void | axpbypgz (value_type alpha, const ContainerType1 &x, value_type1 beta, const ContainerType2 &y, value_type2 gamma, ContainerType &z) |
\( z = \alpha x + \beta y + \gamma z\) | |
template<class ContainerType , class ContainerType1 , class ContainerType2 , class value_type , class value_type1 > | |
void | axpby (value_type alpha, const ContainerType1 &x, value_type1 beta, const ContainerType2 &y, ContainerType &z) |
\( z = \alpha x + \beta y\) | |
template<class ContainerType , class ContainerType1 , class ContainerType2 , class value_type , class value_type1 > | |
void | pointwiseDot (value_type alpha, const ContainerType1 &x1, const ContainerType2 &x2, value_type1 beta, ContainerType &y) |
\( y = \alpha x_1 x_2 + \beta y\) | |
template<class ContainerType , class ContainerType1 , class ContainerType2 > | |
void | pointwiseDot (const ContainerType1 &x1, const ContainerType2 &x2, ContainerType &y) |
\( y = x_1 x_2 \) | |
template<class ContainerType , class ContainerType1 , class ContainerType2 , class ContainerType3 , class value_type , class value_type1 > | |
void | pointwiseDot (value_type alpha, const ContainerType1 &x1, const ContainerType2 &x2, const ContainerType3 &x3, value_type1 beta, ContainerType &y) |
\( y = \alpha x_1 x_2 x_3 + \beta y\) | |
template<class ContainerType , class ContainerType1 , class ContainerType2 , class value_type , class value_type1 > | |
void | pointwiseDivide (value_type alpha, const ContainerType1 &x1, const ContainerType2 &x2, value_type1 beta, ContainerType &y) |
\( y = \alpha x_1/ x_2 + \beta y \) | |
template<class ContainerType , class ContainerType1 , class ContainerType2 > | |
void | pointwiseDivide (const ContainerType1 &x1, const ContainerType2 &x2, ContainerType &y) |
\( y = x_1/ x_2\) | |
template<class ContainerType , class ContainerType1 , class ContainerType2 , class ContainerType3 , class ContainerType4 , class value_type , class value_type1 , class value_type2 > | |
void | pointwiseDot (value_type alpha, const ContainerType1 &x1, const ContainerType2 &y1, value_type1 beta, const ContainerType3 &x2, const ContainerType4 &y2, value_type2 gamma, ContainerType &z) |
\( z = \alpha x_1y_1 + \beta x_2y_2 + \gamma z\) | |
template<class ContainerType , class ContainerType1 , class UnaryOp > | |
void | transform (const ContainerType1 &x, ContainerType &y, UnaryOp op) |
\( y = op(x)\) | |
template<class ContainerType , class BinarySubroutine , class Functor , class ContainerType0 , class ... ContainerTypes> | |
void | evaluate (ContainerType &y, BinarySubroutine f, Functor g, const ContainerType0 &x0, const ContainerTypes &...xs) |
\( f(g(x_0,x_1,...), y)\) | |
template<class Subroutine , class ContainerType , class ... ContainerTypes> | |
void | subroutine (Subroutine f, ContainerType &&x, ContainerTypes &&... xs) |
\( f(x_0, x_1, ...)\); Customizable and generic blas1 function | |
template<class ContainerType0 , class BinarySubroutine , class Functor , class ContainerType1 , class ... ContainerTypes> | |
void | kronecker (ContainerType0 &y, BinarySubroutine f, Functor g, const ContainerType1 &x0, const ContainerTypes &...xs) |
\( f(g(x_{0i_0},x_{1i_1},...), y_I)\) (Kronecker evaluation) | |
BLAS Level 1 routines.