MinMaxVal< TValue > Class Template Reference

A value which is the min or max of multiple other values. More...

List of all members.

Public Types

typedef TValue Value
typedef TValue Value

Public Member Functions

void MaxWith (Value incoming_val)
 Efficiently performs this->val = min(this->val, incoming_val).
void MaxWith (Value incoming_val)
 Efficiently performs this->val = min(this->val, incoming_val).
void MinWith (Value incoming_val)
 Efficiently performs this->val = min(this->val, incoming_val).
void MinWith (Value incoming_val)
 Efficiently performs this->val = min(this->val, incoming_val).
 OBJECT_TRAVERSAL (MinMaxVal)
 OBJECT_TRAVERSAL (MinMaxVal)
 operator Value () const
 Converts implicitly to the value.
 operator Value () const
 Converts implicitly to the value.
const Value & operator= (Value val_in)
 Sets the value.
const Value & operator= (Value val_in)
 Sets the value.

Public Attributes

Value val
 The underlying value.

Detailed Description

template<typename TValue>
class MinMaxVal< TValue >

A value which is the min or max of multiple other values.

Comes with a highly optimized version of x = max(x, y).

The template argument should be something like double, with greater-than, less-than, and equals operators.

Definition at line 189 of file math_lib.h.


Member Function Documentation

template<typename TValue >
void MinMaxVal< TValue >::MaxWith ( Value  incoming_val  )  [inline]

Efficiently performs this->val = min(this->val, incoming_val).

The expectation is that it is higly unlikely for the incoming value to be the new maximum.

Definition at line 232 of file math_lib.h.

References MinMaxVal< TValue >::val.

template<typename TValue >
void MinMaxVal< TValue >::MaxWith ( Value  incoming_val  )  [inline]

Efficiently performs this->val = min(this->val, incoming_val).

The expectation is that it is higly unlikely for the incoming value to be the new maximum.

Definition at line 232 of file math_lib.h.

References MinMaxVal< TValue >::val.

template<typename TValue >
void MinMaxVal< TValue >::MinWith ( Value  incoming_val  )  [inline]

Efficiently performs this->val = min(this->val, incoming_val).

The expectation is that it is higly unlikely for the incoming value to be the new minimum.

Definition at line 220 of file math_lib.h.

References MinMaxVal< TValue >::val.

template<typename TValue >
void MinMaxVal< TValue >::MinWith ( Value  incoming_val  )  [inline]

Efficiently performs this->val = min(this->val, incoming_val).

The expectation is that it is higly unlikely for the incoming value to be the new minimum.

Definition at line 220 of file math_lib.h.

References MinMaxVal< TValue >::val.

template<typename TValue >
MinMaxVal< TValue >::operator Value (  )  const [inline]

Converts implicitly to the value.

Definition at line 205 of file math_lib.h.

References MinMaxVal< TValue >::val.

template<typename TValue >
MinMaxVal< TValue >::operator Value (  )  const [inline]

Converts implicitly to the value.

Definition at line 205 of file math_lib.h.

References MinMaxVal< TValue >::val.

template<typename TValue >
const Value& MinMaxVal< TValue >::operator= ( Value  val_in  )  [inline]

Sets the value.

Definition at line 210 of file math_lib.h.

References MinMaxVal< TValue >::val.

template<typename TValue >
const Value& MinMaxVal< TValue >::operator= ( Value  val_in  )  [inline]

Sets the value.

Definition at line 210 of file math_lib.h.

References MinMaxVal< TValue >::val.


Member Data Documentation

template<typename TValue >
Value MinMaxVal< TValue >::val

The documentation for this class was generated from the following files:
Generated on Mon Jan 24 12:04:40 2011 for FASTlib by  doxygen 1.6.3