Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Francesco Brarda
stan-math-petsc
Commits
c91dfafd
Commit
c91dfafd
authored
6 years ago
by
Stan Jenkins
Browse files
Options
Download
Email Patches
Plain Diff
[Jenkins] auto-formatting by clang-format version 5.0.0-3~16.04.1 (tags/RELEASE_500/final)
parent
9aad527a
stan-petsc
bugfix/1152-algebra_solver-lambdas
bugfix/issue-1250-lgamma
bugfix/issue-1270-add-check-for-meta-includes
code-cleanup/chain-final
code-cleanup/issue-937-flatten
develop
feature/1258-ad-test-core
feature/automatic-autodiff-testing
feature/concept-chainable-allocator
feature/eigen-aligned-malloc
feature/faster-ad-tls
feature/faster-ad-tls-v2
feature/faster-ad-tls-v3
feature/faster-ad-tls-v4
feature/faster-ad-tls-v4-windows
feature/faster-ad-tls-v6
feature/intel-tbb-lib
feature/issue-1012-binorm-copula-cdf
feature/issue-1115-newton_solver
feature/issue-123-complex
feature/issue-1257-diff_algebra_solver
feature/issue-755-laplace
feature/issue-937-flatten-meta-again
feature/issue-937-flatten-meta-the-third
feature/issue-937-flatten-meta-third
feature/issue-962-bivar-norm
feature/issue-989-rev-mat-eig
feature/lambertw
feature/map_rect-cpp17
feature/map_rect-fail-windows
feature/matrix_sqrt
feature/parallel_for_each
feature/python-test-math-dependencies
feature/refactor-nested
feature/sparse-cholesky
internal/no-assert
issue-static-init-order
master
mpi_errors
parallel-ad-tape-3
release/v2.19.0
release/v2.19.1
release/v2.20.0
seantest/faster-ad-tls-v3
stancon/syclik
syclik/forward-mode
v2.20.0
v2.19.1
v2.19.0
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
test/unit/math/fwd/scal/meta/ad_promotable_test.cpp
+25
-25
test/unit/math/fwd/scal/meta/ad_promotable_test.cpp
test/unit/math/mix/scal/meta/ad_promotable_test.cpp
+51
-34
test/unit/math/mix/scal/meta/ad_promotable_test.cpp
test/unit/math/rev/scal/meta/ad_promotable_test.cpp
+21
-30
test/unit/math/rev/scal/meta/ad_promotable_test.cpp
with
97 additions
and
89 deletions
+97
-89
test/unit/math/fwd/scal/meta/ad_promotable_test.cpp
View file @
c91dfafd
...
...
@@ -3,43 +3,43 @@
#include <string>
TEST
(
MathMeta
,
primitive_to_fvar
)
{
EXPECT_TRUE
(
(
stan
::
math
::
ad_promotable
<
bool
,
stan
::
math
::
fvar
<
double
>>::
value
));
EXPECT_TRUE
(
(
stan
::
math
::
ad_promotable
<
char
,
stan
::
math
::
fvar
<
double
>>::
value
));
EXPECT_TRUE
(
(
stan
::
math
::
ad_promotable
<
bool
,
stan
::
math
::
fvar
<
double
>>::
value
));
EXPECT_TRUE
(
(
stan
::
math
::
ad_promotable
<
char
,
stan
::
math
::
fvar
<
double
>>::
value
));
EXPECT_TRUE
((
stan
::
math
::
ad_promotable
<
unsigned
char
,
stan
::
math
::
fvar
<
double
>>::
value
));
stan
::
math
::
fvar
<
double
>>::
value
));
// NOLINTNEXTLINE(runtime/int)
EXPECT_TRUE
(
(
stan
::
math
::
ad_promotable
<
short
,
stan
::
math
::
fvar
<
double
>>::
value
));
EXPECT_TRUE
(
(
stan
::
math
::
ad_promotable
<
short
,
stan
::
math
::
fvar
<
double
>>::
value
));
// NOLINTNEXTLINE(runtime/int)
EXPECT_TRUE
((
stan
::
math
::
ad_promotable
<
unsigned
short
,
stan
::
math
::
fvar
<
double
>>::
value
));
EXPECT_TRUE
(
(
stan
::
math
::
ad_promotable
<
int
,
stan
::
math
::
fvar
<
double
>>::
value
));
stan
::
math
::
fvar
<
double
>>::
value
));
EXPECT_TRUE
(
(
stan
::
math
::
ad_promotable
<
int
,
stan
::
math
::
fvar
<
double
>>::
value
));
EXPECT_TRUE
((
stan
::
math
::
ad_promotable
<
unsigned
int
,
stan
::
math
::
fvar
<
double
>>::
value
));
stan
::
math
::
fvar
<
double
>>::
value
));
// NOLINTNEXTLINE(runtime/int)
EXPECT_TRUE
(
(
stan
::
math
::
ad_promotable
<
long
,
stan
::
math
::
fvar
<
double
>>::
value
));
EXPECT_TRUE
(
(
stan
::
math
::
ad_promotable
<
long
,
stan
::
math
::
fvar
<
double
>>::
value
));
// NOLINTNEXTLINE(runtime/int)
EXPECT_TRUE
((
stan
::
math
::
ad_promotable
<
unsigned
long
,
stan
::
math
::
fvar
<
double
>>::
value
));
stan
::
math
::
fvar
<
double
>>::
value
));
// NOLINTNEXTLINE(runtime/int)
EXPECT_TRUE
(
(
stan
::
math
::
ad_promotable
<
long
long
,
stan
::
math
::
fvar
<
double
>>::
value
));
EXPECT_TRUE
(
(
stan
::
math
::
ad_promotable
<
long
long
,
stan
::
math
::
fvar
<
double
>>::
value
));
// NOLINTNEXTLINE(runtime/int)
EXPECT_TRUE
((
stan
::
math
::
ad_promotable
<
unsigned
long
long
,
stan
::
math
::
fvar
<
double
>>::
value
));
EXPECT_TRUE
(
(
stan
::
math
::
ad_promotable
<
float
,
stan
::
math
::
fvar
<
double
>>::
value
));
EXPECT_TRUE
(
(
stan
::
math
::
ad_promotable
<
double
,
stan
::
math
::
fvar
<
double
>>::
value
));
EXPECT_TRUE
((
stan
::
math
::
ad_promotable
<
long
double
,
stan
::
math
::
fvar
<
double
>>::
value
));
stan
::
math
::
fvar
<
double
>>::
value
));
EXPECT_TRUE
(
(
stan
::
math
::
ad_promotable
<
float
,
stan
::
math
::
fvar
<
double
>>::
value
));
EXPECT_TRUE
(
(
stan
::
math
::
ad_promotable
<
double
,
stan
::
math
::
fvar
<
double
>>::
value
));
EXPECT_TRUE
((
stan
::
math
::
ad_promotable
<
long
double
,
stan
::
math
::
fvar
<
double
>>::
value
));
}
TEST
(
MathMeta
,
nonprimitive_to_fvar
)
{
EXPECT_FALSE
((
stan
::
math
::
ad_promotable
<
std
::
string
,
stan
::
math
::
fvar
<
double
>>::
value
));
EXPECT_FALSE
((
stan
::
math
::
ad_promotable
<
std
::
string
,
stan
::
math
::
fvar
<
double
>>::
value
));
}
This diff is collapsed.
Click to expand it.
test/unit/math/mix/scal/meta/ad_promotable_test.cpp
View file @
c91dfafd
...
...
@@ -3,53 +3,70 @@
#include <string>
TEST
(
MathMeta
,
primitive_to_mix
)
{
EXPECT_TRUE
((
stan
::
math
::
ad_promotable
<
bool
,
stan
::
math
::
fvar
<
stan
::
math
::
var
>>::
value
));
EXPECT_TRUE
((
stan
::
math
::
ad_promotable
<
char
,
stan
::
math
::
fvar
<
stan
::
math
::
var
>>::
value
));
EXPECT_TRUE
((
stan
::
math
::
ad_promotable
<
unsigned
char
,
stan
::
math
::
fvar
<
stan
::
math
::
var
>>::
value
));
EXPECT_TRUE
(
(
stan
::
math
::
ad_promotable
<
bool
,
stan
::
math
::
fvar
<
stan
::
math
::
var
>>::
value
));
EXPECT_TRUE
(
(
stan
::
math
::
ad_promotable
<
char
,
stan
::
math
::
fvar
<
stan
::
math
::
var
>>::
value
));
EXPECT_TRUE
(
(
stan
::
math
::
ad_promotable
<
unsigned
char
,
stan
::
math
::
fvar
<
stan
::
math
::
var
>>::
value
));
// NOLINTNEXTLINE(runtime/int)
EXPECT_TRUE
((
stan
::
math
::
ad_promotable
<
short
,
stan
::
math
::
fvar
<
stan
::
math
::
var
>>::
value
));
EXPECT_TRUE
(
(
stan
::
math
::
ad_promotable
<
short
,
stan
::
math
::
fvar
<
stan
::
math
::
var
>>::
value
));
// NOLINTNEXTLINE(runtime/int)
EXPECT_TRUE
((
stan
::
math
::
ad_promotable
<
unsigned
short
,
stan
::
math
::
fvar
<
stan
::
math
::
var
>>::
value
));
EXPECT_TRUE
((
stan
::
math
::
ad_promotable
<
int
,
stan
::
math
::
fvar
<
stan
::
math
::
var
>>::
value
));
EXPECT_TRUE
((
stan
::
math
::
ad_promotable
<
unsigned
int
,
stan
::
math
::
fvar
<
stan
::
math
::
var
>>::
value
));
EXPECT_TRUE
(
(
stan
::
math
::
ad_promotable
<
unsigned
short
,
stan
::
math
::
fvar
<
stan
::
math
::
var
>>::
value
));
EXPECT_TRUE
(
(
stan
::
math
::
ad_promotable
<
int
,
stan
::
math
::
fvar
<
stan
::
math
::
var
>>::
value
));
EXPECT_TRUE
(
(
stan
::
math
::
ad_promotable
<
unsigned
int
,
stan
::
math
::
fvar
<
stan
::
math
::
var
>>::
value
));
// NOLINTNEXTLINE(runtime/int)
EXPECT_TRUE
((
stan
::
math
::
ad_promotable
<
long
,
stan
::
math
::
fvar
<
stan
::
math
::
var
>>::
value
));
EXPECT_TRUE
(
(
stan
::
math
::
ad_promotable
<
long
,
stan
::
math
::
fvar
<
stan
::
math
::
var
>>::
value
));
// NOLINTNEXTLINE(runtime/int)
EXPECT_TRUE
((
stan
::
math
::
ad_promotable
<
unsigned
long
,
stan
::
math
::
fvar
<
stan
::
math
::
var
>>::
value
));
EXPECT_TRUE
(
(
stan
::
math
::
ad_promotable
<
unsigned
long
,
stan
::
math
::
fvar
<
stan
::
math
::
var
>>::
value
));
// NOLINTNEXTLINE(runtime/int)
EXPECT_TRUE
((
stan
::
math
::
ad_promotable
<
long
long
,
stan
::
math
::
fvar
<
stan
::
math
::
var
>>::
value
));
EXPECT_TRUE
(
(
stan
::
math
::
ad_promotable
<
long
long
,
stan
::
math
::
fvar
<
stan
::
math
::
var
>>::
value
));
// NOLINTNEXTLINE(runtime/int)
EXPECT_TRUE
((
stan
::
math
::
ad_promotable
<
unsigned
long
long
,
stan
::
math
::
fvar
<
stan
::
math
::
var
>>::
value
));
EXPECT_TRUE
((
stan
::
math
::
ad_promotable
<
float
,
stan
::
math
::
fvar
<
stan
::
math
::
var
>>::
value
));
EXPECT_TRUE
((
stan
::
math
::
ad_promotable
<
double
,
stan
::
math
::
fvar
<
stan
::
math
::
var
>>::
value
));
EXPECT_TRUE
((
stan
::
math
::
ad_promotable
<
long
double
,
stan
::
math
::
fvar
<
stan
::
math
::
var
>>::
value
));
EXPECT_TRUE
(
(
stan
::
math
::
ad_promotable
<
unsigned
long
long
,
stan
::
math
::
fvar
<
stan
::
math
::
var
>>::
value
));
EXPECT_TRUE
(
(
stan
::
math
::
ad_promotable
<
float
,
stan
::
math
::
fvar
<
stan
::
math
::
var
>>::
value
));
EXPECT_TRUE
(
(
stan
::
math
::
ad_promotable
<
double
,
stan
::
math
::
fvar
<
stan
::
math
::
var
>>::
value
));
EXPECT_TRUE
(
(
stan
::
math
::
ad_promotable
<
long
double
,
stan
::
math
::
fvar
<
stan
::
math
::
var
>>::
value
));
}
TEST
(
MathMeta
,
rev_to_mix
)
{
EXPECT_TRUE
((
stan
::
math
::
ad_promotable
<
stan
::
math
::
var
,
stan
::
math
::
fvar
<
stan
::
math
::
var
>>::
value
));
EXPECT_TRUE
(
(
stan
::
math
::
ad_promotable
<
stan
::
math
::
var
,
stan
::
math
::
fvar
<
stan
::
math
::
var
>>::
value
));
}
TEST
(
MathMeta
,
fwd_to_mix
)
{
EXPECT_FALSE
((
stan
::
math
::
ad_promotable
<
stan
::
math
::
fvar
<
double
>
,
stan
::
math
::
fvar
<
stan
::
math
::
var
>>::
value
));
EXPECT_FALSE
(
(
stan
::
math
::
ad_promotable
<
stan
::
math
::
fvar
<
double
>
,
stan
::
math
::
fvar
<
stan
::
math
::
var
>>::
value
));
}
TEST
(
MathMeta
,
nonprimitive_to_mix
)
{
EXPECT_FALSE
((
stan
::
math
::
ad_promotable
<
std
::
string
,
stan
::
math
::
fvar
<
stan
::
math
::
var
>>::
value
));
EXPECT_FALSE
(
(
stan
::
math
::
ad_promotable
<
std
::
string
,
stan
::
math
::
fvar
<
stan
::
math
::
var
>>::
value
));
}
This diff is collapsed.
Click to expand it.
test/unit/math/rev/scal/meta/ad_promotable_test.cpp
View file @
c91dfafd
...
...
@@ -3,43 +3,34 @@
#include <string>
TEST
(
MathMeta
,
primitive_to_var
)
{
EXPECT_TRUE
((
stan
::
math
::
ad_promotable
<
bool
,
stan
::
math
::
var
>::
value
));
EXPECT_TRUE
((
stan
::
math
::
ad_promotable
<
char
,
stan
::
math
::
var
>::
value
));
EXPECT_TRUE
((
stan
::
math
::
ad_promotable
<
unsigned
char
,
stan
::
math
::
var
>::
value
));
EXPECT_TRUE
((
stan
::
math
::
ad_promotable
<
bool
,
stan
::
math
::
var
>::
value
));
EXPECT_TRUE
((
stan
::
math
::
ad_promotable
<
char
,
stan
::
math
::
var
>::
value
));
EXPECT_TRUE
(
(
stan
::
math
::
ad_promotable
<
unsigned
char
,
stan
::
math
::
var
>::
value
));
// NOLINTNEXTLINE(runtime/int)
EXPECT_TRUE
((
stan
::
math
::
ad_promotable
<
short
,
stan
::
math
::
var
>::
value
));
EXPECT_TRUE
((
stan
::
math
::
ad_promotable
<
short
,
stan
::
math
::
var
>::
value
));
// NOLINTNEXTLINE(runtime/int)
EXPECT_TRUE
((
stan
::
math
::
ad_promotable
<
unsigned
short
,
stan
::
math
::
var
>::
value
));
EXPECT_TRUE
((
stan
::
math
::
ad_promotable
<
int
,
stan
::
math
::
var
>::
value
));
EXPECT_TRUE
((
stan
::
math
::
ad_promotable
<
unsigned
int
,
stan
::
math
::
var
>::
value
));
EXPECT_TRUE
(
(
stan
::
math
::
ad_promotable
<
unsigned
short
,
stan
::
math
::
var
>::
value
));
EXPECT_TRUE
((
stan
::
math
::
ad_promotable
<
int
,
stan
::
math
::
var
>::
value
));
EXPECT_TRUE
(
(
stan
::
math
::
ad_promotable
<
unsigned
int
,
stan
::
math
::
var
>::
value
));
// NOLINTNEXTLINE(runtime/int)
EXPECT_TRUE
((
stan
::
math
::
ad_promotable
<
long
,
stan
::
math
::
var
>::
value
));
EXPECT_TRUE
((
stan
::
math
::
ad_promotable
<
long
,
stan
::
math
::
var
>::
value
));
// NOLINTNEXTLINE(runtime/int)
EXPECT_TRUE
(
(
stan
::
math
::
ad_promotable
<
unsigned
long
,
stan
::
math
::
var
>::
value
));
EXPECT_TRUE
(
(
stan
::
math
::
ad_promotable
<
unsigned
long
,
stan
::
math
::
var
>::
value
));
// NOLINTNEXTLINE(runtime/int)
EXPECT_TRUE
((
stan
::
math
::
ad_promotable
<
long
long
,
stan
::
math
::
var
>::
value
));
EXPECT_TRUE
((
stan
::
math
::
ad_promotable
<
long
long
,
stan
::
math
::
var
>::
value
));
// NOLINTNEXTLINE(runtime/int)
EXPECT_TRUE
((
stan
::
math
::
ad_promotable
<
unsigned
long
long
,
stan
::
math
::
var
>::
value
));
EXPECT_TRUE
((
stan
::
math
::
ad_promotable
<
float
,
stan
::
math
::
var
>::
value
));
EXPECT_TRUE
((
stan
::
math
::
ad_promotable
<
double
,
stan
::
math
::
var
>::
value
));
EXPECT_TRUE
((
stan
::
math
::
ad_promotable
<
long
double
,
stan
::
math
::
var
>::
value
));
EXPECT_TRUE
(
(
stan
::
math
::
ad_promotable
<
unsigned
long
long
,
stan
::
math
::
var
>::
value
));
EXPECT_TRUE
((
stan
::
math
::
ad_promotable
<
float
,
stan
::
math
::
var
>::
value
));
EXPECT_TRUE
((
stan
::
math
::
ad_promotable
<
double
,
stan
::
math
::
var
>::
value
));
EXPECT_TRUE
((
stan
::
math
::
ad_promotable
<
long
double
,
stan
::
math
::
var
>::
value
));
}
TEST
(
MathMeta
,
nonprimitive_to_var
)
{
EXPECT_FALSE
(
(
stan
::
math
::
ad_promotable
<
std
::
string
,
stan
::
math
::
var
>::
value
));
EXPECT_FALSE
(
(
stan
::
math
::
ad_promotable
<
std
::
string
,
stan
::
math
::
var
>::
value
));
}
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help