Skip to content
Snippets Groups Projects
Commit ca117536 authored by Christian Engwer's avatar Christian Engwer
Browse files

add assignment from arbitrary densevector implementation, this include

FieldVector< complex<T> > = FieldVector<T>

[[Imported from SVN: r6324]]
parent 78e8238d
Branches
Tags
No related merge requests found
......@@ -78,6 +78,15 @@ namespace Dune {
FieldVector (const FieldVector & x) : _data(x._data)
{}
//! Constructor making vector with identical coordinates
template<class C>
FieldVector (const DenseVector<C> & x)
{
assert(x.size() == SIZE);
for (size_type i = 0; i<SIZE; i++)
_data[i] = x[i];
}
using Base::operator=;
// make this thing a vector
......@@ -151,6 +160,14 @@ namespace Dune {
/** \brief Constructor with a given scalar */
FieldVector (const K& k) : _data(k) {}
//! Constructor making vector with identical coordinates
template<class C>
FieldVector (const DenseVector<C> & x)
{
assert(x.size() == 1);
_data = x[0];
}
//! Assignment operator for scalar
inline FieldVector& operator= (const K& k)
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment