statistics.hh (3515:98655e4fd9f1) statistics.hh (3918:1f9a98d198e8)
1/*
2 * Copyright (c) 2003-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;

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

45* VectorStandardDeviation totals
46* Document Namespaces
47*/
48#ifndef __BASE_STATISTICS_HH__
49#define __BASE_STATISTICS_HH__
50
51#include <algorithm>
52#include <cassert>
1/*
2 * Copyright (c) 2003-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;

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

45* VectorStandardDeviation totals
46* Document Namespaces
47*/
48#ifndef __BASE_STATISTICS_HH__
49#define __BASE_STATISTICS_HH__
50
51#include <algorithm>
52#include <cassert>
53#ifdef __SUNPRO_CC
54#include <math.h>
55#endif
53#include <cmath>
54#include <functional>
55#include <iosfwd>
56#include <string>
57#include <vector>
58
59#include "base/cprintf.hh"
60#include "base/intmath.hh"

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

1405 */
1406 void sample(Counter val, int number, const Params &params)
1407 {
1408 if (val < params.min)
1409 underflow += number;
1410 else if (val > params.max)
1411 overflow += number;
1412 else {
56#include <cmath>
57#include <functional>
58#include <iosfwd>
59#include <string>
60#include <vector>
61
62#include "base/cprintf.hh"
63#include "base/intmath.hh"

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

1408 */
1409 void sample(Counter val, int number, const Params &params)
1410 {
1411 if (val < params.min)
1412 underflow += number;
1413 else if (val > params.max)
1414 overflow += number;
1415 else {
1413 int index = (int)floor((val - params.min) / params.bucket_size);
1416 int index = (int)std::floor((val - params.min) / params.bucket_size);
1414 assert(index < size(params));
1415 cvec[index] += number;
1416 }
1417
1418 if (val < min_val)
1419 min_val = val;
1420
1421 if (val > max_val)

--- 1466 unchanged lines hidden ---
1417 assert(index < size(params));
1418 cvec[index] += number;
1419 }
1420
1421 if (val < min_val)
1422 min_val = val;
1423
1424 if (val > max_val)

--- 1466 unchanged lines hidden ---