#include <integrator.h>
Inheritance diagram for Samples:


Public Member Functions | |
| Samples () | |
| void | newPoint (double val) |
| int | cnt () const |
| double | sum () const |
| double | mean () const |
| double | variance () const |
| void | reset () |
| int | command (int argc, const char *const *argv) |
Protected Attributes | |
| int | cnt_ |
| double | sum_ |
| double | sqsum_ |
|
|
Definition at line 57 of file integrator.h. References cnt_, sqsum_, and sum_.
|
|
|
Definition at line 64 of file integrator.h. References cnt_. Referenced by command().
00064 { return (cnt_); }
|
|
||||||||||||
|
Definition at line 102 of file integrator.cc. References cnt(), cnt_, mean(), newPoint(), reset(), and variance().
00103 {
00104 if (argc == 2) {
00105 if (strcmp(argv[1], "mean") == 0) {
00106 if (cnt_ > 0) {
00107 Tcl::instance().resultf("%g", mean());
00108 return (TCL_OK);
00109 }
00110 Tcl::instance().resultf("tried to take mean with no sample points");
00111 return (TCL_ERROR);
00112 }
00113 if (strcmp(argv[1], "cnt") == 0) {
00114 Tcl::instance().resultf("%u", cnt());
00115 return (TCL_OK);
00116 }
00117 if (strcmp(argv[1], "variance") == 0) {
00118 if (cnt_ == 1) {
00119 Tcl::instance().resultf("0.0");
00120 return (TCL_OK);
00121 }
00122 if (cnt_ > 2) {
00123 Tcl::instance().resultf("%g", variance());
00124 return (TCL_OK);
00125 }
00126 return (TCL_ERROR);
00127 }
00128 if (strcmp(argv[1], "reset") == 0) {
00129 reset();
00130 return (TCL_OK);
00131 }
00132 } else if ( argc == 3 ) {
00133 if ( strcmp(argv[1],"newpoint") == 0 ) {
00134 double x = atof(argv[2]);
00135 newPoint(x);
00136 return (TCL_OK);
00137 }
00138 }
00139 return (TclObject::command(argc, argv));
00140 }
|
Here is the call graph for this function:

|
|
Definition at line 66 of file integrator.h. Referenced by command(), and variance().
|
|
|
Definition at line 58 of file integrator.h. References cnt_, sqsum_, and sum_. Referenced by command(), QueueMonitorCompat::out(), and QueueMonitor::out().
|
|
|
Definition at line 77 of file integrator.h. References cnt_, sqsum_, and sum_. Referenced by command().
|
|
|
Definition at line 65 of file integrator.h. References sum_.
00065 { return (sum_); }
|
|
|
Definition at line 71 of file integrator.h. References cnt_, mean(), sqsum_, and sum_. Referenced by command().
|
Here is the call graph for this function:

|
|
Definition at line 80 of file integrator.h. Referenced by cnt(), command(), mean(), newPoint(), reset(), Samples(), and variance(). |
|
|
Definition at line 82 of file integrator.h. Referenced by newPoint(), reset(), Samples(), and variance(). |
|
|
Definition at line 81 of file integrator.h. Referenced by mean(), newPoint(), reset(), Samples(), sum(), and variance(). |
1.3.3