MCPcopy Create free account
hub / github.com/AutonomousFieldRoboticsLab/SVIn / Add

Method Add

pose_graph/include/utils/Accumulator.h:64–83  ·  view source on GitHub ↗

------------------------------------------------------------------------ */

Source from the content-addressed store, hash-verified

62
63 /* ------------------------------------------------------------------------ */
64 void Add(SampleType sample) {
65 most_recent_ = sample;
66 if (sample_index_ < WindowSize) {
67 samples_.push_back(sample);
68 window_sum_ += sample;
69 ++sample_index_;
70 } else {
71 SampleType& oldest = samples_.at(sample_index_++ % WindowSize);
72 window_sum_ += sample - oldest;
73 oldest = sample;
74 }
75 sum_ += sample;
76 ++total_samples_;
77 if (sample > max_) {
78 max_ = sample;
79 }
80 if (sample < min_) {
81 min_ = sample;
82 }
83 }
84
85 /* ------------------------------------------------------------------------ */
86 int total_samples() const { return total_samples_; }

Callers 1

AddValueMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected