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
Branches
No related tags found
No related merge requests found
Pipeline #4746 passed
......@@ -66,6 +66,17 @@ public:
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 */
template <class T2>
RealTuple& operator <<= (const RealTuple<T2,N>& other) {
......@@ -74,6 +85,11 @@ public:
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 */
template<class U>
struct rebind
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment