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

Side by Side Diff: samples/third_party/dromaeo/tests/Common.dart

Issue 12086028: Fix up dromaeo after lib v2 merge and add Dromaeo smoketest to prevent future (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 10 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 part of dromaeo; 1 part of dromaeo;
2 2
3 class Result { 3 class Result {
4 int get runs { return _sorted.length; } 4 int get runs { return _sorted.length; }
5 5
6 double get sum { 6 double get sum {
7 double result = 0.0; 7 double result = 0.0;
8 _sorted.forEach((double e) { result += e; }); 8 _sorted.forEach((double e) { result += e; });
9 return result; 9 return result;
10 } 10 }
(...skipping 21 matching lines...) Expand all
32 double get sem { return (deviation / Math.sqrt(runs)) * T_DISTRIBUTION; } 32 double get sem { return (deviation / Math.sqrt(runs)) * T_DISTRIBUTION; }
33 33
34 double get error { return (sem / mean) * 100; } 34 double get error { return (sem / mean) * 100; }
35 35
36 // TODO: Implement writeOn. 36 // TODO: Implement writeOn.
37 String toString() { 37 String toString() {
38 return '[Result: mean = ${mean}]'; 38 return '[Result: mean = ${mean}]';
39 } 39 }
40 40
41 factory Result(List<double> runsPerSecond) { 41 factory Result(List<double> runsPerSecond) {
42 runsPerSecond.sort(); 42 runsPerSecond.sort((a, b) => a.compareTo(b));
43 return new Result._internal(runsPerSecond); 43 return new Result._internal(runsPerSecond);
44 } 44 }
45 45
46 Result._internal(this._sorted) {} 46 Result._internal(this._sorted) {}
47 47
48 List<double> _sorted; 48 List<double> _sorted;
49 49
50 // Populated from: http://www.medcalc.be/manual/t-distribution.php 50 // Populated from: http://www.medcalc.be/manual/t-distribution.php
51 // 95% confidence for N - 1 = 4 51 // 95% confidence for N - 1 = 4
52 static const double T_DISTRIBUTION = 2.776; 52 static const double T_DISTRIBUTION = 2.776;
53 } 53 }
OLDNEW
« no previous file with comments | « samples/third_party/dromaeo/index.html ('k') | samples/third_party/dromaeo/tests/dom-attr-html.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698