Reference documentation for deal.II version Git d9b14c2d54 2019-09-14 18:13:29 -0600
\(\newcommand{\dealcoloneq}{\mathrel{\vcenter{:}}=}\)
Public Types | Static Public Member Functions | Static Public Attributes | List of all members
numbers::NumberTraits< std::complex< number > > Struct Template Reference

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

Public Types

using real_type = number
 

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 Public Attributes

static constexpr bool is_complex = true
 

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

Author
Wolfgang Bangerth, 2007

Definition at line 504 of file numbers.h.

Member Typedef Documentation

◆ real_type

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

Member Function Documentation

◆ conjugate()

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

Return the complex-conjugate of the given number.

Definition at line 636 of file numbers.h.

◆ abs_square()

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

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

◆ abs()

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

Member Data Documentation

◆ is_complex

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

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


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