Skip to content

Commit 60ccd03

Browse files
committed
cpplint
1 parent 4cf6533 commit 60ccd03

13 files changed

Lines changed: 27 additions & 24 deletions

stan/math/prim/fun/cholesky_factor_constrain.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ cholesky_factor_constrain(const T& x, int M, int N) {
3737
"((N * (N + 1)) / 2 + (M - N) * N)",
3838
((N * (N + 1)) / 2 + (M - N) * N));
3939
Eigen::Matrix<T_scalar, Eigen::Dynamic, Eigen::Dynamic> y(M, N);
40-
T_scalar zero(0);
4140
int pos = 0;
4241

4342
const auto& x_ref = to_ref(x);

stan/math/prim/fun/gp_exponential_cov.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,6 @@ gp_exponential_cov(const std::vector<Eigen::Matrix<T_x1, -1, 1>> &x1,
282282
}
283283

284284
T_s sigma_sq = square(sigma);
285-
T_l temp;
286285

287286
std::vector<Eigen::Matrix<return_type_t<T_x1, T_l>, -1, 1>> x1_new
288287
= divide_columns(x1, length_scale);

stan/math/prim/fun/lb_free.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,6 @@ inline auto lb_free(T&& y, L&& lb) {
8282
*/
8383
template <typename T, typename L, require_not_std_vector_t<L>* = nullptr>
8484
inline auto lb_free(const std::vector<T> y, const L& lb) {
85-
auto&& lb_ref = to_ref(lb);
8685
std::vector<decltype(lb_free(y[0], lb))> ret(y.size());
8786
std::transform(y.begin(), y.end(), ret.begin(),
8887
[&lb](auto&& yy) { return lb_free(yy, lb); });

stan/math/prim/fun/stan_print.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ void stan_print(std::ostream* o, const T& x) {
7171
template <typename T, require_tuple_t<T>*>
7272
void stan_print(std::ostream* o, const T& x) {
7373
*o << '(';
74-
constexpr auto tuple_size = std::tuple_size<std::decay_t<T>>::value;
7574
size_t i = 0;
7675
stan::math::for_each(
7776
[&i, o](auto&& elt) {

stan/math/prim/functor/hcubature.hpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -490,7 +490,9 @@ double hcubature(const F& integrand, const T_pars& pars, const int& dim,
490490
std::vector<double> mb(box.b);
491491
mb[box.kdiv] -= w;
492492

493-
double result_1, result_2, err_1, err_2, kdivide_1, kdivide_2;
493+
double result_1, result_2, err_1, err_2;
494+
double kdivide_1 = math::NOT_A_NUMBER;
495+
double kdivide_2 = math::NOT_A_NUMBER;
494496

495497
if (dim == 1) {
496498
std::tie(result_1, err_1)

stan/math/prim/functor/operands_and_partials.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ class ops_partials_edge;
5555
*/
5656
template <typename ViewElt, typename Op>
5757
class ops_partials_edge<ViewElt, Op, require_st_arithmetic<Op>> {
58+
public:
5859
using inner_op = std::conditional_t<is_eigen<value_type_t<Op>>::value,
5960
value_type_t<Op>, Op>;
6061
using partials_t = empty_broadcast_array<ViewElt, inner_op>;

stan/math/rev/core/precomputed_gradients.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,10 @@ class precomputed_gradients_vari_template : public vari {
8080
size_(size),
8181
varis_(varis),
8282
gradients_(gradients),
83-
container_operands_(index_apply<N_containers>([&, this](auto... Is) {
83+
container_operands_(index_apply<N_containers>([&](auto... Is) {
8484
return std::make_tuple(to_arena(std::get<Is>(container_operands))...);
8585
})),
86-
container_gradients_(index_apply<N_containers>([&, this](auto... Is) {
86+
container_gradients_(index_apply<N_containers>([&](auto... Is) {
8787
return std::make_tuple(
8888
to_arena(std::get<Is>(container_gradients))...);
8989
})) {
@@ -123,10 +123,10 @@ class precomputed_gradients_vari_template : public vari {
123123
vars.size())),
124124
gradients_(ChainableStack::instance_->memalloc_.alloc_array<double>(
125125
vars.size())),
126-
container_operands_(index_apply<N_containers>([&, this](auto... Is) {
126+
container_operands_(index_apply<N_containers>([&](auto... Is) {
127127
return std::make_tuple(to_arena(std::get<Is>(container_operands))...);
128128
})),
129-
container_gradients_(index_apply<N_containers>([&, this](auto... Is) {
129+
container_gradients_(index_apply<N_containers>([&](auto... Is) {
130130
return std::make_tuple(
131131
to_arena(std::get<Is>(container_gradients))...);
132132
})) {

stan/math/rev/core/vari.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -848,7 +848,7 @@ class vari_value<T, require_eigen_sparse_base_t<T>> : public vari_base,
848848
*/
849849
template <typename S, require_convertible_t<S&, T>* = nullptr>
850850
explicit vari_value(S&& x)
851-
: adj_(x), val_(std::forward<S>(x)), chainable_alloc() {
851+
: chainable_alloc(), adj_(x), val_(std::forward<S>(x)) {
852852
this->set_zero_adjoint();
853853
ChainableStack::instance_->var_stack_.push_back(this);
854854
}
@@ -871,7 +871,7 @@ class vari_value<T, require_eigen_sparse_base_t<T>> : public vari_base,
871871
*/
872872
template <typename S, require_convertible_t<S&, T>* = nullptr>
873873
vari_value(S&& x, bool stacked)
874-
: adj_(x), val_(std::forward<S>(x)), chainable_alloc() {
874+
: chainable_alloc(), adj_(x), val_(std::forward<S>(x)) {
875875
this->set_zero_adjoint();
876876
if (stacked) {
877877
ChainableStack::instance_->var_stack_.push_back(this);

stan/math/rev/fun/inv_inc_beta.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ inline var inv_inc_beta(const T1& a, const T2& b, const T3& p) {
5959
double b_val = value_of(b);
6060
double p_val = value_of(p);
6161
double w = inv_inc_beta(a_val, b_val, p_val);
62-
return make_callback_var(w, [a, b, p, a_val, b_val, p_val, w](auto& vi) {
62+
return make_callback_var(w, [a, b, p, a_val, b_val, w](auto& vi) {
6363
double log_w = log(w);
6464
double log1m_w = log1m(w);
6565
double one_m_a = 1 - a_val;

stan/math/rev/functor/cvodes_integrator_adjoint.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,8 @@ class cvodes_integrator_adjoint_vari : public vari_base {
9393
N_Vector nv_absolute_tolerance_forward_;
9494
N_Vector nv_absolute_tolerance_backward_;
9595
SUNMatrix A_forward_;
96-
SUNLinearSolver LS_forward_;
9796
SUNMatrix A_backward_;
97+
SUNLinearSolver LS_forward_;
9898
SUNLinearSolver LS_backward_;
9999
void* cvodes_mem_;
100100
std::tuple<T_Args...> local_args_tuple_;

0 commit comments

Comments
 (0)