Rheolef  7.2
an efficient C++ finite element environment
 
Loading...
Searching...
No Matches
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
23
24namespace rheolef { namespace details {
25
26template<class T1, class T2>
27struct 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());
31 template<class T0>
33};
34template<class T1, class T2>
35inline
37 : base(f,s)
38{
39}
40template<class T1, class T2>
41inline
46template<class T1, class T2>
47template<class T0>
48inline
51 base::first *= k;
52 base::second *= k;
53 return *this;
54}
55template<class T1, class T2>
56inline
59 return pair_with_linear_algebra<T1,T2> (-x.first, -x.second);
60}
61template<class T0, class T1, class T2>
62inline
63pair_with_linear_algebra<T1, T2>
65 return pair_with_linear_algebra<T1,T2> (k*x.first, k*x.second);
66}
67template<class T1, class T2>
68inline
69pair_with_linear_algebra<T1, T2>
71 return pair_with_linear_algebra<T1,T2> (x.first + y.first, x.second + y.second);
72}
73template<class T1, class T2>
74inline
75pair_with_linear_algebra<T1, T2>
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
pair_with_linear_algebra< T1, T2 > operator*(const T0 &k, const pair_with_linear_algebra< T1, T2 > &x)
pair_with_linear_algebra< T1, T2 > operator-(const pair_with_linear_algebra< T1, T2 > &x)
pair_with_linear_algebra< T1, T2 > operator+(const pair_with_linear_algebra< T1, T2 > &x, const pair_with_linear_algebra< T1, T2 > &y)
This file is part of Rheolef.
Definition cavity_dg.h:29
pair_with_linear_algebra(const pair_with_linear_algebra< T1, T2 > &)
pair_with_linear_algebra(const T1 &f=T1(), const T2 &s=T2())
pair_with_linear_algebra< T1, T2 > & operator*=(const T0 &k)