Reference documentation for deal.II version 9.6.2
 
\(\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\}}\)
Loading...
Searching...
No Matches
numbers::NumberTraits< std::complex< number > > Struct Template Reference

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

Inheritance diagram for numbers::NumberTraits< std::complex< number > >:

Public Types

using real_type = number
 
using double_type = std::complex<double>
 
using real_type
 
using double_type
 

Static Public Member Functions

static constexpr std::complex< number > conjugate (const std::complex< number > &x)
 
static constexpr real_type abs_square (const std::complex< number > &x)
 
static real_type abs (const std::complex< number > &x)
 
static constexpr const number & conjugate (const number &x)
 
static constexpr real_type abs_square (const number &x)
 
static real_type abs (const number &x)
 

Static Public Attributes

static constexpr bool is_complex = true
 
static constexpr bool is_complex
 

Detailed Description

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

Specialization of the general NumberTraits class that provides the relevant information if the underlying data type is std::complex<T>.

Definition at line 482 of file numbers.h.

Member Typedef Documentation

◆ real_type [1/2]

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

For this data type, alias the corresponding real type. Since this specialization of the template is selected for number types std::complex<T>, the real type is equal to the type used to store the two components of the complex number.

Definition at line 497 of file numbers.h.

◆ double_type [1/2]

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

For this data type, alias the corresponding double type.

Definition at line 502 of file numbers.h.

◆ real_type [2/2]

using numbers::NumberTraits< number >::real_type

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 441 of file numbers.h.

◆ double_type [2/2]

using numbers::NumberTraits< number >::double_type

For this data type, alias the corresponding double type.

Definition at line 446 of file numbers.h.

Member Function Documentation

◆ conjugate() [1/2]

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

Return the complex-conjugate of the given number.

Definition at line 611 of file numbers.h.

◆ abs_square() [1/2]

template<typename number>
NumberTraits< std::complex< number > >::real_type numbers::NumberTraits< std::complex< number > >::abs_square ( const std::complex< number > & x)
staticconstexpr

Return the square of the absolute value of the given number. Since this specialization of the general template is chosen for types equal to std::complex, this function returns the product of a number and its complex conjugate.

Definition at line 635 of file numbers.h.

◆ abs() [1/2]

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

Return the absolute value of a complex number.

Definition at line 620 of file numbers.h.

◆ conjugate() [2/2]

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 device code.

Definition at line 456 of file numbers.h.

◆ abs_square() [2/2]

NumberTraits< number >::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 device code, the same holds true for this function.

Definition at line 467 of file numbers.h.

◆ abs() [2/2]

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

Return the absolute value of a number.

Definition at line 473 of file numbers.h.

Member Data Documentation

◆ is_complex [1/2]

template<typename number>
bool numbers::NumberTraits< std::complex< number > >::is_complex = true
staticconstexpr

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

Definition at line 489 of file numbers.h.

◆ is_complex [2/2]

bool numbers::NumberTraits< number >::is_complex
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 433 of file numbers.h.


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