Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/stan/optimization/lbfgs_update.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#define STAN_OPTIMIZATION_LBFGS_UPDATE_HPP

#include <stan/math/prim/fun/Eigen.hpp>
#include <boost/circular_buffer.hpp>
#include <stan/util/ring_buffer.hpp>
#include <tuple>
#include <vector>

Expand All @@ -28,7 +28,7 @@ class LBFGSUpdate {
*
* @param L New size of buffer.
**/
void set_history_size(size_t L) { _buf.rset_capacity(L); }
void set_history_size(size_t L) { _buf.reset_capacity(L); }

/**
* Add a new set of update vectors to the history.
Expand Down Expand Up @@ -72,8 +72,8 @@ class LBFGSUpdate {
**/
inline void search_direction(VectorT &pk, const VectorT &gk) const {
std::vector<Scalar> alphas(_buf.size());
typename boost::circular_buffer<UpdateT>::const_reverse_iterator buf_rit;
typename boost::circular_buffer<UpdateT>::const_iterator buf_it;
typename stan::util::ring_buffer<UpdateT>::const_reverse_iterator buf_rit;
typename stan::util::ring_buffer<UpdateT>::const_iterator buf_it;
typename std::vector<Scalar>::const_iterator alpha_it;
typename std::vector<Scalar>::reverse_iterator alpha_rit;

Expand Down Expand Up @@ -103,7 +103,7 @@ class LBFGSUpdate {
}

protected:
boost::circular_buffer<UpdateT> _buf;
stan::util::ring_buffer<UpdateT> _buf;
Scalar _gammak;
};
} // namespace optimization
Expand Down
6 changes: 3 additions & 3 deletions src/stan/services/pathfinder/single.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#include <stan/services/util/initialize.hpp>
#include <stan/services/util/create_rng.hpp>
#include <stan/services/util/duration_diff.hpp>
#include <boost/circular_buffer.hpp>
#include <stan/util/ring_buffer.hpp>
#include <tbb/parallel_for.h>
#include <tbb/concurrent_queue.h>
#include <tbb/task_group.h>
Expand Down Expand Up @@ -659,8 +659,8 @@ inline auto pathfinder_lbfgs_single(
+ std::to_string(lbfgs.logp()));
}
int ret = 0;
boost::circular_buffer<Eigen::VectorXd> param_buff(max_history_size);
boost::circular_buffer<Eigen::VectorXd> grad_buff(max_history_size);
stan::util::ring_buffer<Eigen::VectorXd> param_buff(max_history_size);
stan::util::ring_buffer<Eigen::VectorXd> grad_buff(max_history_size);
Eigen::VectorXd prev_params
= Eigen::Map<Eigen::VectorXd>(cont_vector.data(), cont_vector.size());
std::size_t history_size = 0;
Expand Down
Loading
Loading