par.h File Reference

#include <iomanip>
#include <stdlib.h>
#include <cmath>
#include <stack>

Go to the source code of this file.

Classes

class  par< T >
 CLASS PAR --- Simple data-parallel vectors. More...

Defines

#define ifp(x)
 Macro for data parallel ifp( par<bool> expression ).
#define elsep()
 Macro for data parallel elsep.
#define endifp
 Macro for data parallel endifp which should be 1-to-1 for the ifp().

Functions

template<class T>
par_add (T x, T y)
 -------------- symbolic functions ---------------
template<class T>
par_sub (T x, T y)
template<class T>
par_mul (T x, T y)
template<class T>
par_div (T x, T y)
template<class T>
par_mod (T x, T y)
template<class T>
par_or (T x, T y)
template<class T>
par_and (T x, T y)
template<class T>
par_max (T x, T y)
template<class T>
par_min (T x, T y)
template<class T>
par_neg (T x)
template<class T>
par_nop (T x)
template<class T>
par_not (T x)
template<class T>
par_pow (T x, T y)
template<class T>
bool par_eq (T x, T y)
 -------------- boolean functions -----------------
template<class T>
bool par_ne (T x, T y)
template<class T>
bool par_lt (T x, T y)
template<class T>
bool par_gt (T x, T y)
template<class T>
bool par_le (T x, T y)
template<class T>
bool par_ge (T x, T y)

Variables

bool * flag = NULL
 -------------- Flags for immedate bool operation ---------------
int flag_N = 0
bool * flagtemp = NULL
 -------------- Flags for ifp() endifp, top of bool stack is flagtemp ---------
bool restrict = false
bool ifelseflag = true
stack< bool * > rs
 -------------- Stack of boolean flags for ifp() and endifp() -----------------
stack< bool > ifelses


Define Documentation

 
#define elsep  ) 
 

Value:

flagtemp = rs.top(); \
        ifelseflag = false; \
        ifelses.pop(); \
        ifelses.push(false);
Macro for data parallel elsep.

Definition at line 66 of file par.h.

#define endifp
 

Value:

flagtemp = rs.top(); \
        delete [] flagtemp; \
        rs.pop(); \
        ifelses.pop(); \
        if (!ifelses.empty()) ifelseflag = ifelses.top(); \
                else ifelseflag = true; \
        if (!rs.empty()) flagtemp = rs.top(); \
                else { flagtemp=NULL; restrict = false; }
Macro for data parallel endifp which should be 1-to-1 for the ifp().

Definition at line 73 of file par.h.

Referenced by main().

#define ifp  ) 
 

Value:

(x); \
        flagtemp = new bool[flag_N]; \
        memcpy(flagtemp, flag, flag_N); \
        rs.push(flagtemp);  \
        ifelses.push(true); \
        restrict = true; \
        ifelseflag = true;
Macro for data parallel ifp( par<bool> expression ).

Definition at line 55 of file par.h.

Referenced by main().


Function Documentation

template<class T>
T par_add x,
y
[static]
 

-------------- symbolic functions ---------------

Definition at line 16 of file par.h.

Referenced by par< T >::operator+(), par< T >::operator++(), and par< T >::operator+=().

00016 { return x + y; }

template<class T>
T par_and x,
y
[static]
 

Definition at line 22 of file par.h.

Referenced by par< T >::operator &(), and par< T >::operator &=().

00022 { return x & y; }

template<class T>
T par_div x,
y
[static]
 

Definition at line 19 of file par.h.

Referenced by par< T >::operator/(), and par< T >::operator/=().

00019 { return x / y; }

template<class T>
bool par_eq x,
y
[static]
 

-------------- boolean functions -----------------

Definition at line 34 of file par.h.

00034 { return x==y; }

template<class T>
bool par_ge x,
y
[static]
 

Definition at line 39 of file par.h.

00039 { return x>=y; }

template<class T>
bool par_gt x,
y
[static]
 

Definition at line 37 of file par.h.

00037 { return x>y; }

template<class T>
bool par_le x,
y
[static]
 

Definition at line 38 of file par.h.

00038 { return x<=y; }

template<class T>
bool par_lt x,
y
[static]
 

Definition at line 36 of file par.h.

00036 { return x<y; }

template<class T>
T par_max x,
y
[static]
 

Definition at line 23 of file par.h.

Referenced by par< T >::max_value().

00023 { return x>=y ? x : y; }

template<class T>
T par_min x,
y
[static]
 

Definition at line 24 of file par.h.

Referenced by par< T >::min_value().

00024 { return x<=y ? x : y; }

template<class T>
T par_mod x,
y
[static]
 

Definition at line 20 of file par.h.

Referenced by par< T >::operator%(), and par< T >::operator%=().

00020 { return x % y; }

template<class T>
T par_mul x,
y
[static]
 

Definition at line 18 of file par.h.

Referenced by par< T >::operator *(), and par< T >::operator *=().

00018 { return x * y; }

template<class T>
bool par_ne x,
y
[static]
 

Definition at line 35 of file par.h.

00035 { return x!=y; }

template<class T>
T par_neg x  )  [static]
 

Definition at line 25 of file par.h.

Referenced by par< T >::operator-().

00025 { return -x; }

template<class T>
T par_nop x  )  [static]
 

Definition at line 26 of file par.h.

00026 { return x; }

template<class T>
T par_not x  )  [static]
 

Definition at line 27 of file par.h.

Referenced by par< T >::operator!().

00027 { return !x; }

template<class T>
T par_or x,
y
[static]
 

Definition at line 21 of file par.h.

Referenced by par< T >::operator|(), and par< T >::operator|=().

00021 { return x | y; }

template<class T>
T par_pow x,
y
[static]
 

Definition at line 31 of file par.h.

00031 { return pow(x,y); }

template<class T>
T par_sub x,
y
[static]
 

Definition at line 17 of file par.h.

Referenced by par< T >::operator-(), par< T >::operator--(), and par< T >::operator-=().

00017 { return x - y; }


Variable Documentation

bool* flag = NULL
 

-------------- Flags for immedate bool operation ---------------

Definition at line 42 of file par.h.

Referenced by par< T >::all_on(), par< T >::dumpflags(), and par< T >::operator=().

int flag_N = 0
 

Definition at line 43 of file par.h.

Referenced by par< T >::all_on().

bool* flagtemp = NULL
 

-------------- Flags for ifp() endifp, top of bool stack is flagtemp ---------

Definition at line 46 of file par.h.

Referenced by par< T >::operator=().

bool ifelseflag = true
 

Definition at line 48 of file par.h.

stack<bool> ifelses
 

Definition at line 52 of file par.h.

bool restrict = false
 

Definition at line 47 of file par.h.

stack<bool *> rs
 

-------------- Stack of boolean flags for ifp() and endifp() -----------------

Definition at line 51 of file par.h.


Generated on Tue Jan 4 17:45:20 2005 for ZIPPAR by  doxygen 1.3.9.1