libMesh::ConstCouplingRowConstIterator Class Reference

#include <coupling_matrix.h>

Public Member Functions

 ConstCouplingRowConstIterator (const ConstCouplingRow &row_in, std::size_t loc_in, CouplingMatrix::rc_type::const_iterator it_in)
 
unsigned int operator* ()
 
ConstCouplingRowConstIteratoroperator++ ()
 
bool operator== (const ConstCouplingRowConstIterator &other) const
 
bool operator!= (const ConstCouplingRowConstIterator &other) const
 

Private Attributes

std::size_t _location
 
const ConstCouplingRow_row
 
CouplingMatrix::rc_type::const_iterator _it
 

Detailed Description

Definition at line 456 of file coupling_matrix.h.

Constructor & Destructor Documentation

libMesh::ConstCouplingRowConstIterator::ConstCouplingRowConstIterator ( const ConstCouplingRow row_in,
std::size_t  loc_in,
CouplingMatrix::rc_type::const_iterator  it_in 
)
inline

Definition at line 459 of file coupling_matrix.h.

References std::max().

461  :
462  _location(loc_in),
463  _row(row_in),
464  _it(it_in)
465  {
466 #ifndef NDEBUG
467  if (_it != _row._mat._ranges.end())
468  {
469  libmesh_assert_less_equal(_it->first, _location);
470  libmesh_assert_less_equal(_location, _it->second);
471  }
472  else
473  {
474  libmesh_assert_equal_to
476  }
477 #endif
478  }
long double max(long double a, double b)
CouplingMatrix::rc_type::const_iterator _it
const CouplingMatrix & _mat

Member Function Documentation

bool libMesh::ConstCouplingRowConstIterator::operator!= ( const ConstCouplingRowConstIterator other) const
inline

Definition at line 532 of file coupling_matrix.h.

533  {
534  return !(*this == other);
535  }
unsigned int libMesh::ConstCouplingRowConstIterator::operator* ( )
inline

Definition at line 480 of file coupling_matrix.h.

References std::max().

481  {
482  libmesh_assert_not_equal_to
484  return _location % _row._mat.size();
485  }
long double max(long double a, double b)
unsigned int size() const
const CouplingMatrix & _mat
ConstCouplingRowConstIterator& libMesh::ConstCouplingRowConstIterator::operator++ ( )
inline

Definition at line 487 of file coupling_matrix.h.

References std::max().

488  {
489  libmesh_assert_not_equal_to
491  libmesh_assert
492  (_it != _row._mat._ranges.end());
493 
494  if (_location >= _it->second)
495  {
496  ++_it;
497 
498  // Are we past the end of the matrix?
499  if (_it == _row._mat._ranges.end())
501  else
502  {
503  _location = _it->first;
504  // Is the new range past the end of the row?
507  }
508  }
509  // Would incrementing put us past the end of the row?
510  else if (_location >= _row._end_location)
512  else
513  ++_location;
514 
515  return *this;
516  }
const std::size_t _end_location
long double max(long double a, double b)
CouplingMatrix::rc_type::const_iterator _it
const CouplingMatrix & _mat
bool libMesh::ConstCouplingRowConstIterator::operator== ( const ConstCouplingRowConstIterator other) const
inline

Definition at line 518 of file coupling_matrix.h.

References _location, and _row.

519  {
520  // Thinking that iterators from different row objects are equal
521  // is not even wrong
522  libmesh_assert(_row == other._row);
523 
524  return (_location == other._location);
525  // Testing for equality of _it is either redundant (for a
526  // dereferenceable iterator, where _it is defined to be the range
527  // which includes _location) or wrong (for an end iterator, where
528  // we don't always bother to set _it)
529  // && (_it == other._it);
530  }

Member Data Documentation

CouplingMatrix::rc_type::const_iterator libMesh::ConstCouplingRowConstIterator::_it
private

Definition at line 544 of file coupling_matrix.h.

std::size_t libMesh::ConstCouplingRowConstIterator::_location
private

Definition at line 540 of file coupling_matrix.h.

Referenced by operator==().

const ConstCouplingRow& libMesh::ConstCouplingRowConstIterator::_row
private

Definition at line 541 of file coupling_matrix.h.

Referenced by operator==().


The documentation for this class was generated from the following file: