void LCVM_RANGE_CLASS_NAME::set_data(const LCVM_RANGE_BASIC_TYPE &val)

LCVMnumber_range_template_methods definition file.

Documentation

LCVMnumber_range_template_methods definition file.

Description:

This is a header file used to make some classes with ranges. I.e. floats in the range [0.0, 1.0]. or ints in the range 1-10. or positive floats. or whatever...

So, this sort of acts like a template file. What we want is something like: template<class T, T lowerbound, T upperbound>, but for some reason g++ does not like it if T is "float", SGI's CC will use this though.... Anyway, to get this functionality (and more actually), we use defines and a couple standard files that get read in by the preprocessor.

This file needs to have the following defined: LCVM_RANGE_CLASS_NAME ex: small_float LCVM_RANGE_BASIC_TYPE ex: float LCVM_RANGE_DEFAULT_VALUE ex: (0.0) LCVM_RANGE_QUIET ex: (0)

Zero or more of the following groups need to be defined as well:

LCVM_RANGE_LOWER_BOUND ex: (-10.0) LCVM_RANGE_LOWER_COMPARISON ex: <= LCVM_RANGE_DEFAULT_SMALL_VALUE ex: (-5.0)

LCVM_RANGE_UPPER_BOUND ex: (10.0) LCVM_RANGE_UPPER_COMPARISON ex: < LCVM_RANGE_DEFAULT_LARGE_VALUE ex: (5.0)

LCVM_RANGE_DEFAULT_VALUE is the value given by the constructor if no value is given. It is also used when out of range values are given to set_data if neither LCVM_RANGE_DEFAULT_SMALL_VALUE nor LCVM_RANGE_DEFAULT_LARGE_VALUE apply. LCVM_RANGE_DEFAULT_SMALL_VALUE is assigned if there is a LCVM_RANGE_LOWER_BOUND and the out of range value is too small. Similary LCVM_RANGE_DEFAULT_LARGE_VALUE is used for out of range on the large side. If one or more of the LOWER/UPPER groups are not defined, then it is unconstrained in that direction. By using < or <= for the COMPARISONs, one can exclude or include the endpoints. Note that it is possible to have the default values outside of the range. I.e, one could have a class where the ällowed" values are [0.0,90.0] and 180.0. LCVM_RANGE_QUIET is an integer that controls the printing of warning messages if the values are reassinged to be in the given range. If it is 0, messages are printed, otherwise they are not.

Author: By Randy Paffenroth and Thomas Stone at the Numerical Analysis lab of the Institute for Physical Science, University of Maryland College Park

Alphabetic index HTML hierarchy of classes or Java



This page was generated with the help of DOC++.