Counter sum;
Counter squares;
Counter samples;
-
- bool fancy;
};
class DistInfoBase : public Info
Counter bucket_size;
/** The number of buckets. Equal to (max-min)/bucket_size. */
size_type buckets;
+
+ enum { fancy = false };
};
- enum { fancy = false };
private:
/** The minimum value to track. */
class FancyStor
{
public:
- struct Params : public StorageParams {};
-
- public:
- enum { fancy = true };
+ struct Params : public StorageParams
+ {
+ enum { fancy = true };
+ };
private:
/** The current sum. */
class AvgFancy
{
public:
- struct Params : public StorageParams {};
-
- public:
- enum { fancy = true };
+ struct Params : public StorageParams
+ {
+ enum { fancy = true };
+ };
private:
/** Current total. */
void
update(DistInfoBase *base)
{
- base->data.fancy = Storage::fancy;
data()->update(info(), base->data);
}
size_type size = this->size();
base->data.resize(size);
for (off_type i = 0; i < size; ++i) {
- base->data[i].fancy = Storage::fancy;
data(i)->update(info(), base->data[i]);
}
}
if (!configure(info, "DIST"))
return;
- if (!info.data.fancy) {
- const Params *params = safe_cast<const Params *>(info.storageParams);
+ const Params *params = safe_cast<const Params *>(info.storageParams);
+ if (!params->fancy) {
stat.size = params->buckets;
stat.min = params->min;
stat.max = params->max;
if (!configure(info, "VECTORDIST"))
return;
- if (!info.data[0].fancy) {
- const Params *params = safe_cast<const Params *>(info.storageParams);
+ const Params *params = safe_cast<const Params *>(info.storageParams);
+ if (!params->fancy) {
stat.size = params->buckets;
stat.min = params->min;
stat.max = params->max;
print.squares = data.squares;
print.samples = data.samples;
- print.fancy = data.fancy;
-
- if (!data.fancy) {
- const DistStor::Params *params =
- safe_cast<const DistStor::Params *>(info.storageParams);
+ const DistStor::Params *params =
+ safe_cast<const DistStor::Params *>(info.storageParams);
+ print.fancy = params->fancy;
+ if (!params->fancy) {
print.min = params->min;
print.max = params->max;
print.bucket_size = params->bucket_size;
print.squares = info.data[i].squares;
print.samples = info.data[i].samples;
- print.fancy = info.data[i].fancy;
- if (!print.fancy) {
- const DistStor::Params *params =
- safe_cast<const DistStor::Params *>(info.storageParams);
+ const DistStor::Params *params =
+ safe_cast<const DistStor::Params *>(info.storageParams);
+ print.fancy = params->fancy;
+ if (!params->fancy) {
print.min = params->min;
print.max = params->max;
print.bucket_size = params->bucket_size;