Skip to content
Snippets Groups Projects
Commit 70208025 authored by Lisa Julia Nebel's avatar Lisa Julia Nebel
Browse files

Add random access operator and -= operator to RealTuple

parent a9104ef4
No related branches found
No related tags found
1 merge request!52Enhancements
...@@ -66,6 +66,17 @@ public: ...@@ -66,6 +66,17 @@ public:
return *this; return *this;
} }
RealTuple& operator-=(const Dune::FieldVector<T,N>& other) {
data_ -= other;
return *this;
}
template <class T2>
RealTuple& operator-=(const RealTuple<T2,N>& other) {
data_ -= other.data_;
return *this;
}
/** \brief Assigment from RealTuple with different type -- used for automatic differentiation with ADOL-C */ /** \brief Assigment from RealTuple with different type -- used for automatic differentiation with ADOL-C */
template <class T2> template <class T2>
RealTuple& operator <<= (const RealTuple<T2,N>& other) { RealTuple& operator <<= (const RealTuple<T2,N>& other) {
...@@ -74,6 +85,11 @@ public: ...@@ -74,6 +85,11 @@ public:
return *this; return *this;
} }
/** \brief Const random-access operator*/
T operator[] (const size_t indexVariable ) const {
return data_[indexVariable];
}
/** \brief Rebind the RealTuple to another coordinate type */ /** \brief Rebind the RealTuple to another coordinate type */
template<class U> template<class U>
struct rebind struct rebind
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment