11 using namespace Eigen;
15 state_size_(state_size)
20 window_(history_buffer.window_),
21 history_buffer_(std::move(history_buffer.history_buffer_)),
22 state_size_(history_buffer.state_size_)
24 history_buffer.window_ = 0;
25 history_buffer.state_size_ = 0;
31 if (
this == &history_buffer)
34 window_ = history_buffer.
window_;
35 history_buffer.window_ = 0;
37 state_size_ = history_buffer.state_size_;
38 history_buffer.state_size_ = 0;
40 history_buffer_ = std::move(history_buffer.history_buffer_);
48 history_buffer_.push_front(element);
50 if (history_buffer_.size() > window_)
51 history_buffer_.pop_back();
57 MatrixXd hist_out(state_size_, history_buffer_.size());
60 for (
const Ref<const VectorXd>& element : history_buffer_)
61 hist_out.col(i++) = element;
70 if (window == window_)
return true;
71 else if (window < 2) tmp = 2;
72 else if (window >= max_window_) tmp = max_window_;
75 if (tmp < window_ && tmp < history_buffer_.size())
77 for (
unsigned int i = 0; i < (window_ - tmp); ++i)
78 history_buffer_.pop_back();
89 return setHistorySize(window_ - 1);
95 return setHistorySize(window_ + 1);
101 history_buffer_.clear();