Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clang tidy cleanup and using std algorithms #1373

Closed
Changes from 1 commit
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
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
Prev Previous commit
Next Next commit
[Jenkins] auto-formatting by clang-format version 5.0.0-3~16.04.1 (ta…
…gs/RELEASE_500/final)
  • Loading branch information
stan-buildbot committed Oct 8, 2019
commit 86568360a73823e7c2563a4131518562fa21bdc0
15 changes: 7 additions & 8 deletions test/unit/math/rev/mat/fun/dot_product2_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ TEST(AgradRevMatrix, initializeVariable) {
EXPECT_FLOAT_EQ(7.0, cc(m).val());

Matrix<AVAR, Dynamic, Dynamic> init_val(3, 4);
vector<Matrix<AVAR, Dynamic, Dynamic> > dd(5, init_val);
vector<Matrix<AVAR, Dynamic, Dynamic>> dd(5, init_val);
initialize_variable(dd, AVAR(11.0));
for (size_t i = 0; i < dd.size(); ++i)
for (int m = 0; m < dd[0].rows(); ++m)
Expand Down Expand Up @@ -967,9 +967,9 @@ TEST(AgradRevMatrix, cumulative_sum) {
Eigen::Matrix<var, 1, Eigen::Dynamic> b;
EXPECT_FLOAT_EQ(0, cumulative_sum(b).size());

test_cumulative_sum<std::vector<var> >();
test_cumulative_sum<Eigen::Matrix<var, Eigen::Dynamic, 1> >();
test_cumulative_sum<Eigen::Matrix<var, 1, Eigen::Dynamic> >();
test_cumulative_sum<std::vector<var>>();
test_cumulative_sum<Eigen::Matrix<var, Eigen::Dynamic, 1>>();
test_cumulative_sum<Eigen::Matrix<var, 1, Eigen::Dynamic>>();
}

TEST(AgradRevMatrix, promoteElts) {
Expand Down Expand Up @@ -997,19 +997,18 @@ TEST(AgradRevMatrix, promoteElts) {

vector<double> x(5);
for (int i = 0; i < 5; ++i) {
x[i] = i * i;
x[i] = i * i;
}
vector<double> y = promote_common<vector<double>, vector<double>>(x);
EXPECT_EQ(5U, y.size());
for (int i = 0; i < 5; ++i) {
EXPECT_FLOAT_EQ(x[i], y[i]);
}
std::vector<var> z
= promote_common<std::vector<double>, std::vector<var>>(x);
std::vector<var> z = promote_common<std::vector<double>, std::vector<var>>(x);
EXPECT_EQ(5U, z.size());
for (int i = 0; i < 5; ++i)
EXPECT_FLOAT_EQ(x[i], z[i].val());
vector<var> w = promote_common<vector<var>, vector<var> >(z);
vector<var> w = promote_common<vector<var>, vector<var>>(z);
EXPECT_EQ(5U, w.size());
for (int i = 0; i < 5; ++i)
EXPECT_FLOAT_EQ(x[i], w[i].val());
Expand Down