1 #ifndef _PVFMM_VECTOR_HPP_ 2 #define _PVFMM_VECTOR_HPP_ 4 #include <pvfmm/common.hpp> 12 template <
class ValueType>
class Vector {
15 typedef ValueType ValType;
19 Vector(Long dim_, Iterator<ValueType> data_ = Iterator<ValueType>(NULL),
bool own_data_ =
true);
21 Vector(
const Vector& V);
23 Vector(
const std::vector<ValueType>& V);
27 void Swap(Vector<ValueType>& v1);
29 void ReInit(Long dim_, Iterator<ValueType> data_ = NULL,
bool own_data_ =
true);
31 void Write(
const char* fname)
const;
33 void Read(
const char* fname);
37 Long Capacity()
const;
41 Iterator<ValueType> Begin();
43 ConstIterator<ValueType> Begin()
const;
45 void PushBack(
const ValueType& x);
47 Vector& operator=(
const Vector& V);
49 Vector& operator=(
const std::vector<ValueType>& V);
51 ValueType& operator[](Long j);
53 const ValueType& operator[](Long j)
const;
58 Iterator<ValueType> data_ptr;
62 template <
class ValueType> std::ostream& operator<<(std::ostream& output, const Vector<ValueType>& V);
66 #include <pvfmm/vector.txx> 68 #endif //_PVFMM_VECTOR_HPP_ Definition: cheb_utils.hpp:12