Garfield++ v1r0
A toolkit for the detailed simulation of particle detectors based on ionisation measurement in gases and semiconductors
Loading...
Searching...
No Matches
BlkArr.h File Reference

Go to the source code of this file.

Classes

class  BlkArr< T >
 

Functions

template<class T >
std::ostream & operator<< (std::ostream &file, const BlkArr< T > &f)
 
template<class T >
void print_BlkArr (std::ostream &file, const DynLinArr< T > &f, int l)
 
template<class T >
int operator== (const BlkArr< T > &f1, const BlkArr< T > &f2)
 
template<class T , class P >
int apeq_mant (const BlkArr< T > &f1, const BlkArr< T > &f2, P prec)
 
template<class T >
int operator!= (const BlkArr< T > &f1, const BlkArr< T > &f2)
 
template<class T >
DynLinArr< T > convert (const BlkArr< T > &f)
 

Variables

const long max_size_of_extra_increment = 1000000
 

Function Documentation

◆ apeq_mant()

template<class T , class P >
int apeq_mant ( const BlkArr< T > &  f1,
const BlkArr< T > &  f2,
prec 
)

Definition at line 555 of file BlkArr.h.

555 {
556 if (f1.get_qel() != f2.get_qel()) return 0;
557 long q = f1.get_qel();
558 long n;
559 for (n = 0; n < q; n++) {
560 if (!apeq_mant(f1[n], f2[n], prec)) return 0;
561 }
562 return 1;
563}
int apeq_mant(const BlkArr< T > &f1, const BlkArr< T > &f2, P prec)
Definition: BlkArr.h:555
long get_qel(void) const
Definition: BlkArr.h:181

Referenced by apeq_mant().

◆ convert()

template<class T >
DynLinArr< T > convert ( const BlkArr< T > &  f)

Definition at line 573 of file BlkArr.h.

575 {
576 long q = f.get_qel();
577 DynLinArr<T> temp(q);
578 long n;
579 for (n = 0; n < q; n++) {
580 temp[n] = f[n];
581 }
582 return DynLinArr<T>(temp, steal);
583
584}
@ steal
Definition: AbsPtr.h:513

◆ operator!=()

template<class T >
int operator!= ( const BlkArr< T > &  f1,
const BlkArr< T > &  f2 
)

Definition at line 565 of file BlkArr.h.

565 {
566 if (f1 == f2)
567 return 0;
568 else
569 return 1;
570}

◆ operator<<()

template<class T >
std::ostream & operator<< ( std::ostream &  file,
const BlkArr< T > &  f 
)

Definition at line 513 of file BlkArr.h.

513 {
514 //mfunnamep("template<class T> std::ostream& operator<<(std::ostream& file,
515 //const BlkArr<T>& f)");
516 Ifile << "BlkArr<T>: qel=" << f.get_qel() << '\n';
517 f.print_struct(file);
518 long n;
519 indn.n += 2;
520 for (n = 0; n < f.get_qel(); n++) {
521 Ifile << "n=" << n << " el[n]=" << noindent << f[n] << yesindent << '\n';
522 }
523 file << yesindent;
524 indn.n -= 2;
525 return file;
526}
void print_struct(std::ostream &file) const
Definition: BlkArr.h:493
indentation indn
Definition: prstream.cpp:13
std::ostream & yesindent(std::ostream &f)
Definition: prstream.cpp:19
std::ostream & noindent(std::ostream &f)
Definition: prstream.cpp:15
#define Ifile
Definition: prstream.h:207

◆ operator==()

template<class T >
int operator== ( const BlkArr< T > &  f1,
const BlkArr< T > &  f2 
)

Definition at line 544 of file BlkArr.h.

544 {
545 if (f1.get_qel() != f2.get_qel()) return 0;
546 long q = f1.get_qel();
547 long n;
548 for (n = 0; n < q; n++) {
549 if (!(f1[n] == f2[n])) return 0;
550 }
551 return 1;
552}

◆ print_BlkArr()

template<class T >
void print_BlkArr ( std::ostream &  file,
const DynLinArr< T > &  f,
int  l 
)

Definition at line 529 of file BlkArr.h.

529 {
530 //mfunnamep("template<class T> void print_BlkArr(std::ostream& file, const
531 //BlkArr<T>& f, int l)");
532 Ifile << "BlkArr<T>: qel=" << f.get_qel() << '\n';
533 f.print_struct(file);
534 long n;
535 indn.n += 2;
536 for (n = 0; n < f.get_qel(); n++) {
537 Ifile << "n=" << n << " el[n]=" << noindent;
538 f[n].print(file, l);
539 }
540 file << yesindent;
541 indn.n -= 2;
542}
long get_qel(void) const
Definition: AbsArr.h:420

Variable Documentation

◆ max_size_of_extra_increment

const long max_size_of_extra_increment = 1000000

Definition at line 76 of file BlkArr.h.

Referenced by BlkArr< T >::put_qel().