MBDyn-1.7.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups
CompactSparseMatrixHandler_tpl< off >::const_iterator Class Reference

#include <spmh.h>

Collaboration diagram for CompactSparseMatrixHandler_tpl< off >::const_iterator:

Public Member Functions

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

Protected Member Functions

void reset (bool is_end=false)
 

Private Attributes

const
CompactSparseMatrixHandler_tpl
< off > & 
m
 
integer i_idx
 
SparseMatrixHandler::SparseMatrixElement elem
 

Detailed Description

template<int off>
class CompactSparseMatrixHandler_tpl< off >::const_iterator

Definition at line 218 of file spmh.h.

Constructor & Destructor Documentation

template<int off>
CompactSparseMatrixHandler_tpl< off >::const_iterator::const_iterator ( const CompactSparseMatrixHandler_tpl< off > &  m,
bool  is_end = false 
)

Definition at line 299 of file spmh.cc.

References CompactSparseMatrixHandler_tpl< off >::const_iterator::reset().

300 : m(m)
301 {
302  reset(is_end);
303 }
const CompactSparseMatrixHandler_tpl< off > & m
Definition: spmh.h:220

Here is the call graph for this function:

template<int off>
CompactSparseMatrixHandler_tpl< off >::const_iterator::~const_iterator ( void  )

Definition at line 306 of file spmh.cc.

References NO_OP.

307 {
308  NO_OP;
309 }
#define NO_OP
Definition: myassert.h:74

Member Function Documentation

Definition at line 352 of file spmh.cc.

References CompactSparseMatrixHandler_tpl< off >::const_iterator::elem.

353 {
354  return elem != op.elem;
355 }
SparseMatrixHandler::SparseMatrixElement elem
Definition: spmh.h:222
template<int off>
const SparseMatrixHandler::SparseMatrixElement & CompactSparseMatrixHandler_tpl< off >::const_iterator::operator* ( void  )

Definition at line 338 of file spmh.cc.

339 {
340  return elem;
341 }
SparseMatrixHandler::SparseMatrixElement elem
Definition: spmh.h:222
template<int off>
const CompactSparseMatrixHandler_tpl< off >::const_iterator & CompactSparseMatrixHandler_tpl< off >::const_iterator::operator++ ( void  ) const

Definition at line 313 of file spmh.cc.

314 {
315  i_idx++;
316  while (i_idx == m.Ap[elem.iCol + 1] - off) {
317  if (++elem.iCol == m.iGetNumCols()) {
318  elem.iRow = m.iGetNumRows();
319  return *this;
320  }
321  i_idx = m.Ap[elem.iCol] - off;
322  }
323  elem.iRow = m.Ai[i_idx] - off;
324  elem.dCoef = m.Ax[i_idx];
325 
326  return *this;
327 }
const CompactSparseMatrixHandler_tpl< off > & m
Definition: spmh.h:220
SparseMatrixHandler::SparseMatrixElement elem
Definition: spmh.h:222
template<int off>
const SparseMatrixHandler::SparseMatrixElement * CompactSparseMatrixHandler_tpl< off >::const_iterator::operator-> ( void  )

Definition at line 331 of file spmh.cc.

332 {
333  return &elem;
334 }
SparseMatrixHandler::SparseMatrixElement elem
Definition: spmh.h:222
template<int off>
bool CompactSparseMatrixHandler_tpl< off >::const_iterator::operator== ( const CompactSparseMatrixHandler_tpl< off >::const_iterator op) const

Definition at line 345 of file spmh.cc.

References CompactSparseMatrixHandler_tpl< off >::const_iterator::elem.

346 {
347  return elem == op.elem;
348 }
SparseMatrixHandler::SparseMatrixElement elem
Definition: spmh.h:222
template<int off>
void CompactSparseMatrixHandler_tpl< off >::const_iterator::reset ( bool  is_end = false)
protected

Definition at line 278 of file spmh.cc.

References SparseMatrixHandler::SparseMatrixElement::dCoef, CompactSparseMatrixHandler_tpl< off >::const_iterator::elem, CompactSparseMatrixHandler_tpl< off >::const_iterator::i_idx, SparseMatrixHandler::SparseMatrixElement_base::iCol, SparseMatrixHandler::SparseMatrixElement_base::iRow, and CompactSparseMatrixHandler_tpl< off >::const_iterator::m.

Referenced by CompactSparseMatrixHandler_tpl< off >::const_iterator::const_iterator().

279 {
280  if (is_end) {
281  elem.iRow = m.iGetNumRows();
282  elem.iCol = m.iGetNumCols();
283 
284  } else {
285  elem.iCol = 0;
286  while (m.Ap[elem.iCol + 1] - off == m.Ap[elem.iCol] - off) {
287  if (++elem.iCol == m.iGetNumCols()) {
288  elem.iRow = m.iGetNumRows();
289  return;
290  }
291  }
292  i_idx = m.Ap[elem.iCol] - off;
293  elem.iRow = m.Ai[i_idx] - off;
294  elem.dCoef = m.Ax[i_idx];
295  }
296 }
const CompactSparseMatrixHandler_tpl< off > & m
Definition: spmh.h:220
SparseMatrixHandler::SparseMatrixElement elem
Definition: spmh.h:222

Member Data Documentation

template<int off>
integer CompactSparseMatrixHandler_tpl< off >::const_iterator::i_idx
mutableprivate
template<int off>
const CompactSparseMatrixHandler_tpl<off>& CompactSparseMatrixHandler_tpl< off >::const_iterator::m
private

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