[mlpack] 273/324: Implemented Save, Load

Barak A. Pearlmutter barak+git at cs.nuim.ie
Sun Aug 17 08:22:17 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 124ad9a1a70e9756070bb01b58d3661fb2112cb9
Author: michaelfox99 <michaelfox99 at 9d5b8971-822b-0410-80eb-d18c1038ef23>
Date:   Tue Aug 5 13:28:44 2014 +0000

    Implemented Save, Load
    
    
    git-svn-id: http://svn.cc.gatech.edu/fastlab/mlpack/trunk@16957 9d5b8971-822b-0410-80eb-d18c1038ef23
---
 src/mlpack/core/dists/discrete_distribution.hpp | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/src/mlpack/core/dists/discrete_distribution.hpp b/src/mlpack/core/dists/discrete_distribution.hpp
index 7d7ba9a..7ec605b 100644
--- a/src/mlpack/core/dists/discrete_distribution.hpp
+++ b/src/mlpack/core/dists/discrete_distribution.hpp
@@ -77,7 +77,7 @@ class DiscreteDistribution
   /**
    * Get the dimensionality of the distribution.
    */
-  size_t Dimensionality() const { return 1; }
+  static size_t const Dimensionality() { return 1; }
 
   /**
    * Return the probability of the given observation.  If the observation is
@@ -144,6 +144,13 @@ class DiscreteDistribution
    */
   std::string ToString() const;
 
+
+  /** Save to or Load from SaveRestoreUtility
+   */
+  void Save(util::SaveRestoreUtility& n) const;
+  void Load(const util::SaveRestoreUtility& n) { n.LoadParameter(probabilities, "probabilities"); }
+  static std::string const Type() { return "DiscreteDistribution"; }
+    
  private:
   arma::vec probabilities;
 };

-- 
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