intHisto.hpp revision 3863
1879N/A * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. 342N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 342N/A * This code is free software; you can redistribute it and/or modify it 342N/A * under the terms of the GNU General Public License version 2 only, as 342N/A * published by the Free Software Foundation. 342N/A * This code is distributed in the hope that it will be useful, but WITHOUT 342N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 342N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 342N/A * version 2 for more details (a copy is included in the LICENSE file that 342N/A * accompanied this code). 342N/A * You should have received a copy of the GNU General Public License version 342N/A * 2 along with this work; if not, write to the Free Software Foundation, 342N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 1472N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 342N/A// This class implements a simple histogram. 342N/A// A histogram summarizes a series of "measurements", each of which is 342N/A// assumed (required in this implementation) to have an outcome that is a 342N/A// non-negative integer. The histogram efficiently maps measurement outcomes 342N/A// to the number of measurements had that outcome. 342N/A// To print the results, invoke print() on your Histogram*. 342N/A// Note: there is already an existing "Histogram" class, in file 342N/A// histogram.{hpp,cpp}, but to my mind that's not a histogram, it's a table 342N/A// mapping strings to counts. To be a histogram (IMHO) it needs to map 342N/A// numbers (in fact, integers) to number of occurrences of that number. 342N/A// ysr: (i am not sure i agree with the above note.) i suspect we want to have a 342N/A// histogram template that will map an arbitrary type (with a defined order 342N/A// relation) to a count. 342N/A // Create a new, empty table. "est" is an estimate of the maximum outcome 342N/A // that will be added, and "max" is an outcome such that all outcomes at 342N/A // least that large will be bundled with it. 342N/A // Add a measurement with the given outcome to the sequence. 342N/A // Return the number of entries recorded so far with the given outcome. 342N/A // Return the total number of entries recorded so far. 342N/A // Return the number of entries recorded so far with the given outcome as 342N/A // a fraction of the total number recorded so far. 342N/A // Print the histogram on the given output stream. 1879N/A#
endif // SHARE_VM_UTILITIES_INTHISTO_HPP