Commit 68888c05 authored by Davis King's avatar Davis King

Renamed more variables

parent f9ba2e38
...@@ -33,16 +33,16 @@ namespace dlib ...@@ -33,16 +33,16 @@ namespace dlib
template <typename input_iterator> template <typename input_iterator>
void to_tensor ( void to_tensor (
input_iterator begin, input_iterator ibegin,
input_iterator end, input_iterator iend,
resizable_tensor& data resizable_tensor& data
) const ) const
{ {
DLIB_CASSERT(std::distance(begin,end) > 0,""); DLIB_CASSERT(std::distance(ibegin,iend) > 0,"");
const auto nr = begin->nr(); const auto nr = ibegin->nr();
const auto nc = begin->nc(); const auto nc = ibegin->nc();
// make sure all the input matrices have the same dimensions // make sure all the input matrices have the same dimensions
for (auto i = begin; i != end; ++i) for (auto i = ibegin; i != iend; ++i)
{ {
DLIB_CASSERT(i->nr()==nr && i->nc()==nc, DLIB_CASSERT(i->nr()==nr && i->nc()==nc,
"\t input::to_tensor()" "\t input::to_tensor()"
...@@ -56,10 +56,10 @@ namespace dlib ...@@ -56,10 +56,10 @@ namespace dlib
// initialize data to the right size to contain the stuff in the iterator range. // initialize data to the right size to contain the stuff in the iterator range.
data.set_size(std::distance(begin,end), nr, nc, pixel_traits<T>::num); data.set_size(std::distance(ibegin,iend), nr, nc, pixel_traits<T>::num);
auto ptr = data.host(); auto ptr = data.host();
for (auto i = begin; i != end; ++i) for (auto i = ibegin; i != iend; ++i)
{ {
for (long r = 0; r < nr; ++r) for (long r = 0; r < nr; ++r)
{ {
...@@ -86,16 +86,16 @@ namespace dlib ...@@ -86,16 +86,16 @@ namespace dlib
template <typename input_iterator> template <typename input_iterator>
void to_tensor ( void to_tensor (
input_iterator begin, input_iterator ibegin,
input_iterator end, input_iterator iend,
resizable_tensor& data resizable_tensor& data
) const ) const
{ {
DLIB_CASSERT(std::distance(begin,end) > 0,""); DLIB_CASSERT(std::distance(ibegin,iend) > 0,"");
const auto nr = begin->nr(); const auto nr = ibegin->nr();
const auto nc = begin->nc(); const auto nc = ibegin->nc();
// make sure all the input matrices have the same dimensions // make sure all the input matrices have the same dimensions
for (auto i = begin; i != end; ++i) for (auto i = ibegin; i != iend; ++i)
{ {
DLIB_CASSERT(i->nr()==nr && i->nc()==nc, DLIB_CASSERT(i->nr()==nr && i->nc()==nc,
"\t input::to_tensor()" "\t input::to_tensor()"
...@@ -109,10 +109,10 @@ namespace dlib ...@@ -109,10 +109,10 @@ namespace dlib
// initialize data to the right size to contain the stuff in the iterator range. // initialize data to the right size to contain the stuff in the iterator range.
data.set_size(std::distance(begin,end), nr, nc, pixel_traits<T>::num); data.set_size(std::distance(ibegin,iend), nr, nc, pixel_traits<T>::num);
auto ptr = data.host(); auto ptr = data.host();
for (auto i = begin; i != end; ++i) for (auto i = ibegin; i != iend; ++i)
{ {
for (long r = 0; r < nr; ++r) for (long r = 0; r < nr; ++r)
{ {
......
...@@ -59,22 +59,22 @@ namespace dlib ...@@ -59,22 +59,22 @@ namespace dlib
template <typename input_iterator> template <typename input_iterator>
void to_tensor ( void to_tensor (
input_iterator begin, input_iterator ibegin,
input_iterator end, input_iterator iend,
resizable_tensor& data resizable_tensor& data
) const ) const
/*! /*!
requires requires
- [begin, end) is an iterator range over input_type objects. - [ibegin, iend) is an iterator range over input_type objects.
- std::distance(begin,end) > 0 - std::distance(ibegin,iend) > 0
ensures ensures
- Converts the iterator range into a tensor and stores it into #data. - Converts the iterator range into a tensor and stores it into #data.
- #data.num_samples() == distance(begin,end)*sample_expansion_factor. - #data.num_samples() == distance(ibegin,iend)*sample_expansion_factor.
- Normally you would have #data.num_samples() == distance(begin,end) but - Normally you would have #data.num_samples() == distance(ibegin,iend) but
you can also expand the output by some integer factor so long as the loss you can also expand the output by some integer factor so long as the loss
you use can deal with it correctly. you use can deal with it correctly.
- The data in the ith sample in #data corresponds to - The data in the ith sample in #data corresponds to
*(begin+i/sample_expansion_factor). *(ibegin+i/sample_expansion_factor).
!*/ !*/
}; };
...@@ -100,21 +100,21 @@ namespace dlib ...@@ -100,21 +100,21 @@ namespace dlib
template <typename input_iterator> template <typename input_iterator>
void to_tensor ( void to_tensor (
input_iterator begin, input_iterator ibegin,
input_iterator end, input_iterator iend,
resizable_tensor& data resizable_tensor& data
) const; ) const;
/*! /*!
requires requires
- [begin, end) is an iterator range over input_type objects. - [ibegin, iend) is an iterator range over input_type objects.
- std::distance(begin,end) > 0 - std::distance(ibegin,iend) > 0
- The input range should contain image objects that all have the same - The input range should contain image objects that all have the same
dimensions. dimensions.
ensures ensures
- Converts the iterator range into a tensor and stores it into #data. In - Converts the iterator range into a tensor and stores it into #data. In
particular, if the input images have R rows, C columns, and K channels particular, if the input images have R rows, C columns, and K channels
(where K is given by pixel_traits::num) then we will have: (where K is given by pixel_traits::num) then we will have:
- #data.num_samples() == std::distance(begin,end) - #data.num_samples() == std::distance(ibegin,iend)
- #data.nr() == R - #data.nr() == R
- #data.nc() == C - #data.nc() == C
- #data.k() == K - #data.k() == K
......
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