Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
dynare
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Stéphane Adjemian
dynare
Commits
79153ab1
Verified
Commit
79153ab1
authored
1 year ago
by
Sébastien Villemot
Browse files
Options
Downloads
Patches
Plain Diff
C++20 modernization: use some concepts
parent
c28b1b6e
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
mex/sources/sobol/gaussian.hh
+6
-5
6 additions, 5 deletions
mex/sources/sobol/gaussian.hh
mex/sources/sobol/sobol.hh
+3
-2
3 additions, 2 deletions
mex/sources/sobol/sobol.hh
with
9 additions
and
7 deletions
mex/sources/sobol/gaussian.hh
+
6
−
5
View file @
79153ab1
...
...
@@ -28,6 +28,7 @@
#include
<algorithm>
#include
<array>
#include
<cmath>
#include
<concepts>
#include
<limits>
#include
<numbers>
#include
<vector>
...
...
@@ -41,7 +42,7 @@ using namespace std;
constexpr
double
lb
=
.02425
;
constexpr
double
ub
=
.97575
;
template
<
typename
T
>
template
<
floating_point
T
>
T
icdf
(
const
T
uniform
)
/*
...
...
@@ -105,7 +106,7 @@ icdf(const T uniform)
}
void
icdfm
(
int
n
,
auto
*
U
)
icdfm
(
int
n
,
floating_point
auto
*
U
)
{
#pragma omp parallel for
for
(
int
i
=
0
;
i
<
n
;
i
++
)
...
...
@@ -114,7 +115,7 @@ icdfm(int n, auto* U)
}
void
icdfmSigma
(
int
d
,
int
n
,
auto
*
U
,
const
double
*
LowerCholSigma
)
icdfmSigma
(
int
d
,
int
n
,
floating_point
auto
*
U
,
const
double
*
LowerCholSigma
)
{
double
one
=
1.0
;
double
zero
=
0.0
;
...
...
@@ -127,7 +128,7 @@ icdfmSigma(int d, int n, auto* U, const double* LowerCholSigma)
}
void
usphere
(
int
d
,
int
n
,
auto
*
U
)
usphere
(
int
d
,
int
n
,
floating_point
auto
*
U
)
{
icdfm
(
n
*
d
,
U
);
#pragma omp parallel for
...
...
@@ -145,7 +146,7 @@ usphere(int d, int n, auto* U)
}
void
usphereRadius
(
int
d
,
int
n
,
double
radius
,
auto
*
U
)
usphereRadius
(
int
d
,
int
n
,
double
radius
,
floating_point
auto
*
U
)
{
icdfm
(
n
*
d
,
U
);
#pragma omp parallel for
...
...
This diff is collapsed.
Click to expand it.
mex/sources/sobol/sobol.hh
+
3
−
2
View file @
79153ab1
/* Interface to quasi Monte Carlo sequences (à la Sobol) routines.
*
* Copyright © 2010-202
3
Dynare Team
* Copyright © 2010-202
4
Dynare Team
*
* This file is part of Dynare.
*
...
...
@@ -21,6 +21,7 @@
#ifndef SOBOL_HH
#define SOBOL_HH
#include
<concepts>
#include
<cstdint>
#include
<dynblas.h>
// For the FORTRAN_WRAPPER macro
...
...
@@ -48,7 +49,7 @@ sobol_block(int dimension, int block_size, int64_t seed, double* block)
return
seed
;
}
template
<
typename
T
>
template
<
floating_point
T
>
void
expand_unit_hypercube
(
int
dimension
,
int
block_size
,
T
*
block
,
const
T
*
lower_bound
,
const
T
*
upper_bound
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment