Skip to content

Commit f52fff8

Browse files
committed
Merge branch 'develop' of github.com:stan-dev/math into develop
2 parents e45ba28 + 57fe69b commit f52fff8

File tree

179 files changed

+2875
-600
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

179 files changed

+2875
-600
lines changed

.github/ISSUE_TEMPLATE.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@ If this is a **feature request**, show what you expect to happen if the feature
2525

2626

2727
#### Current Version:
28-
v4.3.2
28+
v4.4.0

.github/dependabot.yml

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "github-actions"
4+
directory: "/"
5+
schedule:
6+
interval: "weekly"

.github/workflows/header_checks.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
workflow: c-cpp.yml
2626
if: "!startsWith(github.ref, 'refs/tags/') && github.ref != 'refs/heads/master' && github.ref != 'refs/heads/develop'"
2727

28-
- uses: actions/checkout@v2
28+
- uses: actions/checkout@v3
2929
- uses: actions/setup-python@v2
3030
with:
3131
python-version: '2.x'
@@ -57,7 +57,7 @@ jobs:
5757
workflow: c-cpp.yml
5858
if: "!startsWith(github.ref, 'refs/tags/') && github.ref != 'refs/heads/master' && github.ref != 'refs/heads/develop'"
5959

60-
- uses: actions/checkout@v2
60+
- uses: actions/checkout@v3
6161

6262
- name: Run header tests
6363
run: |
@@ -74,7 +74,7 @@ jobs:
7474
workflow: c-cpp.yml
7575
if: "!startsWith(github.ref, 'refs/tags/') && github.ref != 'refs/heads/master' && github.ref != 'refs/heads/develop'"
7676

77-
- uses: actions/checkout@v2
77+
- uses: actions/checkout@v3
7878

7979
- name: Run header tests
8080
run: |

.github/workflows/main.yml

+66-17
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,15 @@ jobs:
2222
with:
2323
token: ${{ secrets.GITHUB_TOKEN }}
2424
if: "!startsWith(github.ref, 'refs/tags/') && github.ref != 'refs/heads/master' && github.ref != 'refs/heads/develop'"
25-
26-
- uses: actions/checkout@v2
25+
26+
- uses: actions/checkout@v3
2727
- uses: actions/setup-python@v2
2828
with:
2929
python-version: '2.x'
3030
- uses: r-lib/actions/setup-r@v2
3131
with:
3232
r-version: 4.1.3
33-
33+
3434
- name: Set path for Rtools40
3535
if: runner.os == 'Windows'
3636
run: echo "C:/rtools40/usr/bin;C:/rtools40/mingw64/bin" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
@@ -58,9 +58,9 @@ jobs:
5858
python.exe runTests.py -j2 test/unit/math/prim
5959
python.exe runTests.py -j2 test/unit/math/rev
6060
python.exe runTests.py -j2 test/unit/math/memory
61-
61+
6262
- name: Upload gtest_output xml
63-
uses: actions/upload-artifact@v2
63+
uses: actions/upload-artifact@v3
6464
if: failure()
6565
with:
6666
name: gtest_outputs_xml
@@ -70,14 +70,14 @@ jobs:
7070
runs-on: windows-latest
7171

7272
steps:
73-
- uses: actions/checkout@v2
73+
- uses: actions/checkout@v3
7474
- uses: actions/setup-python@v2
7575
with:
7676
python-version: '2.x'
7777
- uses: r-lib/actions/setup-r@v2
7878
with:
7979
r-version: 4.1.3
80-
80+
8181
- name: Set path for Rtools40
8282
if: runner.os == 'Windows'
8383
run: echo "C:/rtools40/usr/bin;C:/rtools40/mingw64/bin" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
@@ -99,7 +99,7 @@ jobs:
9999
run: echo "D:/a/math/math/lib/tbb" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
100100
- name: Disable running fwd/mix tests
101101
shell: powershell
102-
run: echo "CXXFLAGS+= -DSTAN_MATH_TESTS_REV_ONLY" | Out-File -Append -FilePath make/local -Encoding utf8
102+
run: echo "CXXFLAGS+= -DSTAN_MATH_TESTS_REV_ONLY" | Out-File -Append -FilePath make/local -Encoding utf8
103103
- name: Run fwd unit tests and all the mix tests except those in mix/fun
104104
shell: powershell
105105
run: |
@@ -111,24 +111,24 @@ jobs:
111111
python.exe runTests.py test/unit/math/mix/*_test.cpp
112112
113113
- name: Upload gtest_output xml
114-
uses: actions/upload-artifact@v2
114+
uses: actions/upload-artifact@v3
115115
if: failure()
116116
with:
117117
name: gtest_outputs_xml
118118
path: '**/*_test.xml'
119-
mix-fun:
120-
name: mix/fun tests
119+
mix-fun-1:
120+
name: mix/fun tests 1
121121
runs-on: windows-latest
122122

