42 #ifndef GEN_PERM_MATRIX_SLICE_ITERATOR_H
43 #define GEN_PERM_MATRIX_SLICE_ITERATOR_H
49 #include "AbstractLinAlgPack_Types.hpp"
51 namespace AbstractLinAlgPack {
53 namespace GenPermMatrixSliceIteratorPack {
56 enum EOrderedBy { BY_ROW, BY_COL, BY_ROW_AND_COL, UNORDERED };
77 row_off_(row_off), col_off_(col_off), row_i_(row_i), col_j_(col_j)
125 *row_i_ = val.row_i_;
126 *col_j_ = val.col_j_;
138 void assert_in_range()
const;
147 void swap( row_col_value_type<T>& v1, row_col_value_type<T>& v2 )
149 row_col_value_type<T> tmp = v1;
159 #if defined(_WINDOWS) || defined(_INTEL_CXX) || defined(_PG_CXX)
160 :
public std::iterator< std::random_access_iterator_tag, row_col_value_type<T>, ptrdiff_t >
213 bool operator<( const row_col_iterator<T>& itr)
const;
215 bool operator<=( const row_col_iterator<T>& itr)
const;
257 row_off_ = val.row_off_;
258 col_off_ = val.col_off_;
279 return *row_i_ + row_off_;
287 return *col_j_ + col_off_;
302 *row_i_ = *val.row_i_;
303 *col_j_ = *val.col_j_;
316 void GPMS_row_col_iterator_assert_not_null(
const void* p);
325 value_(0,0,NULL,NULL,0)
338 value_(row_off,col_off,row_i,col_j,nz)
345 value_.bind_view( itr.value_ );
354 GPMS_row_col_iterator_assert_not_null(value_.row_i_ptr());
364 GPMS_row_col_iterator_assert_not_null(value_.row_i_ptr());
373 GPMS_row_col_iterator_assert_not_null(value_.row_i_ptr());
383 itr.value_.increment(d);
393 itr.value_.increment(-d);
411 value_.increment(-d);
439 value_.increment(-1);
449 value_.increment(-1);
458 return value_.row_i_ptr() - itr.value_.row_i_ptr();
465 return ( value_.row_i_ptr() && itr.value_.row_i_ptr() )
466 && ( value_.row_i_ptr() < itr.value_.row_i_ptr() );
473 return ( value_.row_i_ptr() && itr.value_.row_i_ptr() )
474 && ( value_.row_i_ptr() <= itr.value_.row_i_ptr() );
481 return ( value_.row_i_ptr() && itr.value_.row_i_ptr() )
482 && ( value_.row_i_ptr() > itr.value_.row_i_ptr() );
489 return ( value_.row_i_ptr() && itr.value_.row_i_ptr() )
490 && ( value_.row_i_ptr() >= itr.value_.row_i_ptr() );
497 return ( value_.row_i_ptr() && itr.value_.row_i_ptr() )
498 && ( value_.row_i_ptr() == itr.value_.row_i_ptr() );
505 return ( value_.row_i_ptr() && itr.value_.row_i_ptr() )
506 && ( value_.row_i_ptr() != itr.value_.row_i_ptr() );
513 return value_.row_i_ptr() == NULL;
520 #endif // GEN_PERM_MATRIX_SLICE_ITERATOR_H
row_col_iterator< T > & operator+=(difference_type)
itr += a
bool operator!() const
!itr (check for null)
bool operator<(const row_col_iterator< T > &itr) const
itr1 < itr2
bool operator>(const row_col_iterator< T > &itr) const
itr1 > itr 2
bool operator!=(const row_col_iterator< T > &itr) const
itr1 != itr2
row_col_iterator< T > & operator--()
–itr
row_col_iterator< T > operator-(difference_type)
itr - a
bool operator>=(const row_col_iterator< T > &itr) const
itr1 >= itr2
Internal storage for the iterator of the row and column indices.
ptrdiff_t difference_type
void bind_view(const row_col_value_type< T > &val)
bool operator==(const row_col_iterator< T > &itr) const
itr1 == itr2
external_row_col_value_type(difference_type row_off, difference_type col_off, index_type row_i, index_type col_j)
row_col_iterator< T > & operator=(const row_col_iterator< T > &itr)
This is a full random access iterator for accessing row and colunmn indices.
row_col_value_type< T > value_type
row_col_value_type< T > & operator=(const external_row_col_value_type< T > &val)
void increment(difference_type)
ptrdiff_t difference_type
row_col_value_type< T > & operator=(const row_col_value_type< T > &val)
row_col_iterator()
Null pointer!
row_col_iterator< T > operator+(difference_type) const
itr + a
row_col_iterator< T > & operator++()
++itr
ptrdiff_t difference_type
std::random_access_iterator_tag iterator_category
row_col_value_type< T > * pointer
External storage of a row and column indice. This is required for creating a temporary in an assignme...
row_col_iterator< T > & operator-=(difference_type)
itr -= a
bool operator<=(const row_col_iterator< T > &itr) const
itr1 <= itr2
row_col_value_type< T > & reference
pointer operator->() const
#define TEUCHOS_TEST_FOR_EXCEPT(throw_exception_test)
index_type * row_i_ptr() const
May be NULL.