Rheolef
7.1
an efficient C++ finite element environment
pair_with_linear_algebra.h
Go to the documentation of this file.
1
#ifndef PAIR_WITH_LINEAR_ALGEBRA_H
2
#define PAIR_WITH_LINEAR_ALGEBRA_H
3
24
namespace
rheolef
{
namespace
details {
25
26
template
<
class
T1,
class
T2>
27
struct
pair_with_linear_algebra
: std::pair<T1,T2> {
28
typedef
std::pair<T1,T2>
base
;
29
pair_with_linear_algebra
(
const
T1&
f
=T1(),
const
T2& s=T2());
30
pair_with_linear_algebra
(
const
pair_with_linear_algebra<T1,T2>
&);
31
template
<
class
T0>
32
pair_with_linear_algebra<T1,T2>
&
operator*=
(
const
T0& k);
33
};
34
template
<
class
T1,
class
T2>
35
inline
36
pair_with_linear_algebra<T1,T2>::pair_with_linear_algebra
(
const
T1&
f
,
const
T2& s)
37
:
base
(
f
,s)
38
{
39
}
40
template
<
class
T1,
class
T2>
41
inline
42
pair_with_linear_algebra<T1,T2>::pair_with_linear_algebra
(
const
pair_with_linear_algebra<T1,T2>
& x)
43
:
base
(x)
44
{
45
}
46
template
<
class
T1,
class
T2>
47
template
<
class
T0>
48
inline
49
pair_with_linear_algebra<T1, T2>
&
50
pair_with_linear_algebra<T1, T2>::operator*=
(
const
T0& k) {
51
base::first *= k;
52
base::second *= k;
53
return
*
this
;
54
}
55
template
<
class
T1,
class
T2>
56
inline
57
pair_with_linear_algebra<T1, T2>
58
operator-
(
const
pair_with_linear_algebra<T1,T2>
& x) {
59
return
pair_with_linear_algebra<T1,T2>
(-x.first, -x.second);
60
}
61
template
<
class
T0,
class
T1,
class
T2>
62
inline
63
pair_with_linear_algebra<T1, T2>
64
operator*
(
const
T0& k,
const
pair_with_linear_algebra<T1,T2>
& x) {
65
return
pair_with_linear_algebra<T1,T2>
(k*x.first, k*x.second);
66
}
67
template
<
class
T1,
class
T2>
68
inline
69
pair_with_linear_algebra<T1, T2>
70
operator+
(
const
pair_with_linear_algebra<T1,T2>
& x,
const
pair_with_linear_algebra<T1,T2>
& y) {
71
return
pair_with_linear_algebra<T1,T2>
(x.first + y.first, x.second + y.second);
72
}
73
template
<
class
T1,
class
T2>
74
inline
75
pair_with_linear_algebra<T1, T2>
76
operator-
(
const
pair_with_linear_algebra<T1,T2>
& x,
const
pair_with_linear_algebra<T1,T2>
& y) {
77
return
pair_with_linear_algebra<T1,T2>
(x.first - y.first, x.second - y.second);
78
}
79
80
}}
// namespace rheolef::details
81
#endif // PAIR_WITH_LINEAR_ALGEBRA_H
rheolef::details::operator-
pair_with_linear_algebra< T1, T2 > operator-(const pair_with_linear_algebra< T1, T2 > &x, const pair_with_linear_algebra< T1, T2 > &y)
Definition:
pair_with_linear_algebra.h:76
rheolef::details::pair_with_linear_algebra::base
std::pair< T1, T2 > base
Definition:
pair_with_linear_algebra.h:28
rheolef::details::operator+
pair_with_linear_algebra< T1, T2 > operator+(const pair_with_linear_algebra< T1, T2 > &x, const pair_with_linear_algebra< T1, T2 > &y)
Definition:
pair_with_linear_algebra.h:70
operator*
return a operator*(eh)
rheolef
This file is part of Rheolef.
Definition:
compiler_eigen.h:37
rheolef::details::pair_with_linear_algebra::operator*=
pair_with_linear_algebra< T1, T2 > & operator*=(const T0 &k)
Definition:
pair_with_linear_algebra.h:50
rheolef::details::pair_with_linear_algebra
Definition:
pair_with_linear_algebra.h:27
rheolef::details::pair_with_linear_algebra::pair_with_linear_algebra
pair_with_linear_algebra(const T1 &f=T1(), const T2 &s=T2())
Definition:
pair_with_linear_algebra.h:36
f
Definition:
cavity_dg.h:29
rheolef::operator*=
std::enable_if< details::is_rheolef_arithmetic< U >::value,ad3_basic< T > & >::type operator*=(ad3_basic< T > &a, const U &b)
Definition:
ad3.h:367