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)
 
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 458 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 
)

Definition at line 461 of file coupling_matrix.h.

References _it, _location, libMesh::ConstCouplingRow::_mat, libMesh::CouplingMatrix::_ranges, _row, and std::max().

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

Member Function Documentation

◆ operator!=()

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

Definition at line 534 of file coupling_matrix.h.

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

◆ operator*()

unsigned int libMesh::ConstCouplingRowConstIterator::operator* ( )

Definition at line 482 of file coupling_matrix.h.

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

483  {
484  libmesh_assert_not_equal_to
486  return cast_int<unsigned int>(_location % _row._mat.size());
487  }
long double max(long double a, double b)
unsigned int size() const
const CouplingMatrix & _mat

◆ operator++()

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

Definition at line 489 of file coupling_matrix.h.

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

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

◆ operator==()

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

Definition at line 520 of file coupling_matrix.h.

References _location, and _row.

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

Member Data Documentation

◆ _it

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

Definition at line 546 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: