88 |
|
}; |
89 |
|
|
90 |
|
DataStorage(); |
91 |
< |
DataStorage(int size, int storageLayout = 0); |
91 |
> |
DataStorage(std::size_t size, int storageLayout = 0); |
92 |
|
/** return the size of this DataStorage. */ |
93 |
< |
int getSize(); |
93 |
> |
std::size_t getSize(); |
94 |
|
/** |
95 |
|
* Changes the size of this DataStorage. |
96 |
|
* @param newSize new size of this DataStorage |
97 |
|
*/ |
98 |
< |
void resize(int newSize); |
98 |
> |
void resize(std::size_t newSize); |
99 |
|
/** |
100 |
|
* Reallocates memory manually. |
101 |
|
* |
104 |
|
* then it is usually more efficient to allocate that memory all |
105 |
|
* at once. |
106 |
|
*/ |
107 |
< |
void reserve(int size); |
107 |
> |
void reserve(std::size_t size); |
108 |
|
/** |
109 |
|
* Copies data inside DataStorage class. |
110 |
|
* |
116 |
|
* @param num number of element to be moved |
117 |
|
* @param target |
118 |
|
*/ |
119 |
< |
void copy(int source, int num, int target); |
119 |
> |
void copy(int source, std::size_t num, std::size_t target); |
120 |
|
/** Returns the storage layout */ |
121 |
|
int getStorageLayout(); |
122 |
|
/** Sets the storage layout */ |
143 |
|
vector<RealType> flucQFrc; /** fluctuating charge forces */ |
144 |
|
vector<RealType> sitePotential; /** electrostatic site potentials */ |
145 |
|
|
146 |
< |
static int getBytesPerStuntDouble(int layout); |
146 |
> |
static std::size_t getBytesPerStuntDouble(int layout); |
147 |
|
|
148 |
|
private: |
149 |
|
|
152 |
|
RealType* internalGetArrayPointer(vector<RealType>& v); |
153 |
|
|
154 |
|
template<typename T> |
155 |
< |
void internalResize(std::vector<T>& v, int newSize); |
155 |
> |
void internalResize(std::vector<T>& v, std::size_t newSize); |
156 |
|
|
157 |
|
template<typename T> |
158 |
< |
void internalCopy(std::vector<T>& v, int source, int num, int target); |
158 |
> |
void internalCopy(std::vector<T>& v, int source, std::size_t num, std::size_t target); |
159 |
|
|
160 |
< |
int size_; |
160 |
> |
std::size_t size_; |
161 |
|
int storageLayout_; |
162 |
|
|
163 |
|
}; |