[mlpack-svn] r15840 - mlpack/trunk/src/mlpack/methods/linear_regression

fastlab-svn at coffeetalk-1.cc.gatech.edu fastlab-svn at coffeetalk-1.cc.gatech.edu
Thu Sep 26 10:36:02 EDT 2013


Author: rcurtin
Date: Thu Sep 26 10:36:02 2013
New Revision: 15840

Log:
Make Predict() function const-correct.


Modified:
   mlpack/trunk/src/mlpack/methods/linear_regression/linear_regression.cpp
   mlpack/trunk/src/mlpack/methods/linear_regression/linear_regression.hpp

Modified: mlpack/trunk/src/mlpack/methods/linear_regression/linear_regression.cpp
==============================================================================
--- mlpack/trunk/src/mlpack/methods/linear_regression/linear_regression.cpp	(original)
+++ mlpack/trunk/src/mlpack/methods/linear_regression/linear_regression.cpp	Thu Sep 26 10:36:02 2013
@@ -56,6 +56,7 @@
 }
 
 void LinearRegression::Predict(const arma::mat& points, arma::vec& predictions)
+    const
 {
   // We want to be sure we have the correct number of dimensions in the dataset.
   Log::Assert(points.n_rows == parameters.n_rows - 1);

Modified: mlpack/trunk/src/mlpack/methods/linear_regression/linear_regression.hpp
==============================================================================
--- mlpack/trunk/src/mlpack/methods/linear_regression/linear_regression.hpp	(original)
+++ mlpack/trunk/src/mlpack/methods/linear_regression/linear_regression.hpp	Thu Sep 26 10:36:02 2013
@@ -51,7 +51,7 @@
    * @param points the data points to calculate with.
    * @param predictions y, will contain calculated values on completion.
    */
-  void Predict(const arma::mat& points, arma::vec& predictions);
+  void Predict(const arma::mat& points, arma::vec& predictions) const;
 
   /**
    * Calculate the L2 squared error on the given predictors and responses using



More information about the mlpack-svn mailing list