Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

ValueGenerator_Opposite< T > Class Template Reference

#include <valuegen.h>

Inheritance diagram for ValueGenerator_Opposite< T >:

Inheritance graph
[legend]
Collaboration diagram for ValueGenerator_Opposite< T >:

Collaboration graph
[legend]
List of all members.

Detailed Description

template<class T = double>
class ValueGenerator_Opposite< T >

Given a factor f and a master value mv located elsewhere, the value of this object will be f-mv.

This class is a hack that shouldn't have to exist, but without it there would currently (-r 1.36, 6/2002) be no way to have a value in one eye be 1 minus the value in the other, despite the expressions supported by ValueGenerator and ValueGenerator_Expression. The trouble is that all ValueGenerators in eyes other than the first one are linked to those in the first, usually via ValueGenerator_Correlate ("Uncorrelate ..."). This linkage is not very flexible, and thus this class provides one other commonly used way to link, other than uncorrelation. A general way to link values between eyes is sorely needed.

Definition at line 292 of file valuegen.h.

Public Methods

 ValueGenerator_Opposite (T *master_value_ptr, T factor=1)
 master_value_ptr and uncorrelation_ptr should be const

 ValueGenerator_Opposite (StringArgs &args, T *ref=0)
 Construct from a string.

virtual string stringrep () const
 Returns the value as a scalar.

 ValueGenerator_Opposite (const self &other)
 Copy constructor.

virtual bool next ()
 Advance to the next state (whatever that means for this object).

virtual void reset ()
 Reset to the starting state.

virtual ValueGenerator< T > * clone () const
 Constructs an identical copy of self and returns it.


Constructor & Destructor Documentation

template<class T = double>
ValueGenerator_Opposite< T >::ValueGenerator_Opposite StringArgs   args,
T *    ref = 0
[inline]
 

Construct from a string.

If present, the ref argument is used in place of the first argument expected in the string, and the string is parsed from the beginning for the next argument. This behavior is inherited from ValueGenerator_Correlate; it is not clear if it is appropriate here.

Definition at line 311 of file valuegen.h.

References StringArgs::next(), and ValueGenerator_Opposite< T >::reset().


Member Function Documentation

template<class T = double>
virtual string ValueGenerator_Opposite< T >::stringrep   const [inline, virtual]
 

Returns the value as a scalar.

Derived classes will usually want to provide a more specific representation, namely what the StringArgs constructor will accept for that class.

At present it cannot be guaranteed that the value returned is actually what was used to create the object; perhaps the StringArgs passed to the constructor should be saved instead. If so, the StringArgs constructor above would have to be changed to include a string specifying the ValueGenerator type.

Reimplemented from ValueGenerator< T >.

Definition at line 320 of file valuegen.h.

References String::stringrep().


The documentation for this class was generated from the following file:
Generated on Mon Jan 20 02:37:29 2003 for RF-LISSOM by doxygen1.3-rc2