diff --git a/vec.cc b/vec.cc index fc121ce..9a38566 100644 --- a/vec.cc +++ b/vec.cc @@ -898,6 +898,13 @@ return -1; } +template +NRVec::NRVec(const std::list l) +{ +resize(l.size()); +int ii=0; +for(typename std::list::const_iterator i=l.begin(); i!=l.end(); ++i) (*this)[ii++] = *i; +} /***************************************************************************//** diff --git a/vec.h b/vec.h index 4debbab..c0450da 100644 --- a/vec.h +++ b/vec.h @@ -21,6 +21,7 @@ #define _LA_VEC_H_ #include "la_traits.h" +#include namespace LA { @@ -140,6 +141,9 @@ public: //! inlined copy constructor inline NRVec(const NRVec &rhs); + //! constructor from std::list + NRVec(const std::list l); + //! complexifying constructor NRVec(const typename LA_traits_complex::NRVec_Noncomplex_type &rhs, bool imagpart=false);//construct complex from real