Reference documentation for deal.II version 9.2.0
\(\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\}}\)
include
deal.II
base
complex_overloads.h
Go to the documentation of this file.
1
// ---------------------------------------------------------------------
2
//
3
// Copyright (C) 1998 - 2019 by the deal.II authors
4
//
5
// This file is part of the deal.II library.
6
//
7
// The deal.II library is free software; you can use it, redistribute
8
// it, and/or modify it under the terms of the GNU Lesser General
9
// Public License as published by the Free Software Foundation; either
10
// version 2.1 of the License, or (at your option) any later version.
11
// The full text of the license can be found in the file LICENSE.md at
12
// the top level directory of deal.II.
13
//
14
// ---------------------------------------------------------------------
15
16
#ifndef dealii_complex_overloads_h
17
#define dealii_complex_overloads_h
18
19
#include <
deal.II/base/config.h
>
20
21
#include <
deal.II/base/template_constraints.h
>
22
23
DEAL_II_NAMESPACE_OPEN
24
25
// Forward declarations
26
#ifndef DOXYGEN
27
template
<
typename
T,
typename
U>
28
struct
ProductType
;
29
#endif
30
31
#ifndef DEAL_II_HAVE_COMPLEX_OPERATOR_OVERLOADS
32
39
template
<
typename
T,
typename
U>
40
inline
typename
std::enable_if<
41
std::is_floating_point<T>::value
&&
std::is_floating_point<U>::value
,
42
typename
ProductType<std::complex<T>
, std::complex<U>>
::type
>
::type
43
operator*
(
const
std::complex<T> &left,
const
std::complex<U> &right)
44
{
45
using
result_type =
46
typename
ProductType<std::complex<T>
, std::complex<U>>
::type
;
47
return
static_cast<
result_type
>
(left) *
static_cast<
result_type
>
(right);
48
}
49
57
template
<
typename
T,
typename
U>
58
inline
typename
std::enable_if<
59
std::is_floating_point<T>::value
&&
std::is_floating_point<U>::value
,
60
typename
ProductType<std::complex<T>
, std::complex<U>>
::type
>
::type
61
operator/
(
const
std::complex<T> &left,
const
std::complex<U> &right)
62
{
63
using
result_type =
64
typename
ProductType<std::complex<T>
, std::complex<U>>
::type
;
65
return
static_cast<
result_type
>
(left) /
static_cast<
result_type
>
(right);
66
}
67
75
template
<
typename
T,
typename
U>
76
inline
77
typename
std::enable_if<std::is_floating_point<T>::value
&&
78
std::is_floating_point<U>::value
,
79
typename
ProductType<std::complex<T>
,
U
>
::type
>
::type
80
operator*
(
const
std::complex<T> &left,
const
U
&right)
81
{
82
using
result_type =
typename
ProductType<std::complex<T>
,
U
>
::type
;
83
return
static_cast<
result_type
>
(left) *
static_cast<
result_type
>
(right);
84
}
85
93
template
<
typename
T,
typename
U>
94
inline
95
typename
std::enable_if<std::is_floating_point<T>::value
&&
96
std::is_floating_point<U>::value
,
97
typename
ProductType<std::complex<T>
,
U
>
::type
>
::type
98
operator/
(
const
std::complex<T> &left,
const
U
&right)
99
{
100
using
result_type =
typename
ProductType<std::complex<T>
,
U
>
::type
;
101
return
static_cast<
result_type
>
(left) /
static_cast<
result_type
>
(right);
102
}
103
111
template
<
typename
T,
typename
U>
112
inline
typename
113
114
std::enable_if<std::is_floating_point<T>::value
&&
115
std::is_floating_point<U>::value
,
116
typename
ProductType<T, std::complex<U>
>
::type
>
::type
117
operator*
(
const
T
&left,
const
std::complex<U> &right)
118
{
119
using
result_type =
typename
ProductType<T, std::complex<U>
>
::type
;
120
return
static_cast<
result_type
>
(left) *
static_cast<
result_type
>
(right);
121
}
122
130
template
<
typename
T,
typename
U>
131
inline
132
typename
std::enable_if<std::is_floating_point<T>::value
&&
133
std::is_floating_point<U>::value
,
134
typename
ProductType<T, std::complex<U>
>
::type
>
::type
135
operator/
(
const
T
&left,
const
std::complex<U> &right)
136
{
137
using
result_type =
typename
ProductType<T, std::complex<U>
>
::type
;
138
return
static_cast<
result_type
>
(left) /
static_cast<
result_type
>
(right);
139
}
140
#endif
/* DEAL_II_HAVE_COMPLEX_OPERATOR_OVERLOADS */
141
142
DEAL_II_NAMESPACE_CLOSE
143
144
#endif
LAPACKSupport::U
static const char U
Definition:
lapack_support.h:167
ProductType::type
typename internal::ProductTypeImpl< typename std::decay< T >::type, typename std::decay< U >::type >::type type
Definition:
template_constraints.h:426
ProductType
Definition:
template_constraints.h:422
LAPACKSupport::T
static const char T
Definition:
lapack_support.h:163
Point::operator*
Point< dim, typename ProductType< Number, typename EnableIfScalar< OtherNumber >::type >::type > operator*(const OtherNumber) const
DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_OPEN
Definition:
config.h:358
value
static const bool value
Definition:
dof_tools_constraints.cc:433
ProductType::operator/
std::enable_if< std::is_floating_point< T >::value &&std::is_floating_point< U >::value, typename ProductType< std::complex< T >, std::complex< U > >::type >::type operator/(const std::complex< T > &left, const std::complex< U > &right)
Definition:
complex_overloads.h:61
template_constraints.h
config.h
DEAL_II_NAMESPACE_CLOSE
#define DEAL_II_NAMESPACE_CLOSE
Definition:
config.h:359
Generated by
1.8.17