Garfield++ 4.0
A toolkit for the detailed simulation of particle detectors based on ionisation measurement in gases and semiconductors
Loading...
Searching...
No Matches
Heed::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 Heed::IterDynArr< T >

Definition at line 2343 of file AbsArr.h.

Constructor & Destructor Documentation

◆ IterDynArr()

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

Definition at line 2345 of file AbsArr.h.

2346 : ncur(fdar->get_qdim()), dar((DynArr<T>*)fdar) {
2347 long n;
2348 long qdim1 = ncur.get_qel() - 1;
2349 if (qdim1 >= 0) {
2350 for (n = 0; n < qdim1; n++) ncur[n] = 0;
2351 ncur[qdim1] = -1;
2352 }
2353 }
long get_qel(void) const
Definition: AbsArr.h:283

Member Function Documentation

◆ current()

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

Definition at line 2362 of file AbsArr.h.

2363 {
2364 long n;
2365 long qdim = ncur.get_qel();
2366 if (qdim <= 0) return NULL;
2367 for (n = 0; n < qdim; n++) {
2368 if (ncur[n] < 0 || ncur[n] >= dar->get_qel()[n]) return NULL;
2369 }
2370 return &(dar->ac(ncur));
2371 }

◆ get_ncur()

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

◆ less()

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

Definition at line 2373 of file AbsArr.h.

2375 {
2376 if (find_prev_comb(dar->get_qel(), ncur))
2377 return &(dar->ac(ncur));
2378 else
2379 return NULL;
2380 }
int find_prev_comb(const DynLinArr< long > &qel, DynLinArr< long > &f)
Definition: AbsArr.cpp:501

◆ more()

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

Definition at line 2354 of file AbsArr.h.

2355 {
2356 if (find_next_comb(dar->get_qel(), ncur))
2357 return &(dar->ac(ncur));
2358 else
2359 return NULL;
2360 }
int find_next_comb(const DynLinArr< long > &qel, DynLinArr< long > &f)
Definition: AbsArr.cpp:450

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


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