CMS 3D CMS Logo

Public Member Functions | Protected Member Functions | Private Attributes | Friends

PhysicsTools::VarProcessor::ValueIterator Struct Reference

#include <VarProcessor.h>

List of all members.

Public Member Functions

double * begin () const
 begin of value array for current input variable
bool empty () const
 checks for existence of values for current input variable
double * end () const
 end of value array for current input variable
 operator bool () const
 test for end of input variable iterator
void operator() ()
 finish current output variable, move to next slot
void operator() (double value)
 add value as output variable and move to next slot
double operator* ()
 the (first or only) value for the current input variable
ValueIterator operator++ (int dummy)
 move to next input variable
ValueIteratoroperator++ ()
 move to next input variable
ValueIteratoroperator<< (double value)
 add computed value to current output variable
double operator[] (unsigned int idx)
 value idx of current input variable
unsigned int size () const
 number of values for current input variable

Protected Member Functions

 ValueIterator (BitSet::Iterator cur, double *values, int *conf, double *output, int *outConf, int *loop, unsigned int offset)

Private Attributes

const int * conf
BitSet::Iterator cur
const int * loop
const unsigned int offset
int * outConf
double * output
double *const start
double * values

Friends

class VarProcessor

Detailed Description

Definition at line 180 of file VarProcessor.h.


Constructor & Destructor Documentation

PhysicsTools::VarProcessor::ValueIterator::ValueIterator ( BitSet::Iterator  cur,
double *  values,
int *  conf,
double *  output,
int *  outConf,
int *  loop,
unsigned int  offset 
) [inline, protected]

Definition at line 247 of file VarProcessor.h.

References conf, cur, and offset.

                                                              :
                        cur(cur), offset(offset), start(values + offset),
                        values(values), conf(conf), loop(loop),
                        output(output + offset), outConf(outConf)
                {
                        this->conf += cur();
                        this->values += *this->conf;
                        if (loop && this->conf >= loop) {
                                this->values += offset;
                                this->loop = 0;
                        }
                }

Member Function Documentation

double* PhysicsTools::VarProcessor::ValueIterator::begin ( void  ) const [inline]

begin of value array for current input variable

Definition at line 187 of file VarProcessor.h.

References values.

Referenced by empty(), and PhysicsTools::Interceptor::eval().

{ return values; }
bool PhysicsTools::VarProcessor::ValueIterator::empty ( void  ) const [inline]

checks for existence of values for current input variable

Definition at line 193 of file VarProcessor.h.

References begin(), and end().

{ return begin() == end(); }
double* PhysicsTools::VarProcessor::ValueIterator::end ( void  ) const [inline]

end of value array for current input variable

Definition at line 190 of file VarProcessor.h.

References size(), and values.

Referenced by empty(), and PhysicsTools::Interceptor::eval().

{ return values + size(); }
PhysicsTools::VarProcessor::ValueIterator::operator bool ( ) const [inline]

test for end of input variable iterator

Definition at line 222 of file VarProcessor.h.

References cur.

{ return cur; }
void PhysicsTools::VarProcessor::ValueIterator::operator() ( ) [inline]

finish current output variable, move to next slot

Definition at line 208 of file VarProcessor.h.

References outConf, output, pos, and start.

                {
                        int pos = output - start;
                        if (*++outConf > pos)
                                output = start + *outConf;
                        else
                                *outConf = pos;
                }
void PhysicsTools::VarProcessor::ValueIterator::operator() ( double  value) [inline]

add value as output variable and move to next slot

Definition at line 218 of file VarProcessor.h.

References relativeConstraints::value.

                { *this << value; (*this)(); }
double PhysicsTools::VarProcessor::ValueIterator::operator* ( void  ) [inline]

the (first or only) value for the current input variable

Definition at line 196 of file VarProcessor.h.

References values.

                { return *values; }
ValueIterator PhysicsTools::VarProcessor::ValueIterator::operator++ ( int  dummy) [inline]

move to next input variable

Definition at line 241 of file VarProcessor.h.

References operator++().

                { ValueIterator orig = *this; operator ++ (); return orig; }
ValueIterator& PhysicsTools::VarProcessor::ValueIterator::operator++ ( void  ) [inline]

move to next input variable

Definition at line 225 of file VarProcessor.h.

References conf, cur, loop, offset, and values.

Referenced by operator++().

                {
                        BitSet::size_t orig = cur();
                        if (++cur) {
                                unsigned int prev = *conf;
                                conf += cur() - orig; 
                                values += *conf - prev;
                                if (loop && conf >= loop) {
                                        values += offset;
                                        loop = 0;
                                }
                        }
                        return *this;
                }
ValueIterator& PhysicsTools::VarProcessor::ValueIterator::operator<< ( double  value) [inline]

add computed value to current output variable

Definition at line 204 of file VarProcessor.h.

References output, and relativeConstraints::value.

                { *output++ = value; return *this; }
double PhysicsTools::VarProcessor::ValueIterator::operator[] ( unsigned int  idx) [inline]

value idx of current input variable

Definition at line 200 of file VarProcessor.h.

References values.

                { return values[idx]; }
unsigned int PhysicsTools::VarProcessor::ValueIterator::size ( void  ) const [inline]

number of values for current input variable

Definition at line 183 of file VarProcessor.h.

References conf, and loop.

Referenced by end(), and PhysicsTools::Interceptor::eval().

                { return loop ? (conf[1] - conf[0]) : 1; }

Friends And Related Function Documentation

friend class VarProcessor [friend]

Definition at line 245 of file VarProcessor.h.


Member Data Documentation

Definition at line 267 of file VarProcessor.h.

Referenced by operator++(), size(), and ValueIterator().

Definition at line 263 of file VarProcessor.h.

Referenced by operator bool(), operator++(), and ValueIterator().

Definition at line 268 of file VarProcessor.h.

Referenced by operator++(), and size().

Definition at line 264 of file VarProcessor.h.

Referenced by operator++(), and ValueIterator().

Definition at line 270 of file VarProcessor.h.

Referenced by operator()().

Definition at line 269 of file VarProcessor.h.

Referenced by operator()(), and operator<<().

Definition at line 265 of file VarProcessor.h.

Referenced by operator()().

Definition at line 266 of file VarProcessor.h.

Referenced by begin(), end(), operator*(), operator++(), and operator[]().