2 #ifndef vnl_scalar_join_iterator_hxx_ 3 #define vnl_scalar_join_iterator_hxx_ 16 # include <vcl_msvc_warnings.h> 19 #define VNL_SCALAR_JOIN_ITERATOR_INSTANTIATE(T) \ 20 template class VNL_EXPORT vnl_scalar_join_iterator_indexed_pair<T >;\ 21 template class VNL_EXPORT vnl_scalar_join_iterator<T >; \ 22 template VNL_EXPORT std::ostream& operator<<(std::ostream& s, const vnl_scalar_join_iterator_indexed_pair<T >& p);\ 33 return (*that.object) == (*object);
40 return (*
object) < (*that.object);
63 for (
unsigned i = 0; i <
n1; ++i)
68 for (
unsigned i = 0; i <
n2; ++i)
79 T star1 = *(*index1).object;
80 T star2 = *(*index2).object;
102 return (index1 == I1.end()) || (index2 == I2.end());
109 T obj1 = *(*index1).object;
111 if (++index2 == I2.end())
return;
113 T nextobj2 = *(*index2).object;
114 if (obj1 == nextobj2)
118 assert(!(nextobj2 < obj1));
123 T obj1 = *(*index1).object;
124 T obj2 = *(*index2).object;
146 return (*index1).original_index;
152 return (*index2).original_index;
159 std::cerr <<
"This should not happen! postfix ++ called\n";
163 #endif // vnl_scalar_join_iterator_hxx_
std::list< vnl_scalar_join_iterator_indexed_pair< T > > & I2
vnl_scalar_join_iterator< T > & operator++()
Advance to the next pair. This is prefix ++.
An ordinary mathematical matrix.
Database join on matrix columns.
Database join on matrix columns.
std::ostream & operator<<(std::ostream &s, vnl_decnum const &r)
decimal output.
Helper class to hold the sorted arrays of indices.
~vnl_scalar_join_iterator()
Destructor.
unsigned row2() const
Return the index of the current row in the second relation.
std::list< vnl_scalar_join_iterator_indexed_pair< T > >::iterator index1
vnl_scalar_join_iterator(const vnl_matrix< T > &relation1, unsigned column1, const vnl_matrix< T > &relation2, unsigned column2)
Initialize this iterator to the join of relation1(:,column1) and relation2(:,column2).
An ordinary mathematical matrix.
std::list< vnl_scalar_join_iterator_indexed_pair< T > > & I1
void next()
Increment the iterator to point to the next pair of rows.
std::list< vnl_scalar_join_iterator_indexed_pair< T > >::iterator index2
unsigned row1() const
Return the index of the current row in the first relation.