[mlpack-git] master: Add changes for runtime_error exception. (7d4d0a7)

gitdub at big.cc.gt.atl.ga.us gitdub at big.cc.gt.atl.ga.us
Thu Nov 19 11:34:52 EST 2015


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

On branch  : master
Link       : https://github.com/mlpack/mlpack/compare/713fa60a06f709bc715c4dd88f6ba585796f73a0...319205b2f3103187c584db302b1a3683aa2fbfdf

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

commit 7d4d0a713852489cbcb8165b5b75b1332b186a8d
Author: Grzegorz Krajewski <krajekg at gmail.com>
Date:   Tue Nov 17 22:57:25 2015 +0100

    Add changes for runtime_error exception.
    
    Note in class Timer has been changed and private attribute has been added.


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

7d4d0a713852489cbcb8165b5b75b1332b186a8d
 src/mlpack/core/util/timers.hpp | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/mlpack/core/util/timers.hpp b/src/mlpack/core/util/timers.hpp
index 19fc786..9c840ce 100644
--- a/src/mlpack/core/util/timers.hpp
+++ b/src/mlpack/core/util/timers.hpp
@@ -68,7 +68,7 @@ class Timer
    * both runs -- that is, MLPACK timers are additive for each time they are
    * run, and do not reset.
    *
-   * @note Undefined behavior will occur if a timer is started twice.
+   * @note Runtime error exception will occur if a timer is started twice.
    *
    * @param name Name of timer to be started.
    */
@@ -77,7 +77,7 @@ class Timer
   /**
    * Stop the given timer.
    *
-   * @note Undefined behavior will occur if a timer is started twice.
+   * @note Runtime error exception will occur if a timer is stopped twice.
    *
    * @param name Name of timer to be stopped.
    */
@@ -89,6 +89,9 @@ class Timer
    * @param name Name of timer to return value of.
    */
   static timeval Get(const std::string& name);
+    
+ private:
+  static std::map<std::string, bool> timerState;
 };
 
 class Timers



More information about the mlpack-git mailing list