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

Added another constructor for sample pair objects. This one doesn't require

a distance argument.
parent febbe828
......@@ -23,6 +23,16 @@ namespace dlib
_distance = std::numeric_limits<double>::infinity();
}
ordered_sample_pair (
const unsigned long idx1,
const unsigned long idx2
)
{
_distance = std::numeric_limits<double>::infinity();
_index1 = idx1;
_index2 = idx2;
}
ordered_sample_pair (
const unsigned long idx1,
const unsigned long idx2,
......
......@@ -33,6 +33,17 @@ namespace dlib
- #distance() == std::numeric_limits<double>::infinity()
!*/
ordered_sample_pair (
const unsigned long idx1,
const unsigned long idx2
);
/*!
ensures
- #index1() == idx1
- #index2() == idx2
- #distance() == std::numeric_limits<double>::infinity()
!*/
ordered_sample_pair (
const unsigned long idx1,
const unsigned long idx2,
......
......@@ -23,6 +23,24 @@ namespace dlib
_distance = std::numeric_limits<double>::infinity();
}
sample_pair (
const unsigned long idx1,
const unsigned long idx2
)
{
_distance = std::numeric_limits<double>::infinity();
if (idx1 < idx2)
{
_index1 = idx1;
_index2 = idx2;
}
else
{
_index1 = idx2;
_index2 = idx1;
}
}
sample_pair (
const unsigned long idx1,
const unsigned long idx2,
......
......@@ -37,6 +37,17 @@ namespace dlib
- #distance() == std::numeric_limits<double>::infinity()
!*/
sample_pair (
const unsigned long idx1,
const unsigned long idx2
);
/*!
ensures
- #index1() == min(idx1,idx2)
- #index2() == max(idx1,idx2)
- #distance() == std::numeric_limits<double>::infinity()
!*/
sample_pair (
const unsigned long idx1,
const unsigned long idx2,
......
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