EvolvingObjects
eoRealBaseVectorBounds Class Reference

Vector type for bounds (see eoRealBounds.h for scalar types) More...

#include <eoRealVectorBounds.h>

Inheritance diagram for eoRealBaseVectorBounds:
vector eoRealVectorBounds eoRealVectorNoBounds

List of all members.

Public Member Functions

 eoRealBaseVectorBounds ()
 Default Ctor.
 eoRealBaseVectorBounds (unsigned _dim, eoRealBounds &_bounds)
 Ctor: same bounds for everybody, given as an eoRealBounds.
 eoRealBaseVectorBounds (eoRealBounds &_xbounds, eoRealBounds &_ybounds)
 Ctor, particular case of dim-2.
virtual bool isBounded (unsigned _i)
 test: is i_th component bounded
virtual bool isBounded (void)
 test: bounded iff all are bounded
virtual bool hasNoBoundAtAll (unsigned _i)
 Self-test: true iff i_th component has no bounds at all.
virtual bool hasNoBoundAtAll (void)
 Self-test: true iff all components have no bound at all.
virtual bool isMinBounded (unsigned _i)
virtual bool isMaxBounded (unsigned _i)
virtual void foldsInBounds (unsigned _i, double &_r)
 Folds a real value back into the bounds - i_th component.
virtual void foldsInBounds (std::vector< double > &_v)
 Folds all variables of a std::vector of real values into the bounds.
virtual void truncate (unsigned _i, double &_r)
 Truncates a real value to the bounds - i_th component.
virtual void truncate (std::vector< double > &_v)
 truncates all variables of a std::vector of real values to the bounds
virtual bool isInBounds (unsigned _i, double _r)
 test: is i_th component within the bounds?
virtual bool isInBounds (std::vector< double > _v)
 test: are ALL components within the bounds?
virtual double minimum (unsigned _i)
 Accessors: will raise an std::exception if these do not exist.
virtual double maximum (unsigned _i)
virtual double range (unsigned _i)
virtual double averageRange ()
 Computes the average range An std::exception will be raised if one of the component is unbounded.
virtual double uniform (unsigned _i, eoRng &_rng=eo::rng)
 Generates a random number in i_th range An std::exception will be raised if one of the component is unbounded.
void uniform (std::vector< double > &_v, eoRng &_rng=eo::rng)
 fills a std::vector with uniformly chosen variables in bounds An std::exception will be raised if one of the component is unbounded
virtual void printOn (std::ostream &_os) const
 Write object.

Detailed Description

Vector type for bounds (see eoRealBounds.h for scalar types)

------------ Class eoRealVectorBounds implements the std::vectorized version: it is basically a std::vector of eoRealBounds * and forwards all request to the elements of the std::vector.

This file also contains the global variables and eoDummyVectorNoBounds that are used as defaults in ctors (i.e. when no bounds are given, it is assumed unbounded values)

THe 2 main classes defined here are

eoRealBaseVectorBounds, base class that handles all useful functions eoRealVectorBounds which derives from the preceding *and* eoPersistent and also has a mechanism for memory handling of the pointers it has to allocate

Definition at line 54 of file eoRealVectorBounds.h.


Member Function Documentation

virtual void eoRealBaseVectorBounds::printOn ( std::ostream &  _os) const [inline, virtual]

Write object.

It's called printOn since it prints the object on a stream.

Parameters:
_osA std::ostream.

Reimplemented in eoRealVectorBounds.

Definition at line 212 of file eoRealVectorBounds.h.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Friends