Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(246)

Unified Diff: tracing/tracing/base/math/statistics.html

Issue 2771723003: [tracing] Move math utilities from base into their own subdirectory (attempt 2) (Closed)
Patch Set: rebase Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tracing/tracing/base/math/sorted_array_utils.html ('k') | tracing/tracing/base/math/statistics_test.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tracing/tracing/base/math/statistics.html
diff --git a/tracing/tracing/base/statistics.html b/tracing/tracing/base/math/statistics.html
similarity index 98%
rename from tracing/tracing/base/statistics.html
rename to tracing/tracing/base/math/statistics.html
index 071a860fb62c35842bd4df47ef2c6783bcadf277..5289637725e7204248e19e7fd4353c4d70a7b3d4 100644
--- a/tracing/tracing/base/statistics.html
+++ b/tracing/tracing/base/math/statistics.html
@@ -5,8 +5,8 @@ Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
-->
-<link rel="import" href="/tracing/base/math.html">
-<link rel="import" href="/tracing/base/range.html">
+<link rel="import" href="/tracing/base/math/math.html">
+<link rel="import" href="/tracing/base/math/range.html">
<script src="/mannwhitneyu/mannwhitneyu.js"></script>
<script>
@@ -35,7 +35,7 @@ found in the LICENSE file.
// TODO(charliea): Remove:
/* eslint-disable catapult-camelcase */
-tr.exportTo('tr.b', function() {
+tr.exportTo('tr.b.math', function() {
var identity = x => x;
var Statistics = {};
@@ -158,7 +158,7 @@ tr.exportTo('tr.b', function() {
Statistics.range = function(ary, opt_func, opt_this) {
var func = opt_func || identity;
- var ret = new tr.b.Range();
+ var ret = new tr.b.math.Range();
var i = 0;
for (var elt of ary)
ret.addValue(func.call(opt_this, elt, i++));
@@ -383,7 +383,7 @@ tr.exportTo('tr.b', function() {
discrepancy /= sampleScale;
} else {
// Compute relative discrepancy
- discrepancy = tr.b.clamp(
+ discrepancy = tr.b.math.clamp(
(discrepancy - invSampleCount) / (1.0 - invSampleCount), 0.0, 1.0);
}
return discrepancy;
@@ -634,7 +634,7 @@ tr.exportTo('tr.b', function() {
Statistics.UniformDistribution = function(opt_range) {
if (!opt_range)
- opt_range = tr.b.Range.fromExplicitRange(0, 1);
+ opt_range = tr.b.math.Range.fromExplicitRange(0, 1);
this.range = opt_range;
};
@@ -646,7 +646,7 @@ tr.exportTo('tr.b', function() {
},
computePercentile: function(x) {
- return tr.b.normalize(x, this.range.min, this.range.max);
+ return tr.b.math.normalize(x, this.range.min, this.range.max);
},
get mean() {
@@ -694,7 +694,7 @@ tr.exportTo('tr.b', function() {
computePercentile: function(x) {
var standardizedX = ((x - this.mean) /
Math.sqrt(2.0 * this.variance));
- return (1.0 + tr.b.erf(standardizedX)) / 2.0;
+ return (1.0 + tr.b.math.erf(standardizedX)) / 2.0;
},
get mean() {
@@ -817,7 +817,7 @@ tr.exportTo('tr.b', function() {
* @typedef {Object} HypothesisTestResult
* @property {number} p
* @property {number} U
- * @property {!tr.b.Statistics.Significance} significance
+ * @property {!tr.b.math.Statistics.Significance} significance
*/
/**
« no previous file with comments | « tracing/tracing/base/math/sorted_array_utils.html ('k') | tracing/tracing/base/math/statistics_test.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698