Loading...
Searching...
No Matches
dotproduct.hh File Reference

Provides the functions dot(a,b) := and dotT(a,b) := . More...

`#include "ftraits.hh"`
`#include "typetraits.hh"`

Go to the source code of this file.

## Classes

struct | Dune::IsVector< T, class >
struct | Dune::IsVector< T, std::void_t< typename T::field_type > >

## Namespaces

namespace | Dune
| Dune namespace

## Functions

template<class A, class B>
auto | Dune::dot (const A &a, const B &b) -> typename std::enable_if< IsNumber< A >::value &&!IsVector< A >::value &&!std::is_same< typename FieldTraits< A >::field_type, typename FieldTraits< A >::real_type > ::value, decltype(conj(a) *b)>::type
| computes the dot product for fundamental data types according to Petsc's VectDot function: dot(a,b) := std::conj(a)*b
template<class A, class B>
auto | Dune::dot (const A &a, const B &b) -> typename std::enable_if< IsNumber< A >::value &&!IsVector< A >::value &&std::is_same< typename FieldTraits< A >::field_type, typename FieldTraits< A >::real_type >::value, decltype(a *b)>::type
| computes the dot product for fundamental data types according to Petsc's VectDot function: dot(a,b) := std::conj(a)*b
template<typename A, typename B>
auto | Dune::dot (const A &a, const B &b) -> typename std::enable_if< IsVector< A >::value, decltype(a.dot(b))>::type
| computes the dot product for various dune vector types according to Petsc's VectDot function: dot(a,b) := std::conj(a)*b
template<class A, class B>
auto | Dune::dotT (const A &a, const B &b) -> decltype(a *b)
| Computes an indefinite vector dot product for fundamental data types according to Petsc's VectTDot function: dotT(a,b) := a*b.

## Detailed Description

Provides the functions dot(a,b) := and dotT(a,b) := .

The provided dot products dot,dotT are used to compute (indefinite) dot products for fundamental types as well as DUNE vector types, such as DenseVector, FieldVector, ISTLVector. Note that the definition of dot(a,b) conjugates the first argument. This agrees with the behaviour of Matlab and Petsc, but not with BLAS.

Author
  Jö Fahlke, Matthias Wohlmuth