Jpp
|
General purpose class for collection of equidistant elements. More...
#include <JGridCollection.hh>
Public Types | |
typedef JCollection < JElement_t, JDistance_t > | collection_type |
typedef collection_type::abscissa_type | abscissa_type |
typedef collection_type::ordinate_type | ordinate_type |
typedef collection_type::value_type | value_type |
typedef collection_type::const_iterator | const_iterator |
typedef collection_type::const_reverse_iterator | const_reverse_iterator |
typedef collection_type::iterator | iterator |
typedef collection_type::reverse_iterator | reverse_iterator |
typedef collection_type::pair_type | pair_type |
typedef JDistance_t | distance_type |
typedef std::vector< value_type > | container_type |
typedef JCollectionElementTransformer < value_type > | transformer_type |
typedef JElement_t::abscissa_type | key_type |
typedef JElement_t::ordinate_type | mapped_type |
Public Member Functions | |
JGridCollection () | |
Default constructor. More... | |
int | getIndex (typename JClass< abscissa_type >::argument_type x) const |
Get index of given abscissa value. More... | |
const_iterator | lower_bound (typename JClass< abscissa_type >::argument_type x) const |
Get first position of element i , where x >= i->getX() . More... | |
iterator | lower_bound (typename JClass< abscissa_type >::argument_type x) |
Get first position of element i , where x >= i->getX() . More... | |
virtual void | clear () |
Clear. More... | |
virtual const ordinate_type & | get (typename JClass< abscissa_type >::argument_type x) const |
Get ordinate value. More... | |
virtual ordinate_type & | get (typename JClass< abscissa_type >::argument_type x) |
Get ordinate value. More... | |
virtual int | getSize () const |
Get number of elements. More... | |
virtual abscissa_type | getX (int index) const |
Get abscissa value. More... | |
virtual abscissa_type | getXmin () const |
Get minimal abscissa value. More... | |
virtual abscissa_type | getXmax () const |
Get maximal abscissa value. More... | |
const ordinate_type & | getY (int index) const |
Get ordinate value. More... | |
ordinate_type & | getY (int index) |
Get ordinate value. More... | |
void | transform (const transformer_type &transformer) |
Transform collection. More... | |
void | sort () |
Sort elements. More... | |
pair_type | insert (const value_type &element) |
Insert element. More... | |
void | configure (const JAbstractCollection< abscissa_type > &bounds) |
Configure collection. More... | |
void | configure (const JAbstractCollection< abscissa_type > &bounds, typename JClass< ordinate_type >::argument_type value) |
Configure collection. More... | |
template<class JFunction1D_t > | |
void | configure (const JAbstractCollection< abscissa_type > &bounds, const JFunction1D_t &function) |
Configure collection. More... | |
bool | is_compatible (const JCollection &collection) const |
Test whether collections are compatible. More... | |
JCollection & | negate () |
Negate collection. More... | |
JCollection & | add (const JCollection &collection) |
Add collection. More... | |
JCollection & | add (typename JClass< ordinate_type >::argument_type value) |
Add offset. More... | |
template<class JFunction1D_t > | |
JCollection & | add (const JFunction1D_t &function) |
Add function. More... | |
JCollection & | sub (const JCollection &collection) |
Subtract collection. More... | |
JCollection & | sub (typename JClass< ordinate_type >::argument_type value) |
Subtract offset. More... | |
template<class JFunction1D_t > | |
JCollection & | sub (const JFunction1D_t &function) |
Subtract function. More... | |
JCollection & | mul (const double value) |
Scale contents. More... | |
JCollection< JElement_t, JDistance_t > & | mul (const JNullType &object) |
Multiply with object. More... | |
JCollection & | div (const double value) |
Scale contents. More... | |
const JComparator & | getComparator () const |
Get comparator. More... | |
const mapped_type & | operator[] (typename JClass< key_type >::argument_type key) const |
Get mapped value. More... | |
mapped_type & | operator[] (typename JClass< key_type >::argument_type key) |
Get mapped value. More... | |
void | put (typename JClass< key_type >::argument_type key, typename JClass< mapped_type >::argument_type value) |
Put pair-wise element (key,value) into collection. More... | |
bool | is_equal (const JAbstractCollection &collection) const |
Test whether abstract collections are equal. More... | |
Public Attributes | |
JDistance_t | getDistance |
Function object for distance evaluation. More... | |
Protected Member Functions | |
void | resize (typename container_type::size_type size) |
Resize collection. More... | |
Protected Attributes | |
JComparator | compare |
Function object for comparison. More... | |
General purpose class for collection of equidistant elements.
For a collection with equidistant elements, the index of the nearest element can directly be computed based on the minimal abscissa value, the maximal abscissa value and the number of elements in the collection. The lower_bound methods are re-implemented in this class which otherwise simply derives from JCollection.
For convenience, the implementation of the standard map operator []
of the JCollection class is maintained.
Definition at line 30 of file JGridCollection.hh.
typedef JCollection<JElement_t, JDistance_t> JTOOLS::JGridCollection< JElement_t, JDistance_t >::collection_type |
Definition at line 35 of file JGridCollection.hh.
typedef collection_type::abscissa_type JTOOLS::JGridCollection< JElement_t, JDistance_t >::abscissa_type |
Definition at line 37 of file JGridCollection.hh.
typedef collection_type::ordinate_type JTOOLS::JGridCollection< JElement_t, JDistance_t >::ordinate_type |
Definition at line 38 of file JGridCollection.hh.
typedef collection_type::value_type JTOOLS::JGridCollection< JElement_t, JDistance_t >::value_type |
Definition at line 39 of file JGridCollection.hh.
typedef collection_type::const_iterator JTOOLS::JGridCollection< JElement_t, JDistance_t >::const_iterator |
Definition at line 41 of file JGridCollection.hh.
typedef collection_type::const_reverse_iterator JTOOLS::JGridCollection< JElement_t, JDistance_t >::const_reverse_iterator |
Definition at line 42 of file JGridCollection.hh.
typedef collection_type::iterator JTOOLS::JGridCollection< JElement_t, JDistance_t >::iterator |
Definition at line 43 of file JGridCollection.hh.
typedef collection_type::reverse_iterator JTOOLS::JGridCollection< JElement_t, JDistance_t >::reverse_iterator |
Definition at line 44 of file JGridCollection.hh.
typedef collection_type::pair_type JTOOLS::JGridCollection< JElement_t, JDistance_t >::pair_type |
Definition at line 46 of file JGridCollection.hh.
|
inherited |
Definition at line 84 of file JCollection.hh.
|
inherited |
Definition at line 88 of file JCollection.hh.
|
inherited |
Definition at line 95 of file JCollection.hh.
|
inherited |
Definition at line 33 of file JMappableCollection.hh.
|
inherited |
Definition at line 34 of file JMappableCollection.hh.
|
inline |
|
inline |
Get index of given abscissa value.
For values within the range of this collection, the index starts at zero and ends at number of elements minus one. Note that the index could be less than zero or larger than (or equal to) the number of elements, if the given abscissa value is outside the range of this collection.
x | abscissa value |
Definition at line 66 of file JGridCollection.hh.
|
inline |
Get first position of element i
, where x >= i->getX()
.
x | abscissa value |
Definition at line 78 of file JGridCollection.hh.
|
inline |
Get first position of element i
, where x >= i->getX()
.
x | abscissa value |
Definition at line 97 of file JGridCollection.hh.
|
inlinevirtualinherited |
Clear.
Implements JTOOLS::JMappableCollection< JElement_t::abscissa_type, JElement_t::ordinate_type >.
Definition at line 149 of file JCollection.hh.
|
inlinevirtualinherited |
Get ordinate value.
x | abscissa value |
Implements JTOOLS::JMappableCollection< JElement_t::abscissa_type, JElement_t::ordinate_type >.
Definition at line 161 of file JCollection.hh.
|
inlinevirtualinherited |
Get ordinate value.
x | abscissa value |
Implements JTOOLS::JMappableCollection< JElement_t::abscissa_type, JElement_t::ordinate_type >.
Definition at line 179 of file JCollection.hh.
|
inlinevirtualinherited |
Get number of elements.
Implements JTOOLS::JAbstractCollection< JElement_t::abscissa_type >.
Definition at line 196 of file JCollection.hh.
|
inlinevirtualinherited |
Get abscissa value.
index | index |
Implements JTOOLS::JAbstractCollection< JElement_t::abscissa_type >.
Definition at line 208 of file JCollection.hh.
|
inlinevirtualinherited |
Get minimal abscissa value.
Implements JTOOLS::JAbstractCollection< JElement_t::abscissa_type >.
Definition at line 219 of file JCollection.hh.
|
inlinevirtualinherited |
Get maximal abscissa value.
Implements JTOOLS::JAbstractCollection< JElement_t::abscissa_type >.
Definition at line 230 of file JCollection.hh.
|
inlineinherited |
Get ordinate value.
index | index |
Definition at line 243 of file JCollection.hh.
|
inlineinherited |
Get ordinate value.
index | index |
Definition at line 255 of file JCollection.hh.
|
inlineinherited |
Transform collection.
transformer | element transformer |
Definition at line 266 of file JCollection.hh.
|
inlineinherited |
Sort elements.
Definition at line 281 of file JCollection.hh.
|
inlineinherited |
Insert element.
element | element |
Definition at line 317 of file JCollection.hh.
|
inlineinherited |
Configure collection.
bounds | abscissa values |
Definition at line 333 of file JCollection.hh.
|
inlineinherited |
Configure collection.
bounds | abscissa values |
value | ordinate value |
Definition at line 345 of file JCollection.hh.
|
inlineinherited |
Configure collection.
bounds | abscissa values |
function | function |
Definition at line 366 of file JCollection.hh.
|
inlineinherited |
Test whether collections are compatible.
collection | collection |
Definition at line 395 of file JCollection.hh.
|
inlineinherited |
|
inlineinherited |
Add collection.
collection | collection |
Definition at line 453 of file JCollection.hh.
|
inlineinherited |
Add offset.
value | offset |
Definition at line 601 of file JCollection.hh.
|
inlineinherited |
Add function.
function | function |
Definition at line 634 of file JCollection.hh.
|
inlineinherited |
Subtract collection.
collection | collection |
Definition at line 509 of file JCollection.hh.
|
inlineinherited |
Subtract offset.
value | offset |
Definition at line 617 of file JCollection.hh.
|
inlineinherited |
Subtract function.
function | function |
Definition at line 651 of file JCollection.hh.
|
inlineinherited |
Scale contents.
value | multiplication factor |
Definition at line 569 of file JCollection.hh.
|
inlineinherited |
Multiply with object.
object | object |
Definition at line 273 of file JMath.hh.
|
inlineinherited |
Scale contents.
value | division factor |
Definition at line 585 of file JCollection.hh.
|
inlineinherited |
Get comparator.
Definition at line 764 of file JCollection.hh.
|
inlineprotectedinherited |
|
inlineinherited |
Get mapped value.
key | key |
Definition at line 73 of file JMappableCollection.hh.
|
inlineinherited |
Get mapped value.
key | key |
Definition at line 85 of file JMappableCollection.hh.
|
inlineinherited |
Put pair-wise element (key,value) into collection.
key | key |
value | value |
Definition at line 97 of file JMappableCollection.hh.
|
inlineinherited |
Test whether abstract collections are equal.
collection | abstract collection |
Definition at line 69 of file JAbstractCollection.hh.
|
inherited |
Function object for distance evaluation.
Definition at line 773 of file JCollection.hh.
|
protectedinherited |
Function object for comparison.
Definition at line 780 of file JCollection.hh.