Skip to content

Flatten /prim and finish flatten #1606

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 35 commits into from
Jan 12, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
3b32464
move scal
rok-cesnovar Jan 9, 2020
4ee0ad7
move arr
rok-cesnovar Jan 9, 2020
80b3667
move mat
rok-cesnovar Jan 9, 2020
9523ce8
Merge branch 'flatten-prim-arr' into flatten-prim
rok-cesnovar Jan 9, 2020
5ffd46e
Merge branch 'flatten-prim-mat' into flatten-prim
rok-cesnovar Jan 9, 2020
bf0f8b3
fix after merge
rok-cesnovar Jan 9, 2020
3988c07
Merge remote-tracking branch 'origin/develop' into flatten-prim
rok-cesnovar Jan 9, 2020
e661af1
fix headers
rok-cesnovar Jan 9, 2020
b2aa156
fix header guards
rok-cesnovar Jan 9, 2020
32e2f1a
remove checks for scal, arr, mat
rok-cesnovar Jan 9, 2020
1c69ea1
replace old headers
rok-cesnovar Jan 9, 2020
df0080d
Merge remote-tracking branch 'origin/flatten-prim-tests' into flatten…
rok-cesnovar Jan 9, 2020
8238401
add missing headers
rok-cesnovar Jan 9, 2020
11cbb8b
add missing functor.hpp file
rok-cesnovar Jan 10, 2020
3a9177f
Merge branch 'flatten-prim-tests' into flatten-prim
rok-cesnovar Jan 10, 2020
318312a
Merge branch 'flatten-prim-tests' into flatten-prim-scal
rok-cesnovar Jan 10, 2020
9be1563
fix header guards and includes
rok-cesnovar Jan 10, 2020
a5d7274
Merge branch 'flatten-prim-tests' into flatten-prim
rok-cesnovar Jan 10, 2020
352c2f4
Merge branch 'flatten-prim-tests' into flatten-prim-scal
rok-cesnovar Jan 10, 2020
a36fb94
Merge branch 'flatten-prim-scal' into flatten-prim
rok-cesnovar Jan 10, 2020
2019bfe
Merge branch 'flatten-prim-tests' into flatten-prim-scal
rok-cesnovar Jan 10, 2020
0797ab6
Merge branch 'flatten-prim-scal' into flatten-prim
rok-cesnovar Jan 10, 2020
a1e4bba
Merge branch 'develop' into flatten-prim-scal
rok-cesnovar Jan 10, 2020
c8ae43e
Merge branch 'flatten-prim-scal' into flatten-prim
rok-cesnovar Jan 10, 2020
cb58975
[Jenkins] auto-formatting by clang-format version 5.0.0-3~16.04.1 (ta…
stan-buildbot Jan 10, 2020
5a21970
cpplint fixes
rok-cesnovar Jan 10, 2020
1287e23
fix includes
rok-cesnovar Jan 10, 2020
ed7fdf6
[Jenkins] auto-formatting by clang-format version 5.0.0-3~16.04.1 (ta…
stan-buildbot Jan 10, 2020
56df309
cleanup acosh
rok-cesnovar Jan 11, 2020
5a1d445
reorder fill
rok-cesnovar Jan 11, 2020
078a484
fix the first batch of comments
rok-cesnovar Jan 11, 2020
35f9f62
Merge branch 'develop' into flatten-prim
rok-cesnovar Jan 11, 2020
a39b776
Merge branch 'develop' into flatten-prim
rok-cesnovar Jan 11, 2020
5a63413
fix order of includes
rok-cesnovar Jan 11, 2020
c4d575e
[Jenkins] auto-formatting by clang-format version 5.0.0-3~16.04.1 (ta…
stan-buildbot Jan 11, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion doxygen/contributor_help_pages/distribution_tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ Details:
The types of arguments that are valid are: `Int`, `Double`, `Ints`, and `Doubles`. The first two indicate that the argument is not vectorized and only takes single, scalar values. The last two plural versions indicate that the argument types are vectorized.
3. The next lines are includes. Most of the files will have:
```
\#include <stan/math/prim/scal.hpp>
\#include <stan/math/prim.hpp>
\#include <stdexcept>

```
Expand Down
40 changes: 1 addition & 39 deletions runChecks.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,35 +175,7 @@ def main():
},
]
errors.extend(grep_patterns("rev", "stan/math/rev", rev_checks))

# Check for files inside stan/math/*/scal that contain stan/math/*/arr or stan/math/*/mat
scal_checks = [
{
"pattern": "<stan/math/.*/arr/",
"message": "File includes an array header file.",
},
{"pattern": "<vector>", "message": "File includes an std::vector header."},
{"pattern": "std::vector", "message": "File uses std::vector."},
{
"pattern": "<stan/math/.*/mat/",
"message": "File includes a matrix header file.",
},
{"pattern": "<Eigen", "message": "File includes an Eigen header."},
{"pattern": "Eigen::", "message": "File uses Eigen."},
]
errors.extend(grep_patterns("scal", "stan/math/*/scal", scal_checks))

# Check for files inside stan/math/*/arr that contain stan/math/*/mat or Eigen
arr_checks = [
{
"pattern": "<stan/math/.*/mat/",
"message": "File includes an matrix header file.",
},
{"pattern": "<Eigen", "message": "File includes an Eigen header."},
{"pattern": "Eigen::", "message": "File uses Eigen."},
]
errors.extend(grep_patterns("arr", "stan/math/*/arr", arr_checks))


# Check to make sure we use C++14 constructs in stan/math
cpp14_checks = [
{
Expand Down Expand Up @@ -257,16 +229,6 @@ def main():
]
errors.extend(grep_patterns("C++14", "stan/math", cpp14_checks))

# Check for includes of stan/math/*/meta/*.hpp inside stan/math, excluding meta.hpp files and the /meta subfolder
meta_checks = [
{
"pattern": "<stan/math/.*/meta/.*hpp",
"message": "File includes */meta/*.hpp header file. Should include meta.hpp",
}
]
meta_exclude = ["stan/math/*/meta", "stan/math/*/meta.hpp"]
errors.extend(grep_patterns("meta", "stan/math", meta_checks, meta_exclude))

# Check that we do not use non-reentrant safe functions from std
thread_safe_checks = [
{
Expand Down
2 changes: 1 addition & 1 deletion runTests.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def processCLIArgs():

tests_help_msg = "The path(s) to the test case(s) to run.\n"
tests_help_msg += "Example: 'test/unit', 'test/prob', and/or\n"
tests_help_msg += " 'test/unit/math/prim/scal/fun/abs_test.cpp'"
tests_help_msg += " 'test/unit/math/prim/fun/abs_test.cpp'"
parser.add_argument("tests", nargs="+", type=str,
help=tests_help_msg)
f_help_msg = "Only tests with file names matching these will be executed.\n"
Expand Down
6 changes: 2 additions & 4 deletions stan/math/fwd.hpp
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
#ifndef STAN_MATH_FWD_HPP
#define STAN_MATH_FWD_HPP

#include <stan/math/prim/mat/fun/Eigen.hpp>
#include <stan/math/prim/fun/Eigen.hpp>

#include <stan/math/fwd/core.hpp>
#include <stan/math/fwd/meta.hpp>
#include <stan/math/fwd/vectorize.hpp>
#include <stan/math/prim/arr.hpp>
#include <stan/math/prim/mat.hpp>
#include <stan/math/prim/scal.hpp>
#include <stan/math/prim.hpp>

#include <stan/math/fwd/fun.hpp>
#include <stan/math/fwd/functor.hpp>
Expand Down
2 changes: 1 addition & 1 deletion stan/math/fwd/core/fvar.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#define STAN_MATH_FWD_CORE_FVAR_HPP

#include <stan/math/prim/meta.hpp>
#include <stan/math/prim/scal/fun/is_nan.hpp>
#include <stan/math/prim/fun/is_nan.hpp>
#include <ostream>
#include <type_traits>

Expand Down
2 changes: 1 addition & 1 deletion stan/math/fwd/fun/Eigen_NumTraits.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

#include <stan/math/fwd/core.hpp>
#include <stan/math/fwd/core/std_numeric_limits.hpp>
#include <stan/math/prim/mat/fun/Eigen.hpp>
#include <stan/math/prim/fun/Eigen.hpp>
#include <limits>

namespace Eigen {
Expand Down
4 changes: 2 additions & 2 deletions stan/math/fwd/fun/Phi.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

#include <stan/math/fwd/meta.hpp>
#include <stan/math/fwd/core.hpp>
#include <stan/math/prim/scal/fun/constants.hpp>
#include <stan/math/prim/scal/fun/Phi.hpp>
#include <stan/math/prim/fun/constants.hpp>
#include <stan/math/prim/fun/Phi.hpp>
#include <cmath>

namespace stan {
Expand Down
2 changes: 1 addition & 1 deletion stan/math/fwd/fun/Phi_approx.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

#include <stan/math/fwd/meta.hpp>
#include <stan/math/fwd/core.hpp>
#include <stan/math/prim/scal/fun/inv_logit.hpp>
#include <stan/math/prim/fun/inv_logit.hpp>
#include <cmath>

namespace stan {
Expand Down
6 changes: 3 additions & 3 deletions stan/math/fwd/fun/abs.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@

#include <stan/math/fwd/meta.hpp>
#include <stan/math/fwd/core.hpp>
#include <stan/math/prim/scal/fun/constants.hpp>
#include <stan/math/prim/scal/fun/abs.hpp>
#include <stan/math/prim/scal/fun/value_of.hpp>
#include <stan/math/prim/fun/constants.hpp>
#include <stan/math/prim/fun/abs.hpp>
#include <stan/math/prim/fun/value_of.hpp>

namespace stan {
namespace math {
Expand Down
2 changes: 1 addition & 1 deletion stan/math/fwd/fun/acos.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

#include <stan/math/fwd/meta.hpp>
#include <stan/math/fwd/core.hpp>
#include <stan/math/prim/scal/fun/square.hpp>
#include <stan/math/prim/fun/square.hpp>
#include <cmath>

namespace stan {
Expand Down
4 changes: 2 additions & 2 deletions stan/math/fwd/fun/acosh.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

#include <stan/math/fwd/meta.hpp>
#include <stan/math/fwd/core.hpp>
#include <stan/math/prim/scal/fun/acosh.hpp>
#include <stan/math/prim/scal/fun/square.hpp>
#include <stan/math/prim/fun/acosh.hpp>
#include <stan/math/prim/fun/square.hpp>
#include <cmath>

namespace stan {
Expand Down
2 changes: 1 addition & 1 deletion stan/math/fwd/fun/asin.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

#include <stan/math/fwd/meta.hpp>
#include <stan/math/fwd/core.hpp>
#include <stan/math/prim/scal/fun/square.hpp>
#include <stan/math/prim/fun/square.hpp>
#include <cmath>

namespace stan {
Expand Down
4 changes: 2 additions & 2 deletions stan/math/fwd/fun/asinh.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

#include <stan/math/fwd/meta.hpp>
#include <stan/math/fwd/core.hpp>
#include <stan/math/prim/scal/fun/asinh.hpp>
#include <stan/math/prim/scal/fun/square.hpp>
#include <stan/math/prim/fun/asinh.hpp>
#include <stan/math/prim/fun/square.hpp>
#include <cmath>

namespace stan {
Expand Down
2 changes: 1 addition & 1 deletion stan/math/fwd/fun/atan.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

#include <stan/math/fwd/meta.hpp>
#include <stan/math/fwd/core.hpp>
#include <stan/math/prim/scal/fun/square.hpp>
#include <stan/math/prim/fun/square.hpp>
#include <cmath>

namespace stan {
Expand Down
2 changes: 1 addition & 1 deletion stan/math/fwd/fun/atan2.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

#include <stan/math/fwd/meta.hpp>
#include <stan/math/fwd/core.hpp>
#include <stan/math/prim/scal/fun/square.hpp>
#include <stan/math/prim/fun/square.hpp>
#include <cmath>

namespace stan {
Expand Down
4 changes: 2 additions & 2 deletions stan/math/fwd/fun/atanh.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

#include <stan/math/fwd/meta.hpp>
#include <stan/math/fwd/core.hpp>
#include <stan/math/prim/scal/fun/atanh.hpp>
#include <stan/math/prim/scal/fun/square.hpp>
#include <stan/math/prim/fun/atanh.hpp>
#include <stan/math/prim/fun/square.hpp>

namespace stan {
namespace math {
Expand Down
2 changes: 1 addition & 1 deletion stan/math/fwd/fun/bessel_first_kind.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

#include <stan/math/fwd/meta.hpp>
#include <stan/math/fwd/core.hpp>
#include <stan/math/prim/scal/fun/bessel_first_kind.hpp>
#include <stan/math/prim/fun/bessel_first_kind.hpp>

namespace stan {
namespace math {
Expand Down
2 changes: 1 addition & 1 deletion stan/math/fwd/fun/bessel_second_kind.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

#include <stan/math/fwd/meta.hpp>
#include <stan/math/fwd/core.hpp>
#include <stan/math/prim/scal/fun/bessel_second_kind.hpp>
#include <stan/math/prim/fun/bessel_second_kind.hpp>

namespace stan {
namespace math {
Expand Down
4 changes: 2 additions & 2 deletions stan/math/fwd/fun/beta.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

#include <stan/math/fwd/meta.hpp>
#include <stan/math/fwd/core.hpp>
#include <stan/math/prim/scal/fun/beta.hpp>
#include <stan/math/prim/scal/fun/digamma.hpp>
#include <stan/math/prim/fun/beta.hpp>
#include <stan/math/prim/fun/digamma.hpp>

namespace stan {
namespace math {
Expand Down
2 changes: 1 addition & 1 deletion stan/math/fwd/fun/binary_log_loss.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

#include <stan/math/fwd/meta.hpp>
#include <stan/math/fwd/core.hpp>
#include <stan/math/prim/scal/fun/binary_log_loss.hpp>
#include <stan/math/prim/fun/binary_log_loss.hpp>

namespace stan {
namespace math {
Expand Down
4 changes: 2 additions & 2 deletions stan/math/fwd/fun/cbrt.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

#include <stan/math/fwd/meta.hpp>
#include <stan/math/fwd/core.hpp>
#include <stan/math/prim/scal/fun/cbrt.hpp>
#include <stan/math/prim/scal/fun/square.hpp>
#include <stan/math/prim/fun/cbrt.hpp>
#include <stan/math/prim/fun/square.hpp>

namespace stan {
namespace math {
Expand Down
2 changes: 1 addition & 1 deletion stan/math/fwd/fun/columns_dot_product.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#define STAN_MATH_FWD_FUN_COLUMNS_DOT_PRODUCT_HPP

#include <stan/math/prim/err.hpp>
#include <stan/math/prim/mat/fun/Eigen.hpp>
#include <stan/math/prim/fun/Eigen.hpp>
#include <stan/math/fwd/fun/typedefs.hpp>
#include <stan/math/fwd/core.hpp>

Expand Down
2 changes: 1 addition & 1 deletion stan/math/fwd/fun/columns_dot_self.hpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef STAN_MATH_FWD_FUN_COLUMNS_DOT_SELF_HPP
#define STAN_MATH_FWD_FUN_COLUMNS_DOT_SELF_HPP

#include <stan/math/prim/mat/fun/Eigen.hpp>
#include <stan/math/prim/fun/Eigen.hpp>
#include <stan/math/fwd/core.hpp>
#include <stan/math/fwd/fun/dot_self.hpp>

Expand Down
4 changes: 2 additions & 2 deletions stan/math/fwd/fun/crossprod.hpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#ifndef STAN_MATH_FWD_FUN_CROSSPROD_HPP
#define STAN_MATH_FWD_FUN_CROSSPROD_HPP

#include <stan/math/prim/mat/fun/Eigen.hpp>
#include <stan/math/prim/fun/Eigen.hpp>
#include <stan/math/prim/fun/transpose.hpp>
#include <stan/math/fwd/fun/multiply.hpp>
#include <stan/math/prim/mat/fun/transpose.hpp>

namespace stan {
namespace math {
Expand Down
2 changes: 1 addition & 1 deletion stan/math/fwd/fun/determinant.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#define STAN_MATH_FWD_FUN_DETERMINANT_HPP

#include <stan/math/prim/err.hpp>
#include <stan/math/prim/mat/fun/Eigen.hpp>
#include <stan/math/prim/fun/Eigen.hpp>
#include <stan/math/fwd/core.hpp>

namespace stan {
Expand Down
4 changes: 2 additions & 2 deletions stan/math/fwd/fun/digamma.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
#include <stan/math/fwd/meta.hpp>
#include <stan/math/fwd/core.hpp>

#include <stan/math/prim/scal/fun/digamma.hpp>
#include <stan/math/prim/scal/fun/trigamma.hpp>
#include <stan/math/prim/fun/digamma.hpp>
#include <stan/math/prim/fun/trigamma.hpp>

namespace stan {
namespace math {
Expand Down
2 changes: 1 addition & 1 deletion stan/math/fwd/fun/divide.hpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef STAN_MATH_FWD_FUN_DIVIDE_HPP
#define STAN_MATH_FWD_FUN_DIVIDE_HPP

#include <stan/math/prim/mat/fun/Eigen.hpp>
#include <stan/math/prim/fun/Eigen.hpp>
#include <stan/math/fwd/core.hpp>

namespace stan {
Expand Down
2 changes: 1 addition & 1 deletion stan/math/fwd/fun/dot_product.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#define STAN_MATH_FWD_FUN_DOT_PRODUCT_HPP

#include <stan/math/prim/err.hpp>
#include <stan/math/prim/mat/fun/Eigen.hpp>
#include <stan/math/prim/fun/Eigen.hpp>
#include <stan/math/fwd/fun/typedefs.hpp>
#include <vector>

Expand Down
2 changes: 1 addition & 1 deletion stan/math/fwd/fun/dot_self.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#define STAN_MATH_FWD_FUN_DOT_SELF_HPP

#include <stan/math/prim/err.hpp>
#include <stan/math/prim/mat/fun/Eigen.hpp>
#include <stan/math/prim/fun/Eigen.hpp>
#include <stan/math/fwd/core.hpp>
#include <stan/math/fwd/fun/dot_product.hpp>

Expand Down
6 changes: 3 additions & 3 deletions stan/math/fwd/fun/erf.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@

#include <stan/math/fwd/meta.hpp>
#include <stan/math/fwd/core.hpp>
#include <stan/math/prim/scal/fun/constants.hpp>
#include <stan/math/prim/scal/fun/erf.hpp>
#include <stan/math/prim/scal/fun/square.hpp>
#include <stan/math/prim/fun/constants.hpp>
#include <stan/math/prim/fun/erf.hpp>
#include <stan/math/prim/fun/square.hpp>
#include <cmath>

namespace stan {
Expand Down
6 changes: 3 additions & 3 deletions stan/math/fwd/fun/erfc.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@

#include <stan/math/fwd/meta.hpp>
#include <stan/math/fwd/core.hpp>
#include <stan/math/prim/scal/fun/constants.hpp>
#include <stan/math/prim/scal/fun/erfc.hpp>
#include <stan/math/prim/scal/fun/square.hpp>
#include <stan/math/prim/fun/constants.hpp>
#include <stan/math/prim/fun/erfc.hpp>
#include <stan/math/prim/fun/square.hpp>
#include <cmath>

namespace stan {
Expand Down
4 changes: 2 additions & 2 deletions stan/math/fwd/fun/exp2.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

#include <stan/math/fwd/meta.hpp>
#include <stan/math/fwd/core.hpp>
#include <stan/math/prim/scal/fun/exp2.hpp>
#include <stan/math/prim/scal/fun/constants.hpp>
#include <stan/math/prim/fun/exp2.hpp>
#include <stan/math/prim/fun/constants.hpp>
#include <cmath>

namespace stan {
Expand Down
2 changes: 1 addition & 1 deletion stan/math/fwd/fun/expm1.hpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#ifndef STAN_MATH_FWD_FUN_EXPM1_HPP
#define STAN_MATH_FWD_FUN_EXPM1_HPP

#include <stan/math/prim/fun/expm1.hpp>
#include <stan/math/fwd/meta.hpp>
#include <stan/math/prim/scal/fun/expm1.hpp>
#include <stan/math/fwd/core.hpp>
#include <cmath>

Expand Down
6 changes: 3 additions & 3 deletions stan/math/fwd/fun/fabs.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@

#include <stan/math/fwd/meta.hpp>
#include <stan/math/fwd/core.hpp>
#include <stan/math/prim/scal/fun/constants.hpp>
#include <stan/math/prim/scal/fun/is_nan.hpp>
#include <stan/math/prim/scal/fun/value_of.hpp>
#include <stan/math/prim/fun/constants.hpp>
#include <stan/math/prim/fun/is_nan.hpp>
#include <stan/math/prim/fun/value_of.hpp>
#include <cmath>

namespace stan {
Expand Down
Loading