Skip to content
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

Fix include ordering for LinearRegression #3541

Merged
merged 3 commits into from
Oct 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions HISTORY.md
@@ -1,5 +1,6 @@
### mlpack ?.?.?
###### ????-??-??
* Fix include ordering issue for `LinearRegression` (#3541).

### mlpack 4.2.1
###### 2023-09-05
Expand Down
4 changes: 2 additions & 2 deletions src/mlpack/core/dists/regression_distribution.hpp
Expand Up @@ -10,8 +10,8 @@
* 3-clause BSD license along with mlpack. If not, see
* http://www.opensource.org/licenses/BSD-3-Clause for more information.
*/
#ifndef MLPACK_CORE_DISTRIBUTIONS_REGRESSION_DISTRIBUTION_HPP
#define MLPACK_CORE_DISTRIBUTIONS_REGRESSION_DISTRIBUTION_HPP
#ifndef MLPACK_CORE_DISTS_REGRESSION_DISTRIBUTION_HPP
#define MLPACK_CORE_DISTS_REGRESSION_DISTRIBUTION_HPP

#include <mlpack/prereqs.hpp>
#include <mlpack/core/dists/gaussian_distribution.hpp>
Expand Down
5 changes: 2 additions & 3 deletions src/mlpack/core/dists/regression_distribution_impl.hpp
Expand Up @@ -10,9 +10,8 @@
* 3-clause BSD license along with mlpack. If not, see
* http://www.opensource.org/licenses/BSD-3-Clause for more information.
*/

#ifndef MLPACK_CORE_DISTRIBUTIONS_REGRESSION_DISTRIBUTION_IMPL_HPP
#define MLPACK_CORE_DISTRIBUTIONS_REGRESSION_DISTRIBUTION_IMPL_HPP
#ifndef MLPACK_CORE_DISTS_REGRESSION_DISTRIBUTION_IMPL_HPP
#define MLPACK_CORE_DISTS_REGRESSION_DISTRIBUTION_IMPL_HPP

#include "regression_distribution.hpp"

Expand Down
9 changes: 8 additions & 1 deletion src/mlpack/methods/linear_regression/linear_regression.hpp
Expand Up @@ -13,7 +13,11 @@
#ifndef MLPACK_METHODS_LINEAR_REGRESSION_LINEAR_REGRESSION_HPP
#define MLPACK_METHODS_LINEAR_REGRESSION_LINEAR_REGRESSION_HPP

#include <mlpack/core.hpp>
// Because RegressionDistribution uses LinearRegression internally, we need to
// make sure we define LinearRegression fully before we define
// RegressionDistribution. Therefore we have to include the prereqs first, and
// include the core later.
#include <mlpack/prereqs.hpp>

namespace mlpack {

Expand Down Expand Up @@ -168,4 +172,7 @@ class LinearRegression
// Include implementation.
#include "linear_regression_impl.hpp"

// Now that LinearRegression is defined, we can include the core.
#include <mlpack/core.hpp>

#endif // MLPACK_METHODS_LINEAR_REGRESSION_HPP