pair_with_linear_algebra.h
Go to the documentation of this file.
#ifndef PAIR_WITH_LINEAR_ALGEBRA_H
#define PAIR_WITH_LINEAR_ALGEBRA_H
namespace rheolef { namespace details {
template<class T1, class T2>
struct pair_with_linear_algebra: std::pair<T1,T2> {
typedef std::pair<T1,T2> base;
pair_with_linear_algebra (const T1& f=T1(), const T2& s=T2());
pair_with_linear_algebra (const pair_with_linear_algebra<T1,T2>&);
template<class T0>
pair_with_linear_algebra<T1,T2>& operator*= (const T0& k);
};
template<class T1, class T2>
inline
pair_with_linear_algebra<T1,T2>::pair_with_linear_algebra (const T1& f, const T2& s)
: base(f,s)
{
}
template<class T1, class T2>
inline
pair_with_linear_algebra<T1,T2>::pair_with_linear_algebra (const pair_with_linear_algebra<T1,T2>& x)
: base(x)
{
}
template<class T1, class T2>
template<class T0>
inline
pair_with_linear_algebra<T1, T2>&
pair_with_linear_algebra<T1, T2>::operator*= (const T0& k) {
base::first *= k;
base::second *= k;
return *this;
}
template<class T1, class T2>
inline
pair_with_linear_algebra<T1, T2>
operator- (const pair_with_linear_algebra<T1,T2>& x) {
return pair_with_linear_algebra<T1,T2> (-x.first, -x.second);
}
template<class T0, class T1, class T2>
inline
pair_with_linear_algebra<T1, T2>
operator* (const T0& k, const pair_with_linear_algebra<T1,T2>& x) {
return pair_with_linear_algebra<T1,T2> (k*x.first, k*x.second);
}
template<class T1, class T2>
inline
pair_with_linear_algebra<T1, T2>
operator+ (const pair_with_linear_algebra<T1,T2>& x, const pair_with_linear_algebra<T1,T2>& y) {
return pair_with_linear_algebra<T1,T2> (x.first + y.first, x.second + y.second);
}
template<class T1, class T2>
inline
pair_with_linear_algebra<T1, T2>
operator- (const pair_with_linear_algebra<T1,T2>& x, const pair_with_linear_algebra<T1,T2>& y) {
return pair_with_linear_algebra<T1,T2> (x.first - y.first, x.second - y.second);
}
}} // namespace rheolef::details
#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