[mlpack-git] master: Fix -Wunused-private-field. (fba66e1)

gitdub at big.cc.gt.atl.ga.us gitdub at big.cc.gt.atl.ga.us
Mon Jan 12 11:45:07 EST 2015


Repository : https://github.com/mlpack/mlpack

On branch  : master
Link       : https://github.com/mlpack/mlpack/compare/3ad083bcbf243915de035eead1b0772ac3f35dee...660fd96eecf88245555a8651e1cbeff50cd66686

>---------------------------------------------------------------

commit fba66e1b4960b403dc258e3a3e1e7d75cd7275ab
Author: Ryan Curtin <ryan at ratml.org>
Date:   Mon Jan 12 11:31:35 2015 -0500

    Fix -Wunused-private-field.


>---------------------------------------------------------------

fba66e1b4960b403dc258e3a3e1e7d75cd7275ab
 src/mlpack/core/tree/cosine_tree/cosine_tree.cpp         |  1 -
 src/mlpack/core/tree/cosine_tree/cosine_tree.hpp         | 16 +++++++++++-----
 src/mlpack/methods/quic_svd/quic_svd.hpp                 |  6 ------
 src/mlpack/methods/quic_svd/quic_svd_impl.hpp            |  4 +---
 .../softmax_regression/softmax_regression_function.cpp   |  1 -
 .../softmax_regression/softmax_regression_function.hpp   |  2 --
 6 files changed, 12 insertions(+), 18 deletions(-)

diff --git a/src/mlpack/core/tree/cosine_tree/cosine_tree.cpp b/src/mlpack/core/tree/cosine_tree/cosine_tree.cpp
index 5cf5c26..b8bc89d 100644
--- a/src/mlpack/core/tree/cosine_tree/cosine_tree.cpp
+++ b/src/mlpack/core/tree/cosine_tree/cosine_tree.cpp
@@ -71,7 +71,6 @@ CosineTree::CosineTree(const arma::mat& dataset,
                        const double epsilon,
                        const double delta) :
     dataset(dataset),
-    epsilon(epsilon),
     delta(delta),
     left(NULL),
     right(NULL)
diff --git a/src/mlpack/core/tree/cosine_tree/cosine_tree.hpp b/src/mlpack/core/tree/cosine_tree/cosine_tree.hpp
index c6055ee..e311934 100644
--- a/src/mlpack/core/tree/cosine_tree/cosine_tree.hpp
+++ b/src/mlpack/core/tree/cosine_tree/cosine_tree.hpp
@@ -171,7 +171,6 @@ class CosineTree
 
   //! Set the Monte Carlo error.
   void L2Error(const double error) { this->l2Error = error; }
-
   //! Get the Monte Carlo error.
   double L2Error() const { return l2Error; }
 
@@ -184,11 +183,20 @@ class CosineTree
   //! Get the basis vector of the node.
   arma::vec& BasisVector() { return basisVector; }
 
+  //! Get pointer to the parent node.
+  CosineTree* Parent() const { return parent; }
+  //! Modify the pointer to the parent node.
+  CosineTree*& Parent() { return parent; }
+
   //! Get pointer to the left child of the node.
-  CosineTree* Left() { return left; }
+  CosineTree* Left() const { return left; }
+  //! Modify the pointer to the left child of the node.
+  CosineTree*& Left() { return left; }
 
   //! Get pointer to the right child of the node.
-  CosineTree* Right() { return right; }
+  CosineTree* Right() const { return right; }
+  //! Modify the pointer to the left child of the node.
+  CosineTree*& Right() { return right; }
 
   //! Get number of columns of input matrix in the node.
   size_t NumColumns() const { return numColumns; }
@@ -202,8 +210,6 @@ class CosineTree
  private:
   //! Matrix for which cosine tree is constructed.
   const arma::mat& dataset;
-  //! Error tolerance fraction for calculated subspace.
-  double epsilon;
   //! Cumulative probability for Monte Carlo error lower bound.
   double delta;
   //! Subspace basis of the input dataset.
diff --git a/src/mlpack/methods/quic_svd/quic_svd.hpp b/src/mlpack/methods/quic_svd/quic_svd.hpp
index 9e2a080..d13bfa8 100644
--- a/src/mlpack/methods/quic_svd/quic_svd.hpp
+++ b/src/mlpack/methods/quic_svd/quic_svd.hpp
@@ -45,11 +45,9 @@ namespace svd {
  * QUIC_SVD(data, u, v, sigma, epsilon, delta);
  * @endcode
  */
-
 class QUIC_SVD
 {
  public:
-
   /**
    * Constructor which implements the QUIC-SVD algorithm. The function calls the
    * CosineTree constructor to create a subspace basis, where the original
@@ -86,10 +84,6 @@ class QUIC_SVD
  private:
   //! Matrix for which cosine tree is constructed.
   const arma::mat& dataset;
-  //! Error tolerance fraction for calculated subspace.
-  double epsilon;
-  //! Cumulative probability for Monte Carlo error lower bound.
-  double delta;
   //! Subspace basis of the input dataset.
   arma::mat basis;
 };
diff --git a/src/mlpack/methods/quic_svd/quic_svd_impl.hpp b/src/mlpack/methods/quic_svd/quic_svd_impl.hpp
index a5dba39..a7740b9 100644
--- a/src/mlpack/methods/quic_svd/quic_svd_impl.hpp
+++ b/src/mlpack/methods/quic_svd/quic_svd_impl.hpp
@@ -21,9 +21,7 @@ QUIC_SVD::QUIC_SVD(const arma::mat& dataset,
                    arma::mat& sigma,
                    const double epsilon,
                    const double delta) :
-    dataset(dataset),
-    epsilon(epsilon),
-    delta(delta)
+    dataset(dataset)
 {
   // Since columns are sample in the implementation, the matrix is transposed if
   // necessary for maximum speedup.
diff --git a/src/mlpack/methods/softmax_regression/softmax_regression_function.cpp b/src/mlpack/methods/softmax_regression/softmax_regression_function.cpp
index c550894..97a4a2b 100644
--- a/src/mlpack/methods/softmax_regression/softmax_regression_function.cpp
+++ b/src/mlpack/methods/softmax_regression/softmax_regression_function.cpp
@@ -15,7 +15,6 @@ SoftmaxRegressionFunction::SoftmaxRegressionFunction(const arma::mat& data,
                                                      const size_t numClasses,
                                                      const double lambda) :
     data(data),
-    labels(labels),
     inputSize(inputSize),
     numClasses(numClasses),
     lambda(lambda)
diff --git a/src/mlpack/methods/softmax_regression/softmax_regression_function.hpp b/src/mlpack/methods/softmax_regression/softmax_regression_function.hpp
index 3706436..fc22384 100644
--- a/src/mlpack/methods/softmax_regression/softmax_regression_function.hpp
+++ b/src/mlpack/methods/softmax_regression/softmax_regression_function.hpp
@@ -107,8 +107,6 @@ class SoftmaxRegressionFunction
  private:
   //! Training data matrix.
   const arma::mat& data;
-  //! Labels associated with the training data.
-  const arma::vec& labels;
   //! Label matrix for the provided data.
   arma::sp_mat groundTruth;
   //! Initial parameter point.



More information about the mlpack-git mailing list