MBDyn-1.7.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups
SpMapMatrixHandler::const_iterator Class Reference

#include <spmapmh.h>

Collaboration diagram for SpMapMatrixHandler::const_iterator:

Public Member Functions

 const_iterator (const SpMapMatrixHandler &m, bool is_end=false)
 
 ~const_iterator (void)
 
const
SpMapMatrixHandler::const_iterator
operator++ (void) const
 
const
SparseMatrixHandler::SparseMatrixElement
operator-> (void) const
 
const
SparseMatrixHandler::SparseMatrixElement
operator* (void) const
 
bool operator== (const SpMapMatrixHandler::const_iterator &op) const
 
bool operator!= (const SpMapMatrixHandler::const_iterator &op) const
 

Protected Member Functions

void reset (bool is_end=false)
 

Private Attributes

const SpMapMatrixHandlerm
 
row_cont_type::const_iterator i
 
SparseMatrixHandler::SparseMatrixElement elem
 

Friends

class SpMapMatrixHandler
 

Detailed Description

Definition at line 91 of file spmapmh.h.

Constructor & Destructor Documentation

SpMapMatrixHandler::const_iterator::const_iterator ( const SpMapMatrixHandler m,
bool  is_end = false 
)

Definition at line 390 of file spmapmh.cc.

References reset().

391 : m(m)
392 {
393  reset(is_end);
394 }
const SpMapMatrixHandler & m
Definition: spmapmh.h:95
void reset(bool is_end=false)
Definition: spmapmh.cc:376

Here is the call graph for this function:

SpMapMatrixHandler::const_iterator::~const_iterator ( void  )

Definition at line 396 of file spmapmh.cc.

References NO_OP.

397 {
398  NO_OP;
399 }
#define NO_OP
Definition: myassert.h:74

Member Function Documentation

Definition at line 439 of file spmapmh.cc.

References elem.

440 {
441  return elem != op.elem;
442 }
SparseMatrixHandler::SparseMatrixElement elem
Definition: spmapmh.h:97
const SparseMatrixHandler::SparseMatrixElement & SpMapMatrixHandler::const_iterator::operator* ( void  ) const

Definition at line 427 of file spmapmh.cc.

428 {
429  return elem;
430 }
SparseMatrixHandler::SparseMatrixElement elem
Definition: spmapmh.h:97
const SpMapMatrixHandler::const_iterator & SpMapMatrixHandler::const_iterator::operator++ ( void  ) const

Definition at line 402 of file spmapmh.cc.

References SparseMatrixHandler::SparseMatrixElement::dCoef.

403 {
404  ++i;
405  while (i == m.col_indices[elem.iCol].end()) {
406  if (++elem.iCol == m.NCols) {
407  elem.iRow = m.NRows;
408  return *this;
409  }
410 
411  i = m.col_indices[elem.iCol].begin();
412  }
413 
414  elem.iRow = i->first;
415  elem.dCoef = i->second;
416 
417  return *this;
418 }
std::vector< row_cont_type > col_indices
Definition: spmapmh.h:79
SparseMatrixHandler::SparseMatrixElement elem
Definition: spmapmh.h:97
row_cont_type::const_iterator i
Definition: spmapmh.h:96
const SpMapMatrixHandler & m
Definition: spmapmh.h:95
integer NRows
Definition: spmh.h:45
integer NCols
Definition: spmh.h:46
const SparseMatrixHandler::SparseMatrixElement * SpMapMatrixHandler::const_iterator::operator-> ( void  ) const

Definition at line 421 of file spmapmh.cc.

422 {
423  return &elem;
424 }
SparseMatrixHandler::SparseMatrixElement elem
Definition: spmapmh.h:97
bool SpMapMatrixHandler::const_iterator::operator== ( const SpMapMatrixHandler::const_iterator op) const

Definition at line 433 of file spmapmh.cc.

References elem.

434 {
435  return elem == op.elem;
436 }
SparseMatrixHandler::SparseMatrixElement elem
Definition: spmapmh.h:97
void SpMapMatrixHandler::const_iterator::reset ( bool  is_end = false)
protected

Definition at line 376 of file spmapmh.cc.

References SpMapMatrixHandler::col_indices, SparseMatrixHandler::SparseMatrixElement::dCoef, elem, i, SparseMatrixHandler::SparseMatrixElement_base::iCol, SparseMatrixHandler::SparseMatrixElement_base::iRow, m, SparseMatrixHandler::NCols, and SparseMatrixHandler::NRows.

Referenced by const_iterator(), and SpMapMatrixHandler::Resize().

377 {
378  if (is_end) {
379  elem.iRow = m.NRows;
380  elem.iCol = m.NCols;
381 
382  } else {
383  i = m.col_indices[0].begin();
384  elem.iRow = i->first;
385  elem.iCol = 0;
386  elem.dCoef = i->second;
387  }
388 }
std::vector< row_cont_type > col_indices
Definition: spmapmh.h:79
SparseMatrixHandler::SparseMatrixElement elem
Definition: spmapmh.h:97
row_cont_type::const_iterator i
Definition: spmapmh.h:96
const SpMapMatrixHandler & m
Definition: spmapmh.h:95
integer NRows
Definition: spmh.h:45
integer NCols
Definition: spmh.h:46

Friends And Related Function Documentation

friend class SpMapMatrixHandler
friend

Definition at line 92 of file spmapmh.h.

Member Data Documentation

SparseMatrixHandler::SparseMatrixElement SpMapMatrixHandler::const_iterator::elem
mutableprivate

Definition at line 97 of file spmapmh.h.

Referenced by operator!=(), operator==(), and reset().

row_cont_type::const_iterator SpMapMatrixHandler::const_iterator::i
mutableprivate

Definition at line 96 of file spmapmh.h.

Referenced by reset().

const SpMapMatrixHandler& SpMapMatrixHandler::const_iterator::m
private

Definition at line 95 of file spmapmh.h.

Referenced by reset().


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