Commit 0bd9ec07 authored by Davis King's avatar Davis King

Made the default distances of sample_pair and ordered_sample_pair objects

1 instead of infinity.
parent 0b15dae3
...@@ -20,7 +20,7 @@ namespace dlib ...@@ -20,7 +20,7 @@ namespace dlib
_index1(0), _index1(0),
_index2(0) _index2(0)
{ {
_distance = std::numeric_limits<double>::infinity(); _distance = 1;
} }
ordered_sample_pair ( ordered_sample_pair (
...@@ -28,7 +28,7 @@ namespace dlib ...@@ -28,7 +28,7 @@ namespace dlib
const unsigned long idx2 const unsigned long idx2
) )
{ {
_distance = std::numeric_limits<double>::infinity(); _distance = 1;
_index1 = idx1; _index1 = idx1;
_index2 = idx2; _index2 = idx2;
} }
......
...@@ -30,7 +30,7 @@ namespace dlib ...@@ -30,7 +30,7 @@ namespace dlib
ensures ensures
- #index1() == 0 - #index1() == 0
- #index2() == 0 - #index2() == 0
- #distance() == std::numeric_limits<double>::infinity() - #distance() == 1
!*/ !*/
ordered_sample_pair ( ordered_sample_pair (
...@@ -41,7 +41,7 @@ namespace dlib ...@@ -41,7 +41,7 @@ namespace dlib
ensures ensures
- #index1() == idx1 - #index1() == idx1
- #index2() == idx2 - #index2() == idx2
- #distance() == std::numeric_limits<double>::infinity() - #distance() == 1
!*/ !*/
ordered_sample_pair ( ordered_sample_pair (
......
...@@ -20,7 +20,7 @@ namespace dlib ...@@ -20,7 +20,7 @@ namespace dlib
_index1(0), _index1(0),
_index2(0) _index2(0)
{ {
_distance = std::numeric_limits<double>::infinity(); _distance = 1;
} }
sample_pair ( sample_pair (
...@@ -28,7 +28,7 @@ namespace dlib ...@@ -28,7 +28,7 @@ namespace dlib
const unsigned long idx2 const unsigned long idx2
) )
{ {
_distance = std::numeric_limits<double>::infinity(); _distance = 1;
if (idx1 < idx2) if (idx1 < idx2)
{ {
_index1 = idx1; _index1 = idx1;
......
...@@ -34,7 +34,7 @@ namespace dlib ...@@ -34,7 +34,7 @@ namespace dlib
ensures ensures
- #index1() == 0 - #index1() == 0
- #index2() == 0 - #index2() == 0
- #distance() == std::numeric_limits<double>::infinity() - #distance() == 1
!*/ !*/
sample_pair ( sample_pair (
...@@ -45,7 +45,7 @@ namespace dlib ...@@ -45,7 +45,7 @@ namespace dlib
ensures ensures
- #index1() == min(idx1,idx2) - #index1() == min(idx1,idx2)
- #index2() == max(idx1,idx2) - #index2() == max(idx1,idx2)
- #distance() == std::numeric_limits<double>::infinity() - #distance() == 1
!*/ !*/
sample_pair ( sample_pair (
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment