From 3e165bfc3e09dbb0c32f5aa79b7dce61cb019a88 Mon Sep 17 00:00:00 2001 From: Omar Shrit Date: Sat, 13 Nov 2021 19:15:58 +0000 Subject: [PATCH] inline random_basis Signed-off-by: Omar Shrit --- src/mlpack/core/math/random_basis.hpp | 5 ++++- .../core/math/{random_basis.cpp => random_basis_impl.hpp} | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) rename src/mlpack/core/math/{random_basis.cpp => random_basis_impl.hpp} (95%) 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) {