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

Add random access operator and -= operator to realtuple

parent 051784c7
No related branches found
No related tags found
No related merge requests found
This commit is part of merge request !48. Comments created here will be created in the context of that merge request.
......@@ -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.
Finish editing this message first!
Please register or to comment