Reference documentation for deal.II version GIT a189bc2bdf 2022-12-07 02:45:02+00:00
\(\newcommand{\dealvcentcolon}{\mathrel{\mathop{:}}}\) \(\newcommand{\dealcoloneq}{\dealvcentcolon\mathrel{\mkern-1.2mu}=}\) \(\newcommand{\jump}[1]{\left[\!\left[ #1 \right]\!\right]}\) \(\newcommand{\average}[1]{\left\{\!\left\{ #1 \right\}\!\right\}}\)
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
numbers::NumberTraits< number > Struct Template Reference

#include <deal.II/base/numbers.h>

Public Types

using real_type = number
 
using double_type = double
 

Public Member Functions

template<typename Dummy >
constexpr std::enable_if_t< std::is_same< Dummy, number >::value &&is_cuda_compatible< Dummy >::value, typename NumberTraits< number >::real_typeabs_square (const number &x)
 
template<typename Dummy >
constexpr std::enable_if_t< std::is_same< Dummy, number >::value &&!is_cuda_compatible< Dummy >::value, typename NumberTraits< number >::real_typeabs_square (const number &x)
 

Static Public Member Functions

static constexpr const number & conjugate (const number &x)
 
template<typename Dummy = number>
static constexpr std::enable_if_t< std::is_same< Dummy, number >::value &&is_cuda_compatible< Dummy >::value, real_typeabs_square (const number &x)
 
template<typename Dummy = number>
static constexpr std::enable_if_t< std::is_same< Dummy, number >::value &&!is_cuda_compatible< Dummy >::value, real_typeabs_square (const number &x)
 
static real_type abs (const number &x)
 

Static Public Attributes

static constexpr bool is_complex = false
 

Detailed Description

template<typename number>
struct numbers::NumberTraits< number >

A structure that, together with its partial specializations NumberTraits<std::complex<number> >, provides traits and member functions that make it possible to write templates that work on both real number types and complex number types. This template is mostly used to implement linear algebra classes such as vectors and matrices that work for both real and complex numbers.

Definition at line 431 of file numbers.h.

Member Typedef Documentation

◆ real_type

template<typename number >
using numbers::NumberTraits< number >::real_type = number

For this data type, alias the corresponding real type. Since the general template is selected for all data types that are not specializations of std::complex<T>, the underlying type must be real- values, so the real_type is equal to the underlying type.

Definition at line 446 of file numbers.h.

◆ double_type

template<typename number >
using numbers::NumberTraits< number >::double_type = double

For this data type, alias the corresponding double type.

Definition at line 451 of file numbers.h.

Member Function Documentation

◆ conjugate()

template<typename number >
constexpr const number & numbers::NumberTraits< number >::conjugate ( const number &  x)
staticconstexpr

Return the complex-conjugate of the given number. Since the general template is selected if number is not a complex data type, this function simply returns the given number.

Note
This function can also be used in CUDA device code.

Definition at line 590 of file numbers.h.

◆ abs_square() [1/4]

template<typename number >
template<typename Dummy = number>
static constexpr std::enable_if_t<std::is_same<Dummy, number>::value && is_cuda_compatible<Dummy>::value, real_type> numbers::NumberTraits< number >::abs_square ( const number &  x)
staticconstexpr

Return the square of the absolute value of the given number. Since the general template is chosen for types not equal to std::complex, this function simply returns the square of the given number.

Note
If the template type can be used in CUDA device code, the same holds true for this function.

◆ abs_square() [2/4]

template<typename number >
template<typename Dummy = number>
static constexpr std::enable_if_t<std::is_same<Dummy, number>::value && !is_cuda_compatible<Dummy>::value, real_type> numbers::NumberTraits< number >::abs_square ( const number &  x)
staticconstexpr

◆ abs()

template<typename number >
NumberTraits< number >::real_type numbers::NumberTraits< number >::abs ( const number &  x)
static

Return the absolute value of a number.

Definition at line 624 of file numbers.h.

◆ abs_square() [3/4]

template<typename number >
template<typename Dummy >
constexpr std::enable_if_t<std::is_same<Dummy, number>::value && is_cuda_compatible<Dummy>::value, typename NumberTraits<number>::real_type> numbers::NumberTraits< number >::abs_square ( const number &  x)
constexpr

Definition at line 603 of file numbers.h.

◆ abs_square() [4/4]

template<typename number >
template<typename Dummy >
constexpr std::enable_if_t<std::is_same<Dummy, number>::value && !is_cuda_compatible<Dummy>::value, typename NumberTraits<number>::real_type> numbers::NumberTraits< number >::abs_square ( const number &  x)
constexpr

Definition at line 615 of file numbers.h.

Member Data Documentation

◆ is_complex

template<typename number >
constexpr bool numbers::NumberTraits< number >::is_complex = false
staticconstexpr

A flag that specifies whether the template type given to this class is complex or real. Since the general template is selected for non-complex types, the answer is false.

Definition at line 438 of file numbers.h.


The documentation for this struct was generated from the following files: