Skip to content
Snippets Groups Projects
Commit 69828eec authored by Oliver Sander's avatar Oliver Sander Committed by sander
Browse files

Implement operator<<= and method 'rebind'

[[Imported from SVN: r9448]]
parent 253892c9
No related branches found
No related tags found
No related merge requests found
......@@ -60,6 +60,9 @@ class UnitVector
}
}
template <class T2, int N2>
friend class UnitVector;
public:
/** \brief The type used for coordinates */
......@@ -101,6 +104,23 @@ public:
data_ /= data_.two_norm();
}
/** \brief Assigment from UnitVector with different type -- used for automatic differentiation with ADOL-C */
template <class T2>
UnitVector& operator <<= (const UnitVector<T2,N>& other) {
for (int i=0; i<N; i++)
data_[i] <<= other.data_[i];
return *this;
}
/** \brief Rebind the UnitVector to another coordinate type */
template<class U>
struct rebind
{
typedef UnitVector<U,N> other;
};
UnitVector<T,N>& operator=(const Dune::FieldVector<T,N>& vector)
{
data_ = vector;
......
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