2273N/A * Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved. 0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 0N/A * This code is free software; you can redistribute it and/or modify it 0N/A * under the terms of the GNU General Public License version 2 only, as 0N/A * published by the Free Software Foundation. 0N/A * This code is distributed in the hope that it will be useful, but WITHOUT 0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 0N/A * version 2 for more details (a copy is included in the LICENSE file that 0N/A * accompanied this code). 0N/A * You should have received a copy of the GNU General Public License version 0N/A * 2 along with this work; if not, write to the Free Software Foundation, 0N/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 0N/A// Catch-all file for utility classes 0N/A // We smooth the samples by not using weight() directly until we've 0N/A // had enough data to make it meaningful. We'd like the first weight 3385N/A // used to be 1, the second to be 1/2, etc until we have 3385N/A // Avoid division by zero if the counter wraps (7158457) 0N/A // Compute the new weighted average 1145N/A // Compute new adaptive weighted average based on new sample. 1145N/A // Now update the deviation and the padded average. 0N/A // Compute our parent classes sample information 0N/A // We only create a new deviation if the sample is non-zero 0N/A // Some tolerance should be injected here. A denominator that is 0N/A // nearly 0 should be avoided. 0N/A // The _mean_y and _mean_x are decaying averages and can 0N/A // be used to discount earlier data. If they are used, 0N/A // first consider whether all the quantities should be 0N/A // kept as decaying averages. 0N/A // _intercept = _mean_y.average() - _slope * _mean_x.average(); 0N/A// Both decrement_will_decrease() and increment_will_decrease() return 0N/A// true for a slope of 0. That is because a change is necessary before 0N/A// a slope can be calculated and a 0 slope will, in general, indicate 0N/A// that no calculation of the slope has yet been done. Returning true 0N/A// for a slope equal to 0 reflects the intuitive expectation of the 0N/A// dependence on the slope. Don't use the complement of these functions 0N/A// since that untuitive expectation is not built into the complement.