CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Protected Member Functions | Private Attributes | Friends
PhysicsTools::VarProcessor::ValueIterator Struct Reference

#include <VarProcessor.h>

Public Member Functions

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

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 
)
inlineprotected

Definition at line 247 of file VarProcessor.h.

References conf, cur, and offset.

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().

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().

193 { return begin() == end(); }
double * end() const
end of value array for current input variable
Definition: VarProcessor.h:190
double * begin() const
begin of value array for current input variable
Definition: VarProcessor.h:187
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().

190 { return values + size(); }
unsigned int size() const
number of values for current input variable
Definition: VarProcessor.h:183
PhysicsTools::VarProcessor::ValueIterator::operator bool ( ) const
inline

test for end of input variable iterator

Definition at line 222 of file VarProcessor.h.

References cur.

222 { 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.

209  {
210  int pos = output - start;
211  if (*++outConf > pos)
212  output = start + *outConf;
213  else
214  *outConf = pos;
215  }
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.

219  { *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.

197  { return *values; }
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++().

226  {
227  BitSet::size_t orig = cur();
228  if (++cur) {
229  unsigned int prev = *conf;
230  conf += cur() - orig;
231  values += *conf - prev;
232  if (loop && conf >= loop) {
233  values += offset;
234  loop = 0;
235  }
236  }
237  return *this;
238  }
std::size_t size_t
Definition: BitSet.h:32
ValueIterator PhysicsTools::VarProcessor::ValueIterator::operator++ ( int  dummy)
inline

move to next input variable

Definition at line 241 of file VarProcessor.h.

References operator++().

242  { ValueIterator orig = *this; operator ++ (); return orig; }
ValueIterator & operator++()
move to next input variable
Definition: VarProcessor.h:225
ValueIterator(BitSet::Iterator cur, double *values, int *conf, double *output, int *outConf, int *loop, unsigned int offset)
Definition: VarProcessor.h:247
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.

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.

201  { 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().

184  { 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

const int* PhysicsTools::VarProcessor::ValueIterator::conf
private

Definition at line 267 of file VarProcessor.h.

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

BitSet::Iterator PhysicsTools::VarProcessor::ValueIterator::cur
private

Definition at line 263 of file VarProcessor.h.

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

const int* PhysicsTools::VarProcessor::ValueIterator::loop
private

Definition at line 268 of file VarProcessor.h.

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

const unsigned int PhysicsTools::VarProcessor::ValueIterator::offset
private

Definition at line 264 of file VarProcessor.h.

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

int* PhysicsTools::VarProcessor::ValueIterator::outConf
private

Definition at line 270 of file VarProcessor.h.

Referenced by operator()().

double* PhysicsTools::VarProcessor::ValueIterator::output
private

Definition at line 269 of file VarProcessor.h.

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

double* const PhysicsTools::VarProcessor::ValueIterator::start
private
double* PhysicsTools::VarProcessor::ValueIterator::values
private