123123
steps:
124-
- uses: actions/checkout@v2
124+
- uses: actions/checkout@v3
125125
- uses: actions/setup-python@v2
126126
with:
127127
python-version: '2.x'
128128
- uses: r-lib/actions/setup-r@v2
129129
with:
130130
r-version: 4.1.3
131-
131+
132132
- name: Set path for Rtools40
133133
if: runner.os == 'Windows'
134134
run: echo "C:/rtools40/usr/bin;C:/rtools40/mingw64/bin" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
@@ -147,14 +147,63 @@ jobs:
147147
run: mingw32-make -f make/standalone math-libs
148148
- name: Add TBB to PATH
149149
shell: powershell
150-
run: echo "D:/a/math/math/lib/tbb" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
150+
run: echo "D:/a/math/math/lib/tbb" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
151151
- name: Run mix/fun unit tests
152152
shell: powershell
153153
run: |
154-
python.exe runTests.py test/unit/math/mix/fun
155-
154+
$MixFunTests = Get-ChildItem -Path test\unit\math\mix\fun\* -Include *.cpp | Resolve-Path -Relative
155+
$NumberTests = $MixFunTests.Length
156+
$HalfNumberTests = [math]::Floor($NumberTests / 2)
157+
python.exe runTests.py $MixFunTests[0..$HalfNumberTests]
158+
159+
- name: Upload gtest_output xml
160+
uses: actions/upload-artifact@v3
161+
if: failure()
162+
with:
163+
name: gtest_outputs_xml
164+
path: '**/*_test.xml'
165+
mix-fun-2:
166+
name: mix/fun tests 2
167+
runs-on: windows-latest
168+
169+
steps:
170+
- uses: actions/checkout@v3
171+
- uses: actions/setup-python@v2
172+
with:
173+
python-version: '2.x'
174+
- uses: r-lib/actions/setup-r@v2
175+
with:
176+
r-version: 4.1.3
177+
178+
- name: Set path for Rtools40
179+
if: runner.os == 'Windows'
180+
run: echo "C:/rtools40/usr/bin;C:/rtools40/mingw64/bin" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
181+
- name: Install mingw32-make and check toolchain path
182+
if: runner.os == 'Windows'
183+
run: |
184+
pacman -Syu mingw-w64-x86_64-make --noconfirm
185+
g++ --version
186+
Get-Command g++ | Select-Object -ExpandProperty Definition
187+
mingw32-make --version
188+
Get-Command mingw32-make | Select-Object -ExpandProperty Definition
189+
shell: powershell
190+
191+
- name: Build Math libs
192+
shell: powershell
193+
run: mingw32-make -f make/standalone math-libs
194+
- name: Add TBB to PATH
195+
shell: powershell
196+
run: echo "D:/a/math/math/lib/tbb" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
197+
- name: Run mix/fun unit tests
198+
shell: powershell
199+
run: |
200+
$MixFunTests = Get-ChildItem -Path test\unit\math\mix\fun\* -Include *.cpp | Resolve-Path -Relative
201+
$NumberTests = $MixFunTests.Length
202+
$HalfNumberTests = [math]::Floor($NumberTests / 2)
203+
python.exe runTests.py $MixFunTests[($HalfNumberTests + 1)..($NumberTests - 1)]
204+
156205
- name: Upload gtest_output xml
157-
uses: actions/upload-artifact@v2
206+
uses: actions/upload-artifact@v3
158207
if: failure()
159208
with:
160209
name: gtest_outputs_xml

Jenkinsfile

+15-18
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ pipeline {
8787
}
8888
environment {
8989
STAN_NUM_THREADS = 4
90-
CLANG_CXX = 'clang++-6.0'
90+
CLANG_CXX = 'clang++-7'
9191
GCC = 'g++'
9292
MPICXX = 'mpicxx.openmpi'
9393
N_TESTS = 150
@@ -116,7 +116,7 @@ pipeline {
116116
stage("Clang-format") {
117117
agent {
118118
docker {
119-
image 'stanorg/ci:gpu'
119+
image 'stanorg/ci:gpu-cpp17'
120120
label 'linux'
121121
}
122122
}
@@ -167,7 +167,7 @@ pipeline {
167167
stage('Linting & Doc checks') {
168168
agent {
169169
docker {
170-
image 'stanorg/ci:gpu'
170+
image 'stanorg/ci:gpu-cpp17'
171171
label 'linux'
172172
}
173173
}
@@ -202,7 +202,7 @@ pipeline {
202202
stage('Verify changes') {
203203
agent {
204204
docker {
205-
image 'stanorg/ci:gpu'
205+
image 'stanorg/ci:gpu-cpp17'
206206
label 'linux'
207207
}
208208
}
@@ -224,7 +224,7 @@ pipeline {
224224
stage('Headers check') {
225225
agent {
226226
docker {
227-
image 'stanorg/ci:gpu'
227+
image 'stanorg/ci:gpu-cpp17'
228228
label 'linux'
229229
}
230230
}
@@ -252,7 +252,7 @@ pipeline {
252252
stage('Rev/Fwd Unit Tests') {
253253
agent {
254254
docker {
255-
image 'stanorg/ci:gpu'
255+
image 'stanorg/ci:gpu-cpp17'
256256
label 'linux'
257257
args '--cap-add SYS_PTRACE'
258258
}
@@ -275,7 +275,7 @@ pipeline {
275275
stage('Mix Unit Tests') {
276276
agent {
277277
docker {
278-
image 'stanorg/ci:gpu'
278+
image 'stanorg/ci:gpu-cpp17'
279279
label 'linux'
280280
args '--cap-add SYS_PTRACE'
281281
}
@@ -297,7 +297,7 @@ pipeline {
297297
stage('Prim Unit Tests') {
298298
agent {
299299
docker {
300-
image 'stanorg/ci:gpu'
300+
image 'stanorg/ci:gpu-cpp17'
301301
label 'linux'
302302
args '--cap-add SYS_PTRACE'
303303
}
@@ -313,7 +313,7 @@ pipeline {
313313
script {
314314
runTests("test/unit/*_test.cpp", false)
315315
runTests("test/unit/math/*_test.cpp", false)
316-
runTests("test/unit/math/prim", false)
316+
runTests("test/unit/math/prim", false)
317317
runTests("test/unit/math/memory", false)
318318
}
319319
}
@@ -332,7 +332,7 @@ pipeline {
332332
stage('MPI tests') {
333333
agent {
334334
docker {
335-
image 'stanorg/ci:gpu'
335+
image 'stanorg/ci:gpu-cpp17'
336336
label 'linux'
337337
}
338338
}
@@ -352,7 +352,7 @@ pipeline {
352352
stage('OpenCL GPU tests') {
353353
agent {
354354
docker {
355-
image 'stanorg/ci:gpu'
355+
image 'stanorg/ci:gpu-cpp17'
356356
label 'v100'
357357
args '--gpus 1'
358358
}
@@ -375,9 +375,8 @@ pipeline {
375375
stage('Distribution tests') {
376376
agent {
377377
docker {
378-
image 'stanorg/ci:gpu'
378+
image 'stanorg/ci:gpu-cpp17'
379379
label 'linux'
380-
args '--pull always'
381380
}
382381
}
383382
steps {
@@ -409,9 +408,8 @@ pipeline {
409408
stage('Expressions test') {
410409
agent {
411410
docker {
412-
image 'stanorg/ci:gpu'
411+
image 'stanorg/ci:gpu-cpp17'
413412
label 'linux'
414-
args '--pull always'
415413
}
416414
}
417415
steps {
@@ -445,9 +443,8 @@ pipeline {
445443
stage('Threading tests') {
446444
agent {
447445
docker {
448-
image 'stanorg/ci:gpu'
446+
image 'stanorg/ci:gpu-cpp17'
449447
label 'linux'
450-
args '--pull always'
451448
}
452449
}
453450
steps {
@@ -495,7 +492,7 @@ pipeline {
495492
stage('Upload doxygen') {
496493
agent {
497494
docker {
498-
image 'stanorg/ci:gpu'
495+
image 'stanorg/ci:gpu-cpp17'
499496
label 'linux'
500497
}
501498
}

RELEASE-NOTES.txt

+30
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,35 @@
11
Stan Math Library Release Notes
22

3+
======================================================================
4+
v4.4.0 (1 July 2022)
5+
======================================================================
6+
7+
Complex:
8+
- Added fast Fourier transform (FFT) implementations of 1D and 2D discrete Fourier transform and their inverses. (#2686, #2750)
9+
- Added type traits for detecting whether a type has a value type that is complex. (#2694)
10+
- Added vectorized versions of get_real and get_imag. (#2700)
11+
- Vectorized complex `abs()`, `to_complex`. (#2737, #2749)
12+
13+
New functions:
14+
- Added the incomplete beta function inverse. (#2637)
15+
- Added the `wishart_cholesky_lpdf`, which is the Cholesky parameterization of the Wishart distribution of both the input matrix and the scale matrix. (#2710)
16+
- Added the inverse Wishart Cholesky parameterization `lpdf\lupdf` is available along with `inv_wishart_cholesky_rng`. (#2713)
17+
- Added the Cholesky parameterization of the multivariate Student's T distribution. (#2715)
18+
- Added the quantile function of the standard normal density function with log input. (#2744)
19+
20+
Misc:
21+
- Upgraded Sundials to version 6.1.1. (#2692)
22+
- Updated Boost to 1.78.0. (#2725)
23+
- Added namespace qualifiers to `size` and `apply` calls for C++17 compatibility. (#2693)
24+
- Enabled address sanitizer and fix it when running inside Docker in Flatiron CI. (#2702)
25+
- Made `arena_allocator` usable for all std containers. (#2708)
26+
- Added gradient calculation for the a2 input in stan-math for the `grad_2F1` function and fixes incorrect return values when `z` is between -1 and 0. (#2721)
27+
- Updated the signatures of `eigenvalues` and `eigenvectors` to use our pseudo-concept require templates.(#2728)
28+
- `norm1` and `norm2` were extended with the `apply_vector_unary` to accept general std::vectors as well as the Eigen vectors previously supported. (#2742)
29+
- Cleaned up compiler warnings for unused variables and non-consistent use of class and struct for ops_partials_edge. (#2757)
30+
- Fixed the check for `y` in `gamma_lpdf` so that it now errors if y is not a positive finite value. (#2758)
31+
- Improved numerical stability of gamma_lcdf gradients (#2767)
32+
333
======================================================================
434
v4.3.2 (25 March 2022)
535
======================================================================

doxygen/doxygen.cfg

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ PROJECT_NAME = "Stan Math Library"
3838
# could be handy for archiving the generated documentation or if some version
3939
# control system is used.
4040

41-
PROJECT_NUMBER = 4.3.2
41+
PROJECT_NUMBER = 4.4.0
4242

4343
# Using the PROJECT_BRIEF tag one can provide an optional one line description
4444
# for a project that appears at the top of each page and should give viewer a

stan/math/fwd.hpp

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#include <stan/math/fwd/meta.hpp>
1212
#include <stan/math/fwd/fun.hpp>
1313
#include <stan/math/fwd/functor.hpp>
14+
#include <stan/math/fwd/prob.hpp>
1415

1516
#include <stan/math/prim.hpp>
1617

stan/math/fwd/fun.hpp

+1
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
#include <stan/math/fwd/fun/gamma_p.hpp>
4242
#include <stan/math/fwd/fun/gamma_q.hpp>
4343
#include <stan/math/fwd/fun/grad_inc_beta.hpp>
44+
#include <stan/math/fwd/fun/hypergeometric_pFq.hpp>
4445
#include <stan/math/fwd/fun/hypot.hpp>
4546
#include <stan/math/fwd/fun/inc_beta.hpp>
4647
#include <stan/math/fwd/fun/inv.hpp>

0 commit comments

Comments
 (0)