Skip to content

Commit dec359c

Browse files
committed
add tests for vector<var<Matrix>> types to abs() mix tests
1 parent df0bc12 commit dec359c

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

test/unit/math/mix/fun/abs_test.cpp

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,65 +78,85 @@ TEST(mixFun, abs) {
7878
using v_t = Eigen::VectorXd;
7979
v_t a0(0);
8080
stan::test::expect_ad(f, a0);
81+
stan::test::expect_ad_matvar(f, a0);
8182
v_t a1(1);
8283
a1 << 1.9;
8384
stan::test::expect_ad(f, a1);
85+
stan::test::expect_ad_matvar(f, a1);
8486
v_t a2(2);
8587
a2 << 1.9, -2.3;
8688
stan::test::expect_ad(f, a2);
89+
stan::test::expect_ad_matvar(f, a2);
8790

8891
// RowVectorXd
8992
using rv_t = Eigen::RowVectorXd;
9093
rv_t b0(0);
9194
stan::test::expect_ad(f, b0);
95+
stan::test::expect_ad_matvar(f, b0);
9296
rv_t b1(1);
9397
b1 << 1.9;
9498
stan::test::expect_ad(f, b1);
99+
stan::test::expect_ad_matvar(f, b1);
95100
rv_t b2(2);
96101
b2 << 1.9, -2.3;
97102
stan::test::expect_ad(f, b2);
103+
stan::test::expect_ad_matvar(f, b2);
98104

99105
// MatrixXd
100106
using m_t = Eigen::MatrixXd;
101107
m_t c0(0, 0);
102108
stan::test::expect_ad(f, c0);
109+
stan::test::expect_ad_matvar(f, c0);
103110
m_t c0i(0, 2);
104111
stan::test::expect_ad(f, c0i);
112+
stan::test::expect_ad_matvar(f, c0i);
105113
m_t c0ii(2, 0);
106114
stan::test::expect_ad(f, c0ii);
115+
stan::test::expect_ad_matvar(f, c0ii);
107116
m_t c2(2, 1);
108117
c2 << 1.3, -2.9;
109118
stan::test::expect_ad(f, c2);
119+
stan::test::expect_ad_matvar(f, c2);
110120
m_t c6(3, 2);
111121
c6 << 1.3, 2.9, -13.456, 1.898, -0.01, 1.87e21;
112122
stan::test::expect_ad(f, c6);
123+
stan::test::expect_ad_matvar(f, c6);
113124

114125
// vector<VectorXd>
115126
using av_t = std::vector<Eigen::VectorXd>;
116127
av_t d0;
117128
stan::test::expect_ad(f, d0);
129+
stan::test::expect_ad_matvar(f, d0);
118130
av_t d1{a0};
119131
stan::test::expect_ad(f, d1);
132+
stan::test::expect_ad_matvar(f, d1);
120133
av_t d2{a1, a2};
121134
stan::test::expect_ad(f, d2);
135+
stan::test::expect_ad_matvar(f, d2);
122136

123137
// vector<RowVectorXd>
124138
using arv_t = std::vector<Eigen::RowVectorXd>;
125139
arv_t e0;
126140
stan::test::expect_ad(f, e0);
141+
stan::test::expect_ad_matvar(f, e0);
127142
arv_t e1{b0};
128143
stan::test::expect_ad(f, e1);
144+
stan::test::expect_ad_matvar(f, e1);
129145
arv_t e2{b1, b2};
130146
stan::test::expect_ad(f, e2);
147+
stan::test::expect_ad_matvar(f, e2);
131148

132149
// vector<MatrixXd>
133150
using am_t = std::vector<Eigen::MatrixXd>;
134151
am_t g0;
135152
stan::test::expect_ad(f, g0);
153+
stan::test::expect_ad_matvar(f, g0);
136154
am_t g1{c0};
137155
stan::test::expect_ad(f, g1);
156+
stan::test::expect_ad_matvar(f, g1);
138157
am_t g2{c2, c6};
139158
stan::test::expect_ad(f, g2);
159+
stan::test::expect_ad_matvar(f, g2);
140160

141161
// VectorXcd
142162
using vc_t = Eigen::VectorXcd;

0 commit comments

Comments
 (0)