Skip to content

Commit

Permalink
[Jenkins] auto-formatting by clang-format version 10.0.0-4ubuntu1
Browse files Browse the repository at this point in the history
  • Loading branch information
stan-buildbot committed Nov 11, 2024
1 parent 39e9930 commit 3f065fa
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
2 changes: 1 addition & 1 deletion stan/math/prim/meta/is_eigen.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ struct scalar_type<T, std::enable_if_t<is_eigen<T>::value>> {
*/
template <typename T>
struct value_type<T, std::enable_if_t<is_eigen<T>::value>> {
using type = typename Eigen::internal::traits<std::decay_t<T>>::Scalar;
using type = typename Eigen::internal::traits<std::decay_t<T>>::Scalar;
};

/*! \ingroup require_eigens_types */
Expand Down
21 changes: 11 additions & 10 deletions test/unit/math/prim/meta/value_type_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@ TEST(MathMetaPrim, value_type_vector) {
using std::vector;

EXPECT_SAME_TYPE(vector<double>::value_type,
value_type<vector<double> >::type);
value_type<vector<double>>::type);

EXPECT_SAME_TYPE(vector<double>::value_type,
value_type<const vector<double> >::type);
value_type<const vector<double>>::type);

EXPECT_SAME_TYPE(vector<vector<int> >::value_type,
value_type<vector<vector<int> > >::type);
EXPECT_SAME_TYPE(vector<vector<int>>::value_type,
value_type<vector<vector<int>>>::type);

EXPECT_SAME_TYPE(vector<vector<int> >::value_type,
value_type<const vector<vector<int> > >::type);
EXPECT_SAME_TYPE(vector<vector<int>>::value_type,
value_type<const vector<vector<int>>>::type);
}

TEST(MathMetaPrim, value_type_matrix) {
Expand All @@ -34,13 +34,14 @@ TEST(MathMetaPrim, value_type_matrix) {
value_type<Eigen::RowVectorXd>::type);

EXPECT_SAME_TYPE(Eigen::RowVectorXd,
value_type<std::vector<Eigen::RowVectorXd> >::type);
value_type<std::vector<Eigen::RowVectorXd>>::type);
}

TEST(MathMetaPrim, value_type_kronecker) {
Eigen::Matrix<double,2,2> A;
const auto B = Eigen::kroneckerProduct(A, Eigen::Matrix<double,2,2>::Identity());
Eigen::Matrix<double,4,1> C = Eigen::Matrix<double,4,1>::Random(4, 1);
Eigen::Matrix<double, 2, 2> A;
const auto B
= Eigen::kroneckerProduct(A, Eigen::Matrix<double, 2, 2>::Identity());
Eigen::Matrix<double, 4, 1> C = Eigen::Matrix<double, 4, 1>::Random(4, 1);
EXPECT_TRUE((std::is_same<double, stan::value_type_t<decltype(B)>>::value));
Eigen::MatrixXd D = B * C;
}

0 comments on commit 3f065fa

Please sign in to comment.