diff --git a/src/mlpack/core/math/random_basis.hpp b/src/mlpack/core/math/random_basis.hpp index 6d605b846e..75c9b1eef1 100644 --- a/src/mlpack/core/math/random_basis.hpp +++ b/src/mlpack/core/math/random_basis.hpp @@ -24,9 +24,12 @@ namespace math { * @param basis Matrix to store basis in. * @param d Desired number of dimensions in the basis. */ -void RandomBasis(arma::mat& basis, const size_t d); +inline void RandomBasis(arma::mat& basis, const size_t d); } // namespace math } // namespace mlpack +//! Include the implementation file +#include "random_basis_impl.hpp" + #endif diff --git a/src/mlpack/core/math/random_basis.cpp b/src/mlpack/core/math/random_basis_impl.hpp similarity index 95% rename from src/mlpack/core/math/random_basis.cpp rename to src/mlpack/core/math/random_basis_impl.hpp index f891b1e2eb..80cab9dbbc 100644 --- a/src/mlpack/core/math/random_basis.cpp +++ b/src/mlpack/core/math/random_basis_impl.hpp @@ -16,7 +16,7 @@ using namespace arma; namespace mlpack { namespace math { -void RandomBasis(mat& basis, const size_t d) +inline void RandomBasis(mat& basis, const size_t d) { while (true) {