Skip to content

Commit

Permalink
Merge pull request #1606 from stan-dev/flatten-prim
Browse files Browse the repository at this point in the history
Flatten /prim and finish flatten
  • Loading branch information
rok-cesnovar authored Jan 12, 2020
2 parents bfbed0d + c4d575e commit 47b0595
Show file tree
Hide file tree
Showing 926 changed files with 4,759 additions and 5,939 deletions.
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

0 comments on commit 47b0595

Please sign in to comment.