libMesh
Public Member Functions | Private Attributes | List of all members
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)
 
std::size_t 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 457 of file coupling_matrix.h.

Constructor & Destructor Documentation

◆ ConstCouplingRowConstIterator()

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

Definition at line 460 of file coupling_matrix.h.

References _it, _location, libMesh::ConstCouplingRow::_mat, libMesh::CouplingMatrix::_ranges, and _row.

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

Member Function Documentation

◆ operator!=()

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

Definition at line 533 of file coupling_matrix.h.

534  {
535  return !(*this == other);
536  }

◆ operator*()

std::size_t libMesh::ConstCouplingRowConstIterator::operator* ( )
inline

Definition at line 481 of file coupling_matrix.h.

References _location, libMesh::ConstCouplingRow::_mat, _row, and libMesh::CouplingMatrix::size().

482  {
483  libmesh_assert_not_equal_to
484  (_location, std::numeric_limits<std::size_t>::max());
485  return _location % _row._mat.size();
486  }
std::size_t size() const
const CouplingMatrix & _mat

◆ operator++()

ConstCouplingRowConstIterator& libMesh::ConstCouplingRowConstIterator::operator++ ( )
inline

Definition at line 488 of file coupling_matrix.h.

References libMesh::ConstCouplingRow::_end_location, _it, _location, libMesh::ConstCouplingRow::_mat, libMesh::CouplingMatrix::_ranges, _row, and libMesh::libmesh_assert().

489  {
490  libmesh_assert_not_equal_to
491  (_location, std::numeric_limits<std::size_t>::max());
493  (_it != _row._mat._ranges.end());
494 
495  if (_location >= _it->second)
496  {
497  ++_it;
498 
499  // Are we past the end of the matrix?
500  if (_it == _row._mat._ranges.end())
501  _location = std::numeric_limits<std::size_t>::max();
502  else
503  {
504  _location = _it->first;
505  // Is the new range past the end of the row?
507  _location = std::numeric_limits<std::size_t>::max();
508  }
509  }
510  // Would incrementing put us past the end of the row?
511  else if (_location >= _row._end_location)
512  _location = std::numeric_limits<std::size_t>::max();
513  else
514  ++_location;
515 
516  return *this;
517  }
const std::size_t _end_location
libmesh_assert(ctx)
CouplingMatrix::rc_type::const_iterator _it
const CouplingMatrix & _mat

◆ operator==()

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

Definition at line 519 of file coupling_matrix.h.

References _location, _row, and libMesh::libmesh_assert().

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

Member Data Documentation

◆ _it

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

Definition at line 545 of file coupling_matrix.h.

Referenced by ConstCouplingRowConstIterator(), and operator++().

◆ _location

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

◆ _row

const ConstCouplingRow& libMesh::ConstCouplingRowConstIterator::_row
private

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