[mlpack-svn] r10462 - mlpack/trunk/src/mlpack/core/math
fastlab-svn at coffeetalk-1.cc.gatech.edu
fastlab-svn at coffeetalk-1.cc.gatech.edu
Wed Nov 30 00:36:37 EST 2011
Author: rcurtin
Date: 2011-11-30 00:36:37 -0500 (Wed, 30 Nov 2011)
New Revision: 10462
Modified:
mlpack/trunk/src/mlpack/core/math/range.cpp
mlpack/trunk/src/mlpack/core/math/range.hpp
Log:
Make Range adhere to new formatting and naming conventions.
Modified: mlpack/trunk/src/mlpack/core/math/range.cpp
===================================================================
--- mlpack/trunk/src/mlpack/core/math/range.cpp 2011-11-30 05:36:16 UTC (rev 10461)
+++ mlpack/trunk/src/mlpack/core/math/range.cpp 2011-11-30 05:36:37 UTC (rev 10462)
@@ -18,19 +18,19 @@
/**
* Initialize a range to enclose only the given point.
*/
-Range::Range(double point) :
+Range::Range(const double point) :
lo(point), hi(point) { /* nothing else to do */ }
/**
* Initializes the range to the specified values.
*/
-Range::Range(double lo_in, double hi_in) :
- lo(lo_in), hi(hi_in) { /* nothing else to do */ }
+Range::Range(const double lo, const double hi) :
+ lo(lo), hi(hi) { /* nothing else to do */ }
/**
* Gets the span of the range, hi - lo. Returns 0 if the range is negative.
*/
-double Range::width() const
+double Range::Width() const
{
if (lo < hi)
return (hi - lo);
@@ -41,7 +41,7 @@
/**
* Gets the midpoint of this range.
*/
-double Range::mid() const
+double Range::Mid() const
{
return (hi + lo) / 2;
}
@@ -157,7 +157,7 @@
/**
* Determines if a point is contained within the range.
*/
-bool Range::Contains(double d) const
+bool Range::Contains(const double d) const
{
return d >= lo && d <= hi;
}
Modified: mlpack/trunk/src/mlpack/core/math/range.hpp
===================================================================
--- mlpack/trunk/src/mlpack/core/math/range.hpp 2011-11-30 05:36:16 UTC (rev 10461)
+++ mlpack/trunk/src/mlpack/core/math/range.hpp 2011-11-30 05:36:37 UTC (rev 10462)
@@ -28,25 +28,25 @@
*
* @param point Point that this range will enclose.
*/
- Range(double point);
+ Range(const double point);
/**
* Initializes to specified range.
*
- * @param lo_in Lower bound of the range.
- * @param hi_in Upper bound of the range.
+ * @param lo Lower bound of the range.
+ * @param hi Upper bound of the range.
*/
- Range(double lo_in, double hi_in);
+ Range(const double lo, const double hi);
/**
* Gets the span of the range (hi - lo).
*/
- double width() const;
+ double Width() const;
/**
* Gets the midpoint of this range.
*/
- double mid() const;
+ double Mid() const;
/**
* Expands this range to include another range.
@@ -134,7 +134,7 @@
*
* @param d Point to check.
*/
- bool Contains(double d) const;
+ bool Contains(const double d) const;
};
More information about the mlpack-svn
mailing list