Skip to content

Commit 89c0856

Browse files
committed
Merge commit '2fdd3ed700d48c0bfea46091be885d4bc787b7b8' into HEAD
2 parents 939f03c + 2fdd3ed commit 89c0856

6 files changed

Lines changed: 24 additions & 17 deletions

File tree

makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ doxygen:
8787
clean:
8888
@echo ' removing generated test files'
8989
@$(RM) $(wildcard test/prob/generate_tests$(EXE))
90+
@$(RM) $(EXPRESSION_TESTS) $(call findfiles,test/expressions,*_test.cpp)
9091
@$(RM) $(call findfiles,test/prob,*_generated_v_test.cpp)
9192
@$(RM) $(call findfiles,test/prob,*_generated_vv_test.cpp)
9293
@$(RM) $(call findfiles,test/prob,*_generated_fd_test.cpp)

runTests.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ def checkToolchainPathWindows():
383383
universal_newlines=True,
384384
)
385385
out, err = p1.communicate()
386-
if re.search(" |\(|\)", out):
386+
if re.search(r" |\(|\)", out):
387387
stopErr(
388388
"The RTools toolchain is installed in a path with spaces or bracket. Please reinstall to a valid path.",
389389
-1,

stan/math/prim/prob/wiener5_lpdf.hpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -679,12 +679,12 @@ inline auto wiener_lpdf(const T_y& y, const T_a& a, const T_t0& t0,
679679
if (!include_summand<propto, T_y, T_a, T_t0, T_w, T_v, T_sv>::value) {
680680
return ret_t(0.0);
681681
}
682-
using T_y_ref = ref_type_if_t<!is_constant<T_y>::value, T_y>;
683-
using T_a_ref = ref_type_if_t<!is_constant<T_a>::value, T_a>;
684-
using T_t0_ref = ref_type_if_t<!is_constant<T_t0>::value, T_t0>;
685-
using T_w_ref = ref_type_if_t<!is_constant<T_w>::value, T_w>;
686-
using T_v_ref = ref_type_if_t<!is_constant<T_v>::value, T_v>;
687-
using T_sv_ref = ref_type_if_t<!is_constant<T_sv>::value, T_sv>;
682+
using T_y_ref = ref_type_t<T_y>;
683+
using T_a_ref = ref_type_t<T_a>;
684+
using T_t0_ref = ref_type_t<T_t0>;
685+
using T_w_ref = ref_type_t<T_w>;
686+
using T_v_ref = ref_type_t<T_v>;
687+
using T_sv_ref = ref_type_t<T_sv>;
688688

689689
static constexpr const char* function_name = "wiener5_lpdf";
690690

stan/math/prim/prob/wiener_full_lpdf.hpp

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -327,14 +327,14 @@ inline auto wiener_lpdf(const T_y& y, const T_a& a, const T_t0& t0,
327327
return ret_t(0);
328328
}
329329

330-
using T_y_ref = ref_type_if_t<!is_constant<T_y>::value, T_y>;
331-
using T_a_ref = ref_type_if_t<!is_constant<T_a>::value, T_a>;
332-
using T_v_ref = ref_type_if_t<!is_constant<T_v>::value, T_v>;
333-
using T_w_ref = ref_type_if_t<!is_constant<T_w>::value, T_w>;
334-
using T_t0_ref = ref_type_if_t<!is_constant<T_t0>::value, T_t0>;
335-
using T_sv_ref = ref_type_if_t<!is_constant<T_sv>::value, T_sv>;
336-
using T_sw_ref = ref_type_if_t<!is_constant<T_sw>::value, T_sw>;
337-
using T_st0_ref = ref_type_if_t<!is_constant<T_st0>::value, T_st0>;
330+
using T_y_ref = ref_type_t<T_y>;
331+
using T_a_ref = ref_type_t<T_a>;
332+
using T_v_ref = ref_type_t<T_v>;
333+
using T_w_ref = ref_type_t<T_w>;
334+
using T_t0_ref = ref_type_t<T_t0>;
335+
using T_sv_ref = ref_type_t<T_sv>;
336+
using T_sw_ref = ref_type_t<T_sw>;
337+
using T_st0_ref = ref_type_t<T_st0>;
338338

339339
using T_partials_return
340340
= partials_return_t<T_y, T_a, T_t0, T_w, T_v, T_sv, T_sw, T_st0>;
@@ -449,6 +449,9 @@ inline auto wiener_lpdf(const T_y& y, const T_a& a, const T_t0& t0,
449449
// calculate density and partials
450450
for (size_t i = 0; i < N; i++) {
451451
if (sw_vec[i] == 0 && st0_vec[i] == 0) {
452+
// note: because we're delegating to wiener5_lpdf,
453+
// we need to make sure is_constant is consistent between
454+
// our inputs and these
452455
result += wiener_lpdf<propto>(y_vec[i], a_vec[i], t0_vec[i], w_vec[i],
453456
v_vec[i], sv_vec[i], precision_derivatives);
454457
continue;

test/generate_expression_tests.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ def save_tests_in_files(N_files, tests):
2929
for i in range(N_files):
3030
start = i * len(tests) // N_files
3131
end = (i + 1) * len(tests) // N_files
32+
if start >= end:
33+
# don't try to compile an empty file
34+
continue
3235
with open(src_folder + "tests%d_test.cpp" % i, "w") as out:
3336
out.write("#include <test/expressions/expression_test_helpers.hpp>\n\n")
3437
for test in tests[start:end]:
@@ -125,5 +128,5 @@ def main(functions=(), j=1):
125128
code = cg.cpp(),
126129
)
127130
)
128-
131+
129132
save_tests_in_files(j, tests)

test/sig_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ def get_cpp_type(stan_type):
132132
"uniform_lcdf": [None, 0.2, 0.9],
133133
"uniform_lpdf": [None, 0.2, 0.9],
134134
"uniform_rng": [0.2, 1.9, None],
135-
"wiener_lpdf": [0.8, None, 0.4, None, None],
135+
"wiener_lpdf": [0.8, None, 0.4, None, None, None, None, None],
136136
}
137137

138138
# list of functions we do not test. These are mainly functions implemented in compiler

0 commit comments

Comments
 (0)