| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <!-- | 2 <!-- |
| 3 Copyright (c) 2014 The Chromium Authors. All rights reserved. | 3 Copyright (c) 2014 The Chromium Authors. All rights reserved. |
| 4 Use of this source code is governed by a BSD-style license that can be | 4 Use of this source code is governed by a BSD-style license that can be |
| 5 found in the LICENSE file. | 5 found in the LICENSE file. |
| 6 --> | 6 --> |
| 7 <link rel="import" href="/tracing/base/statistics.html"> | 7 <link rel="import" href="/tracing/base/math/statistics.html"> |
| 8 <script> | 8 <script> |
| 9 'use strict'; | 9 'use strict'; |
| 10 | 10 |
| 11 // TODO(charliea): Remove: | 11 // TODO(charliea): Remove: |
| 12 /* eslint-disable catapult-camelcase */ | 12 /* eslint-disable catapult-camelcase */ |
| 13 | 13 |
| 14 tr.b.unittest.testSuite(function() { | 14 tr.b.unittest.testSuite(function() { |
| 15 var Statistics = tr.b.Statistics; | 15 var Statistics = tr.b.math.Statistics; |
| 16 | 16 |
| 17 /** | 17 /** |
| 18 * Lloyd relaxation in 1D. | 18 * Lloyd relaxation in 1D. |
| 19 * | 19 * |
| 20 * Keeps the position of the first and last sample. | 20 * Keeps the position of the first and last sample. |
| 21 **/ | 21 **/ |
| 22 function relax(samples, opt_iterations) { | 22 function relax(samples, opt_iterations) { |
| 23 opt_iterations = opt_iterations || 10; | 23 opt_iterations = opt_iterations || 10; |
| 24 for (var i = 0; i < opt_iterations; i++) { | 24 for (var i = 0; i < opt_iterations; i++) { |
| 25 var voronoiBoundaries = []; | 25 var voronoiBoundaries = []; |
| (...skipping 542 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 568 assert(isNaN(results.p)); | 568 assert(isNaN(results.p)); |
| 569 | 569 |
| 570 // The result of comparing a sample against an empty sample should not be a | 570 // The result of comparing a sample against an empty sample should not be a |
| 571 // valid p value. NOTE: The current implementation returns 0, it is up to | 571 // valid p value. NOTE: The current implementation returns 0, it is up to |
| 572 // the caller to interpret this. | 572 // the caller to interpret this. |
| 573 results = Statistics.mwu(normallyDistributedSample, emptySample); | 573 results = Statistics.mwu(normallyDistributedSample, emptySample); |
| 574 assert(!results.p); | 574 assert(!results.p); |
| 575 }); | 575 }); |
| 576 }); | 576 }); |
| 577 </script> | 577 </script> |
| OLD | NEW |