75 void add(
const std::vector<RealType>&)
override {
76 accumulatorFunctionCallMismatch();
78 void add(
const Vector3d&)
override { accumulatorFunctionCallMismatch(); }
79 void add(
const potVec&)
override { accumulatorFunctionCallMismatch(); }
80 void add(
const Mat3x3d&)
override { accumulatorFunctionCallMismatch(); }
82 void writeData(std::ostream& stream,
const std::string& errorMessage,
83 DataHandling dataHandling)
const override {
85 std::size_t count = RealAccumulator::getCount();
87 switch (dataHandling) {
88 case DataHandling::Average:
91 case DataHandling::Last:
94 case DataHandling::Max:
97 case DataHandling::Min:
100 case DataHandling::Total:
107 if (std::isinf(dat) || std::isnan(dat)) {
108 snprintf(painCave.errMsg, MAX_SIM_ERROR_MSG_LENGTH,
"%s",
109 errorMessage.c_str());
110 painCave.isFatal = 1;
116 stream <<
"\t" << dat;
120 void writeErrorBars(std::ostream& stream,
const std::string& errorMessage,
121 ErrorHandling errorHandling)
const override {
123 std::size_t count = RealAccumulator::getCount();
125 switch (errorHandling) {
126 case ErrorHandling::CI95:
129 case ErrorHandling::StdDev:
132 case ErrorHandling::Variance:
139 if (count == 0 && errorHandling == ErrorHandling::CI95) {
142 if (std::isinf(err) || std::isnan(err)) {
143 snprintf(painCave.errMsg, MAX_SIM_ERROR_MSG_LENGTH,
"%s",
144 errorMessage.c_str());
145 painCave.isFatal = 1;
151 stream <<
"\t" << err;
156 std::type_index getType()
const override {
return typeid(RealType); }
158 std::size_t getCount()
const override {
159 return RealAccumulator::getCount();
168 void add(
const std::vector<RealType>& val)
override {
169 StdVectorAccumulator::add(val);
173 void add(RealType val)
override { accumulatorFunctionCallMismatch(); }
174 void add(
const Vector3d&)
override { accumulatorFunctionCallMismatch(); }
175 void add(
const potVec&)
override { accumulatorFunctionCallMismatch(); }
176 void add(
const Mat3x3d&)
override { accumulatorFunctionCallMismatch(); }
178 void writeData(std::ostream& stream,
const std::string& errorMessage,
179 DataHandling dataHandling)
const override {
180 std::vector<RealType> dat;
181 std::size_t count = StdVectorAccumulator::getCount();
183 switch (dataHandling) {
184 case DataHandling::Average:
185 dat = StdVectorAccumulator::getAverage();
187 case DataHandling::Last:
188 dat = StdVectorAccumulator::getLastValue();
190 case DataHandling::Total:
191 dat = StdVectorAccumulator::getTotal();
193 case DataHandling::Max:
194 case DataHandling::Min:
195 snprintf(painCave.errMsg, MAX_SIM_ERROR_MSG_LENGTH,
196 "Max and Min functions are not defined for a "
197 "std::vector Accumulator.");
198 painCave.isFatal = 1;
205 for (
int i = 0; i < StdVectorAccumulator::getAverage().size(); i++) {
206 if (std::isinf(dat[i]) || std::isnan(dat[i])) {
207 snprintf(painCave.errMsg, MAX_SIM_ERROR_MSG_LENGTH,
"%s",
208 errorMessage.c_str());
209 painCave.isFatal = 1;
215 stream <<
'\t' << dat[i];
220 void writeErrorBars(std::ostream& stream,
const std::string& errorMessage,
221 ErrorHandling errorHandling)
const override {
222 std::vector<RealType> err;
223 std::size_t count = StdVectorAccumulator::getCount();
225 switch (errorHandling) {
226 case ErrorHandling::CI95:
227 err = StdVectorAccumulator::get95percentConfidenceInterval();
229 case ErrorHandling::StdDev:
230 err = StdVectorAccumulator::getStdDev();
232 case ErrorHandling::Variance:
233 err = StdVectorAccumulator::getVariance();
239 for (
int i = 0; i < StdVectorAccumulator::getAverage().size(); i++) {
240 if (count == 0 && errorHandling == ErrorHandling::CI95) {
243 if (std::isinf(err[i]) || std::isnan(err[i])) {
244 snprintf(painCave.errMsg, MAX_SIM_ERROR_MSG_LENGTH,
"%s",
245 errorMessage.c_str());
246 painCave.isFatal = 1;
252 stream <<
"\t" << err[i];
258 std::type_index getType()
const override {
259 return typeid(std::vector<RealType>);
262 std::size_t getCount()
const override {
263 std::size_t count = StdVectorAccumulator::getCount();
274 void add(
const Vector3d& val)
override { Vector3dAccumulator::add(val); }
277 void add(RealType val)
override { accumulatorFunctionCallMismatch(); }
278 void add(
const std::vector<RealType>&)
override {
279 accumulatorFunctionCallMismatch();
281 void add(
const potVec&)
override { accumulatorFunctionCallMismatch(); }
282 void add(
const Mat3x3d&)
override { accumulatorFunctionCallMismatch(); }
284 void writeData(std::ostream& stream,
const std::string& errorMessage,
285 DataHandling dataHandling)
const override {
287 std::size_t count = Vector3dAccumulator::getCount();
289 switch (dataHandling) {
290 case DataHandling::Average:
291 dat = Vector3dAccumulator::getAverage();
293 case DataHandling::Last:
294 dat = Vector3dAccumulator::getLastValue();
296 case DataHandling::Total:
297 dat = Vector3dAccumulator::getTotal();
299 case DataHandling::Max:
300 case DataHandling::Min:
301 snprintf(painCave.errMsg, MAX_SIM_ERROR_MSG_LENGTH,
"%s",
302 "Max and Min functions are not defined for a "
303 "std::vector Accumulator.");
304 painCave.isFatal = 1;
311 for (
int i = 0; i < Vector3dAccumulator::getAverage().size(); i++) {
312 if (std::isinf(dat[i]) || std::isnan(dat[i])) {
313 snprintf(painCave.errMsg, MAX_SIM_ERROR_MSG_LENGTH,
"%s",
314 errorMessage.c_str());
315 painCave.isFatal = 1;
321 stream <<
"\t" << dat[i];
326 void writeErrorBars(std::ostream& stream,
const std::string& errorMessage,
327 ErrorHandling errorHandling)
const override {
329 std::size_t count = Vector3dAccumulator::getCount();
331 switch (errorHandling) {
332 case ErrorHandling::CI95:
333 err = Vector3dAccumulator::get95percentConfidenceInterval();
335 case ErrorHandling::StdDev:
336 err = Vector3dAccumulator::getStdDev();
338 case ErrorHandling::Variance:
339 err = Vector3dAccumulator::getVariance();
345 for (
int i = 0; i < Vector3dAccumulator::getAverage().size(); i++) {
346 if (count == 0 && errorHandling == ErrorHandling::CI95) {
349 if (std::isinf(err[i]) || std::isnan(err[i])) {
350 snprintf(painCave.errMsg, MAX_SIM_ERROR_MSG_LENGTH,
"%s",
351 errorMessage.c_str());
352 painCave.isFatal = 1;
358 stream <<
"\t" << err[i];
364 std::type_index getType()
const override {
return typeid(
Vector3d); }
366 std::size_t getCount()
const override {
367 return Vector3dAccumulator::getCount();
376 void add(
const potVec& val)
override { PotVecAccumulator::add(val); }
379 void add(RealType val)
override { accumulatorFunctionCallMismatch(); }
380 void add(
const std::vector<RealType>&)
override {
381 accumulatorFunctionCallMismatch();
383 void add(
const Vector3d&)
override { accumulatorFunctionCallMismatch(); }
384 void add(
const Mat3x3d&)
override { accumulatorFunctionCallMismatch(); }
386 void writeData(std::ostream& stream,
const std::string& errorMessage,
387 DataHandling dataHandling)
const override {
389 std::size_t count = PotVecAccumulator::getCount();
391 switch (dataHandling) {
392 case DataHandling::Average:
393 dat = PotVecAccumulator::getAverage();
395 case DataHandling::Last:
396 dat = PotVecAccumulator::getLastValue();
398 case DataHandling::Total:
399 dat = PotVecAccumulator::getTotal();
401 case DataHandling::Max:
402 case DataHandling::Min:
403 snprintf(painCave.errMsg, MAX_SIM_ERROR_MSG_LENGTH,
"%s",
404 "Max and Min functions are not defined for a "
405 "std::vector Accumulator.");
406 painCave.isFatal = 1;
413 for (
int i = 0; i < PotVecAccumulator::getAverage().size(); i++) {
414 if (std::isinf(dat[i]) || std::isnan(dat[i])) {
415 snprintf(painCave.errMsg, MAX_SIM_ERROR_MSG_LENGTH,
"%s",
416 errorMessage.c_str());
417 painCave.isFatal = 1;
423 stream <<
"\t" << dat[i];
428 void writeErrorBars(std::ostream& stream,
const std::string& errorMessage,
429 ErrorHandling errorHandling)
const override {
431 std::size_t count = PotVecAccumulator::getCount();
433 switch (errorHandling) {
434 case ErrorHandling::CI95:
435 err = PotVecAccumulator::get95percentConfidenceInterval();
437 case ErrorHandling::StdDev:
438 err = PotVecAccumulator::getStdDev();
440 case ErrorHandling::Variance:
441 err = PotVecAccumulator::getVariance();
447 for (
int i = 0; i < PotVecAccumulator::getAverage().size(); i++) {
448 if (count == 0 && errorHandling == ErrorHandling::CI95) {
451 if (std::isinf(err[i]) || std::isnan(err[i])) {
452 snprintf(painCave.errMsg, MAX_SIM_ERROR_MSG_LENGTH,
"%s",
453 errorMessage.c_str());
454 painCave.isFatal = 1;
460 stream <<
"\t" << err[i];
466 std::type_index getType()
const override {
return typeid(
potVec); }
468 std::size_t getCount()
const override {
469 return PotVecAccumulator::getCount();
478 void add(
const Mat3x3d& val)
override { Mat3x3dAccumulator::add(val); }
481 void add(RealType val)
override { accumulatorFunctionCallMismatch(); }
482 void add(
const std::vector<RealType>&)
override {
483 accumulatorFunctionCallMismatch();
485 void add(
const Vector3d&)
override { accumulatorFunctionCallMismatch(); }
486 void add(
const potVec&)
override { accumulatorFunctionCallMismatch(); }
488 void writeData(std::ostream& stream,
const std::string& errorMessage,
489 DataHandling dataHandling)
const override {
491 std::size_t count = Mat3x3dAccumulator::getCount();
493 switch (dataHandling) {
494 case DataHandling::Average:
495 dat = Mat3x3dAccumulator::getAverage();
497 case DataHandling::Last:
498 dat = Mat3x3dAccumulator::getLastValue();
500 case DataHandling::Total:
501 dat = Mat3x3dAccumulator::getTotal();
503 case DataHandling::Max:
504 case DataHandling::Min:
505 snprintf(painCave.errMsg, MAX_SIM_ERROR_MSG_LENGTH,
"%s",
506 "Max and Min functions are not defined for a "
507 "std::vector Accumulator.");
508 painCave.isFatal = 1;
515 for (
unsigned int i = 0; i < 3; i++) {
516 for (
unsigned int j = 0; j < 3; j++) {
517 if (std::isinf(dat(i, j)) || std::isnan(dat(i, j))) {
518 snprintf(painCave.errMsg, MAX_SIM_ERROR_MSG_LENGTH,
"%s",
519 errorMessage.c_str());
520 painCave.isFatal = 1;
526 stream <<
"\t" << dat(i, j);
532 void writeErrorBars(std::ostream& stream,
const std::string& errorMessage,
533 ErrorHandling errorHandling)
const override {
535 std::size_t count = Mat3x3dAccumulator::getCount();
537 switch (errorHandling) {
538 case ErrorHandling::CI95:
539 err = Mat3x3dAccumulator::get95percentConfidenceInterval();
541 case ErrorHandling::StdDev:
542 err = Mat3x3dAccumulator::getStdDev();
544 case ErrorHandling::Variance:
545 err = Mat3x3dAccumulator::getVariance();
551 for (
unsigned int i = 0; i < 3; i++) {
552 for (
unsigned int j = 0; j < 3; j++) {
553 if (count == 0 && errorHandling == ErrorHandling::CI95) {
556 if (std::isinf(err(i, j)) || std::isnan(err(i, j))) {
557 snprintf(painCave.errMsg, MAX_SIM_ERROR_MSG_LENGTH,
"%s",
558 errorMessage.c_str());
559 painCave.isFatal = 1;
565 stream <<
"\t" << err(i, j);
572 std::type_index getType()
const override {
return typeid(
Mat3x3d); }
574 std::size_t getCount()
const override {
575 return Mat3x3dAccumulator::getCount();