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

#include <fullmh.h>

Collaboration diagram for FullMatrixHandler::const_iterator:

Public Member Functions

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

Protected Member Functions

void reset (bool is_end=false)
 

Private Attributes

const FullMatrixHandlerm
 
integer i_idx
 
SparseMatrixHandler::SparseMatrixElement elem
 

Friends

class FullMatrixHandler
 

Detailed Description

Definition at line 77 of file fullmh.h.

Constructor & Destructor Documentation

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

Definition at line 2361 of file fullmh.cc.

References reset().

2362 : m(m)
2363 {
2364  reset(is_end);
2365 }
void reset(bool is_end=false)
Definition: fullmh.cc:2347
const FullMatrixHandler & m
Definition: fullmh.h:81

Here is the call graph for this function:

FullMatrixHandler::const_iterator::~const_iterator ( void  )

Definition at line 2367 of file fullmh.cc.

References NO_OP.

2368 {
2369  NO_OP;
2370 }
#define NO_OP
Definition: myassert.h:74

Member Function Documentation

Definition at line 2421 of file fullmh.cc.

References elem.

2422 {
2423  return elem != op.elem;
2424 }
SparseMatrixHandler::SparseMatrixElement elem
Definition: fullmh.h:83
const SparseMatrixHandler::SparseMatrixElement & FullMatrixHandler::const_iterator::operator* ( void  ) const

Definition at line 2409 of file fullmh.cc.

2410 {
2411  return elem;
2412 }
SparseMatrixHandler::SparseMatrixElement elem
Definition: fullmh.h:83
const FullMatrixHandler::const_iterator & FullMatrixHandler::const_iterator::operator++ ( void  ) const

Definition at line 2373 of file fullmh.cc.

2374 {
2375 #if 0
2376  // NOTE: this version only iterates on non-zero entries
2377  do {
2378  ++i_idx;
2379  if (++elem.iRow == m.iNumRows) {
2380  if (++elem.iCol == m.iNumCols) {
2381  return *this;
2382  }
2383  elem.iRow = 0;
2384  }
2385  } while (m.pdRaw[i_idx] == 0.);
2386 #else
2387  // NOTE: this version iterates on all coefficients
2388  ++i_idx;
2389  if (++elem.iRow == m.iNumRows) {
2390  if (++elem.iCol == m.iNumCols) {
2391  return *this;
2392  }
2393  elem.iRow = 0;
2394  }
2395 #endif
2396 
2397  elem.dCoef = m.pdRaw[i_idx];
2398 
2399  return *this;
2400 }
doublereal * pdRaw
Definition: fullmh.h:69
SparseMatrixHandler::SparseMatrixElement elem
Definition: fullmh.h:83
integer iNumRows
Definition: fullmh.h:63
integer iNumCols
Definition: fullmh.h:64
const FullMatrixHandler & m
Definition: fullmh.h:81
const SparseMatrixHandler::SparseMatrixElement * FullMatrixHandler::const_iterator::operator-> ( void  ) const

Definition at line 2403 of file fullmh.cc.

2404 {
2405  return &elem;
2406 }
SparseMatrixHandler::SparseMatrixElement elem
Definition: fullmh.h:83
bool FullMatrixHandler::const_iterator::operator== ( const FullMatrixHandler::const_iterator op) const

Definition at line 2415 of file fullmh.cc.

References elem.

2416 {
2417  return elem == op.elem;
2418 }
SparseMatrixHandler::SparseMatrixElement elem
Definition: fullmh.h:83
void FullMatrixHandler::const_iterator::reset ( bool  is_end = false)
protected

Definition at line 2347 of file fullmh.cc.

References SparseMatrixHandler::SparseMatrixElement::dCoef, elem, i_idx, SparseMatrixHandler::SparseMatrixElement_base::iCol, FullMatrixHandler::iNumCols, FullMatrixHandler::iNumRows, SparseMatrixHandler::SparseMatrixElement_base::iRow, m, and FullMatrixHandler::pdRaw.

Referenced by const_iterator().

2348 {
2349  if (is_end) {
2350  elem.iRow = m.iNumRows;
2351  elem.iCol = m.iNumCols;
2352 
2353  } else {
2354  i_idx = 0;
2355  elem.iRow = 0;
2356  elem.iCol = 0;
2357  elem.dCoef = m.pdRaw[i_idx];
2358  }
2359 }
doublereal * pdRaw
Definition: fullmh.h:69
SparseMatrixHandler::SparseMatrixElement elem
Definition: fullmh.h:83
integer iNumRows
Definition: fullmh.h:63
integer iNumCols
Definition: fullmh.h:64
const FullMatrixHandler & m
Definition: fullmh.h:81

Friends And Related Function Documentation

friend class FullMatrixHandler
friend

Definition at line 78 of file fullmh.h.

Member Data Documentation

SparseMatrixHandler::SparseMatrixElement FullMatrixHandler::const_iterator::elem
mutableprivate

Definition at line 83 of file fullmh.h.

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

integer FullMatrixHandler::const_iterator::i_idx
mutableprivate

Definition at line 82 of file fullmh.h.

Referenced by reset().

const FullMatrixHandler& FullMatrixHandler::const_iterator::m
private

Definition at line 81 of file fullmh.h.

Referenced by reset().


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