[mlpack] 01/324: Const parameters will cause this to be two billion times faster.

Barak A. Pearlmutter barak+git at cs.nuim.ie
Sun Aug 17 08:21:50 UTC 2014


This is an automated email from the git hooks/post-receive script.

bap pushed a commit to branch svn-trunk
in repository mlpack.

commit 445059c9273da5489463df67ab7ffd69a799da53
Author: rcurtin <rcurtin at 9d5b8971-822b-0410-80eb-d18c1038ef23>
Date:   Tue May 13 19:25:55 2014 +0000

    Const parameters will cause this to be two billion times faster.
    
    
    git-svn-id: http://svn.cc.gatech.edu/fastlab/mlpack/trunk@16497 9d5b8971-822b-0410-80eb-d18c1038ef23
---
 src/mlpack/core/kernels/gaussian_kernel.hpp | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/mlpack/core/kernels/gaussian_kernel.hpp b/src/mlpack/core/kernels/gaussian_kernel.hpp
index 606f4cb..859a91d 100644
--- a/src/mlpack/core/kernels/gaussian_kernel.hpp
+++ b/src/mlpack/core/kernels/gaussian_kernel.hpp
@@ -39,7 +39,7 @@ class GaussianKernel
    *
    * @param bandwidth The bandwidth of the kernel (@f$\mu at f$).
    */
-  GaussianKernel(double bandwidth) :
+  GaussianKernel(const double bandwidth) :
       bandwidth(bandwidth),
       gamma(-0.5 * pow(bandwidth, -2.0))
   { }
@@ -69,7 +69,7 @@ class GaussianKernel
    * @return K(t) using the bandwidth (@f$\mu at f$) specified in the
    *     constructor.
    */
-  double Evaluate(double t) const
+  double Evaluate(const double t) const
   {
     // The precalculation of gamma saves us a little computation time.
     return exp(gamma * std::pow(t, 2.0));
@@ -81,7 +81,7 @@ class GaussianKernel
    * @param dimension
    * @return the normalization constant
    */
-  double Normalizer(size_t dimension)
+  double Normalizer(const size_t dimension)
   {
     return pow(sqrt(2.0 * M_PI) * bandwidth, (double) dimension);
   }

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/mlpack.git



More information about the debian-science-commits mailing list