text.cc (6211:40e5a315bded) text.cc (6212:64c3b989238c)
1/*
2 * Copyright (c) 2004-2005 The Regents of The University of Michigan
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

--- 296 unchanged lines hidden (view full) ---

305 Flags flags;
306 bool descriptions;
307 int precision;
308
309 Counter min;
310 Counter max;
311 Counter bucket_size;
312 size_type size;
1/*
2 * Copyright (c) 2004-2005 The Regents of The University of Michigan
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

--- 296 unchanged lines hidden (view full) ---

305 Flags flags;
306 bool descriptions;
307 int precision;
308
309 Counter min;
310 Counter max;
311 Counter bucket_size;
312 size_type size;
313 bool fancy;
313 DistType type;
314
315 const DistData &data;
316
317 DistPrint(const Text *text, const DistInfo &info);
318 DistPrint(const Text *text, const VectorDistInfo &info, int i);
319 void init(const Text *text, const Info &info, const DistParams *params);
320 void operator()(ostream &stream) const;
321};

--- 20 unchanged lines hidden (view full) ---

342DistPrint::init(const Text *text, const Info &info, const DistParams *params)
343{
344 name = info.name;
345 desc = info.desc;
346 flags = info.flags;
347 precision = info.precision;
348 descriptions = text->descriptions;
349
314
315 const DistData &data;
316
317 DistPrint(const Text *text, const DistInfo &info);
318 DistPrint(const Text *text, const VectorDistInfo &info, int i);
319 void init(const Text *text, const Info &info, const DistParams *params);
320 void operator()(ostream &stream) const;
321};

--- 20 unchanged lines hidden (view full) ---

342DistPrint::init(const Text *text, const Info &info, const DistParams *params)
343{
344 name = info.name;
345 desc = info.desc;
346 flags = info.flags;
347 precision = info.precision;
348 descriptions = text->descriptions;
349
350 fancy = params->fancy;
350 type = params->type;
351 min = params->min;
352 max = params->max;
353 bucket_size = params->bucket_size;
354 size = params->buckets;
355}
356
357void
358DistPrint::operator()(ostream &stream) const

--- 19 unchanged lines hidden (view full) ---

378 Result stdev = NAN;
379 if (data.samples)
380 stdev = sqrt((data.samples * data.squares - data.sum * data.sum) /
381 (data.samples * (data.samples - 1.0)));
382 print.name = base + "stdev";
383 print.value = stdev;
384 print(stream);
385
351 min = params->min;
352 max = params->max;
353 bucket_size = params->bucket_size;
354 size = params->buckets;
355}
356
357void
358DistPrint::operator()(ostream &stream) const

--- 19 unchanged lines hidden (view full) ---

378 Result stdev = NAN;
379 if (data.samples)
380 stdev = sqrt((data.samples * data.squares - data.sum * data.sum) /
381 (data.samples * (data.samples - 1.0)));
382 print.name = base + "stdev";
383 print.value = stdev;
384 print(stream);
385
386 if (fancy)
386 if (type == Deviation)
387 return;
388
389 assert(size == data.cvec.size());
390
391 Result total = 0.0;
392 if (data.underflow != NAN)
393 total += data.underflow;
394 for (off_type i = 0; i < size; ++i)

--- 215 unchanged lines hidden ---
387 return;
388
389 assert(size == data.cvec.size());
390
391 Result total = 0.0;
392 if (data.underflow != NAN)
393 total += data.underflow;
394 for (off_type i = 0; i < size; ++i)

--- 215 unchanged lines hidden ---