#ifndef _PVFMM_VECTOR_HPP_ #define _PVFMM_VECTOR_HPP_ #include #include #include #include namespace pvfmm { template class Vector { public: typedef ValueType ValType; Vector(); Vector(Long dim_, Iterator data_ = Iterator(NULL), bool own_data_ = true); Vector(const Vector& V); Vector(const std::vector& V); ~Vector(); void Swap(Vector& v1); void ReInit(Long dim_, Iterator data_ = NULL, bool own_data_ = true); void Write(const char* fname) const; Long Dim() const; Long Capacity() const; void SetZero(); Iterator Begin(); ConstIterator Begin() const; void PushBack(const ValueType& x); Vector& operator=(const Vector& V); Vector& operator=(const std::vector& V); ValueType& operator[](Long j); const ValueType& operator[](Long j) const; private: Long dim; Long capacity; Iterator data_ptr; bool own_data; }; template std::ostream& operator<<(std::ostream& output, const Vector& V); } // end namespace #include #endif //_PVFMM_VECTOR_HPP_