Garfield++ v1r0
A toolkit for the detailed simulation of particle detectors based on ionisation measurement in gases and semiconductors
Loading...
Searching...
No Matches
IterDynArr< T > Class Template Reference

#include <AbsArr.h>

Public Member Functions

 IterDynArr (const DynArr< T > *fdar)
 
T * more (void)
 
T * current (void)
 
T * less (void)
 
const DynLinArr< long > & get_ncur (void) const
 

Detailed Description

template<class T>
class IterDynArr< T >

Definition at line 2762 of file AbsArr.h.

Constructor & Destructor Documentation

◆ IterDynArr()

template<class T >
IterDynArr< T >::IterDynArr ( const DynArr< T > *  fdar)
inline

Definition at line 2764 of file AbsArr.h.

2765 : ncur(fdar->get_qdim()), dar((DynArr<T>*)fdar) {
2766 long n;
2767 long qdim1 = ncur.get_qel() - 1;
2768 if (qdim1 >= 0) {
2769 for (n = 0; n < qdim1; n++)
2770 ncur[n] = 0;
2771 ncur[qdim1] = -1;
2772 }
2773 }
long get_qdim(void) const
Definition: AbsArr.h:2547
long get_qel(void) const
Definition: AbsArr.h:420

Member Function Documentation

◆ current()

template<class T >
T * IterDynArr< T >::current ( void  )
inline

Definition at line 2782 of file AbsArr.h.

2783 {
2784 long n;
2785 long qdim = ncur.get_qel();
2786 if (qdim <= 0) return NULL;
2787 for (n = 0; n < qdim; n++) {
2788 if (ncur[n] < 0 || ncur[n] >= dar->get_qel()[n]) return NULL;
2789 }
2790 return &(dar->ac(ncur));
2791 }

◆ get_ncur()

template<class T >
const DynLinArr< long > & IterDynArr< T >::get_ncur ( void  ) const
inline

◆ less()

template<class T >
T * IterDynArr< T >::less ( void  )
inline

Definition at line 2793 of file AbsArr.h.

2795 {
2796 if (find_prev_comb(dar->get_qel(), ncur))
2797 return &(dar->ac(ncur));
2798 else
2799 return NULL;
2800 }
int find_prev_comb(const DynLinArr< long > &qel, DynLinArr< long > &f)
Definition: AbsArr.cpp:520

◆ more()

template<class T >
T * IterDynArr< T >::more ( void  )
inline

Definition at line 2774 of file AbsArr.h.

2775 {
2776 if (find_next_comb(dar->get_qel(), ncur))
2777 return &(dar->ac(ncur));
2778 else
2779 return NULL;
2780 }
int find_next_comb(const DynLinArr< long > &qel, DynLinArr< long > &f)
Definition: AbsArr.cpp:465

Referenced by convert_DynArr(), copy_DynArr(), operator+(), operator-(), operator<<(), print_DynArr(), print_DynArr_int_w(), and DynArr< T >::put_qel().


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