78 _storage(xbins*ybins),
86 void normalize (uint frames)
89 for (uint i=0; i< _xbins; ++i)
91 for (uint j=0; j< _ybins; ++j)
94 uint norm = get_norm(i,j);
97 set(i,j, val /get_norm(i,j));
100 set(i,j, -999999999.);
108 incr(xbin, ybin,
static_cast<T
>(1.0));
111 void set(
const uint xbin,
const uint ybin,
const T val)
113 uint index= xbin * _ybins + ybin;
114 _storage[index] = val;
117 void incr(
const uint xbin,
const uint ybin,
const T val)
119 uint index= xbin * _ybins + ybin;
120 _storage[index] += val;
124 void get(
const uint xbin,
const uint ybin, T *val)
126 uint index= xbin * _ybins + ybin;
127 *val = _storage[index];
130 const uint get_norm(
const uint xbin,
const uint ybin)
132 uint index= xbin * _ybins + ybin;
133 return(_norm[index]);
136 const std::string print(
const uint xbin,
const uint ybin)
139 get(xbin, ybin, &val);
140 return(boost::lexical_cast<std::string>(val));
144 std::vector<T> _storage;
145 std::vector<uint> _norm;
153 CalcDensity( uint xbins, uint ybins,
double xwidth,
double ywidth) :
154 CalcProperty<double>(xbins, ybins)
156 _bin_area = xwidth * ywidth;
159 void normalize (uint frames)
161 double norm = _bin_area * frames;
163 for (uint i=0; i< this->_xbins; ++i)
165 for (uint j=0; j< this->_ybins; ++j)
167 this->get(i,j, &val);
168 this->set(i, j, val / norm);
181 CalcMolOrder (uint xbins, uint ybins) : CalcProperty<double>(xbins, ybins)
187 std::vector<loos::GCoord> axes = group.principalAxes();
189 double cosine = ave.z() / ave.length();
190 double val = fabs(1.5*cosine*cosine - 0.5);
191 incr(xbin, ybin, val);
217 CalcProperty<loos::GCoord>(xbins, ybins)
223 std::vector<loos::GCoord> axes = group.principalAxes();
229 if (axes[0].z()*centroid.z() > 0)
234 incr(xbin, ybin, axes[0]);
237 const std::string print(
const uint xbin,
const uint ybin)
241 get(xbin, ybin, &tmp);
248 void normalize (uint frames)
252 for (uint i=0; i< _xbins; ++i)
254 for (uint j=0; j< _ybins; ++j)
257 uint norm = get_norm(i,j);
260 set(i,j, val /get_norm(i,j));
274 CalcProperty<loos::GCoord>(xbins, ybins)
283 incr(xbin, ybin, dipole);
286 const std::string print(
const uint xbin,
const uint ybin)
290 get(xbin, ybin, &tmp);
297 void normalize (uint frames)
301 for (uint i=0; i< _xbins; ++i)
303 for (uint j=0; j< _ybins; ++j)
306 uint norm = get_norm(i,j);
309 set(i,j, val /get_norm(i,j));