Jpp test-rotations-new
the software that should make you happy
|
Range of values. More...
#include <JRange.hh>
Public Types | |
typedef std::pair< T, T > | pair_type |
typedef JRange< T, JComparator_t > | range_type |
typedef JLANG::JClass< T >::argument_type | argument_type |
typedef T | key_type |
typedef T | mapped_type |
Public Member Functions | |
JRange () | |
Default constructor. | |
JRange (const pair_type &pair) | |
Constructor. | |
JRange (argument_type x, argument_type y) | |
Constructor. | |
JRange (argument_type x) | |
Constructor. | |
template<class R > | |
JRange (R first, R second) | |
Constructor. | |
template<class JElement_t , class JAllocator_t > | |
JRange (const array_type< JElement_t, JAllocator_t > &buffer) | |
Constructor. | |
operator pair_type () const | |
Type conversion operator. | |
const range_type & | getRange () const |
Get range. | |
void | setRange (const range_type &range) |
Set range. | |
void | setRange (argument_type x, argument_type y) |
Set lower and upper limit. | |
template<class R > | |
void | setRange (R first, R second) |
Set range. | |
template<class JElement_t , class JAllocator_t > | |
void | setRange (const array_type< JElement_t, JAllocator_t > &buffer) |
Set lower and upper limit according to input data. | |
T | getLowerLimit () const |
Get lower limit. | |
T | getUpperLimit () const |
Get upper limit. | |
void | setLowerLimit (argument_type x) |
Set lower limit. | |
void | setUpperLimit (argument_type y) |
Set upper limit. | |
void | fixLowerLimit (argument_type x) |
Fix lower limit. | |
void | fixUpperLimit (argument_type y) |
Fix upper limit. | |
bool | equals (const range_type &range) const |
Equal method. | |
T | getLength () const |
Get length (difference between upper and lower limit). | |
void | setLength (argument_type length) |
Set length (difference between upper and lower limit). | |
bool | is_valid () const |
Check validity of range. | |
bool | in_range (argument_type x) const |
Test whether value is inside range. | |
bool | operator() (argument_type x) const |
Test whether value is inside range. | |
T | constrain (argument_type x) const |
Constrain value to range. | |
T | mod (argument_type x) const |
Modulo value with respect to range. | |
bool | overlap (const range_type &range) const |
Test overlap with given range. | |
range_type & | include (argument_type x) |
Include given value to range. | |
range_type & | join (const range_type &range) |
Join ranges. | |
range_type & | combine (const range_type &range) |
Combine ranges. | |
range_type & | add (argument_type x) |
Add offset. | |
range_type & | sub (argument_type x) |
Subtract offset. | |
range_type & | add (const range_type &range) |
Add offsets. | |
range_type & | sub (const range_type &range) |
Subtract offsets. | |
range_type & | mul (const double factor) |
Multiply range. | |
range_type & | div (const double factor) |
Divide range. | |
const key_type & | getKey () const |
const mapped_type & | getValue () const |
mapped_type & | getValue () |
JFirst_t & | mul (const JSecond_t &object) |
Multiply with object. | |
Static Public Member Functions | |
static T | getMinimum () |
Get minimum possible value. | |
static T | getMaximum () |
Get maximum possible value. | |
static JRange< T, JComparator_t > | DEFAULT_RANGE () |
Default range. | |
Public Attributes | |
JComparator_t | compare |
Function object for comparisons. | |
T | first |
T | second |
Protected Member Functions | |
template<class R > | |
void | setRange (R first, R second, const JLANG::JBool< false > &option) |
Set range. | |
template<class R > | |
void | setRange (R first, R second, const JLANG::JBool< true > &option) |
Set range. | |
Range of values.
std::pair<T,T> JTOOLS::JRange< T, JComparator_t >::pair_type |
JRange<T, JComparator_t> JTOOLS::JRange< T, JComparator_t >::range_type |
JLANG::JClass<T>::argument_type JTOOLS::JRange< T, JComparator_t >::argument_type |
|
inherited |
|
inherited |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Set range.
range | range |
|
inline |
|
inline |
Set range.
The arguments could be values or iterators.
first | first |
second | second |
Definition at line 173 of file JRange.hh.
|
inline |
Set lower and upper limit according to input data.
buffer | input data |
Definition at line 187 of file JRange.hh.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Equal method.
range | range |
Definition at line 275 of file JRange.hh.
|
inline |
Get length (difference between upper and lower limit).
|
inline |
Set length (difference between upper and lower limit).
length | length |
|
inline |
Check validity of range.
|
inline |
Test whether value is inside range.
x | value |
|
inline |
Test whether value is inside range.
x | value |
Definition at line 336 of file JRange.hh.
|
inline |
|
inline |
Modulo value with respect to range.
x | value |
Definition at line 365 of file JRange.hh.
|
inline |
|
inline |
Include given value to range.
The new lower limit is the minimim of the original lower limit and given value and
the new upper limit is the maximum of the original upper limit and given value;
x | value |
Definition at line 397 of file JRange.hh.
|
inline |
Join ranges.
The new lower limit is the maximim of the two lower limits and
the new upper limit is the minimum of the two upper limits.
This operation results in an equal or smaller range and may result in an unphysical range (i.e. lower limit > upper limit).
range | range |
Definition at line 415 of file JRange.hh.
|
inline |
|
inline |
|
inline |
|
inline |
Add offsets.
The new lower limit is the sum of the two lower limits and
the new upper limit is the sum of the two upper limits.
range | offset |
|
inline |
Subtract offsets.
The new lower limit is the difference of the two lower limits and
the new upper limit is the difference of the two upper limits.
range | offset |
|
inline |
|
inline |
|
inlinestatic |
|
inlinestatic |
Get maximum possible value.
|
inlinestatic |
|
inlineprotected |
|
inlineprotected |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
JComparator_t JTOOLS::JRange< T, JComparator_t >::compare |
|
inherited |
|
inherited |