MRPT  1.9.9
mrpt::math::CBinaryRelation< T, U, UIsObject > Class Template Reference

Detailed Description

template<typename T, typename U, bool UIsObject = false>
class mrpt::math::CBinaryRelation< T, U, UIsObject >

This class models a binary relation through the elements of any given set.

Internal classes not to be directly used by the user.

I.e. for each pair of elements (A,B) it assigns two values, f(A,B) and f(B,A). This class is useful when calling the base function is costly, since it acts like a proxy. It's also useful if the relationship values do not correspond with the return value of a function. Although it theoretically supports objects with non-trivial constructors or destructors (indicated by specifying "true" as the thrid parameter of the template instantiation), certain operations will cause memory leaks and may even cause undefined behaviour, so it's reccomended to use only basic types for the parameter U. The parameter T may be any complex object, however, like a smart pointer.

Definition at line 41 of file CBinaryRelation.h.

#include <mrpt/math/CBinaryRelation.h>

Public Types

using SimpleFunctionByReturnValue = U(*)(T, T)
 Simple function type, used to initialize chunks of the matrix. More...
 
using FunctionByReturnValue = U(*)(const T &, const T &)
 Function type which obtains the relation value by a return value. More...
 
using FunctionByReferencePass = void(*)(const T &, const T &, U &)
 Function type which obtains the relation value by reference pass. More...
 
using const_iterator = typename std::set< T >::const_iterator
 Constant iterator through the set elements. More...
 
using const_reverse_iterator = typename std::set< T >::const_reverse_iterator
 Constant reverse iterator through the set elements. More...
 
using AccessorForFirstElement = CMatrixRowAccessor< U >
 Accessor type to every value related to any element A, i.e., f(A,x). More...
 
using AccessorForSecondElement = CMatrixColumnAccessor< U >
 Accessor type to every value related to any element B, i.e., f(x,B). More...
 
using ConstAccessorForFirstElement = CConstMatrixRowAccessor< U >
 Const accessor type to every value related to any element A, i.e., f(A,x). More...
 
using ConstAccessorForSecondElement = CConstMatrixColumnAccessor< U >
 Const accessor type to every value related to any element B, i.e., f(x,B). More...
 

Public Member Functions

 CBinaryRelation (const std::set< T > &els)
 Default constructor, doesn't initialize the relation. More...
 
template<typename FunctionType >
 CBinaryRelation (const std::set< T > &els, FunctionType fun)
 Constructor which initializes the relation using a given function. More...
 
template<typename FunctionType >
void initializeWith (FunctionType fun)
 Initialize the whole relation with a given function. More...
 
template<typename FunctionType >
void initializeSymmetricallyWith (FunctionType fun)
 Initialize the whole relation with a given function, assuming that the relation is symmetrical. More...
 
void setRelationValue (size_t e1, size_t e2, const U &newVal)
 Manually set a relationship value, given the indices. More...
 
const U & getRelationValue (size_t e1, size_t e2) const
 Get a relation value, given the indices. More...
 
const U & operator() (size_t e1, size_t e2) const
 
U & getRelationValue (size_t e1, size_t e2)
 Get a reference to a relation value given its indices, which allows both querying and setting the value. More...
 
U & operator() (size_t e1, size_t e2)
 
bool setRelationValue (const T &t1, const T &t2, const U &newVal)
 Manually set a relationship value, given the elements. More...
 
getRelationValue (const T &t1, const T &t2) const
 Get a relation value, given the elements. More...
 
U & getRelationValue (const T &t1, const T &t2)
 Get a reference to a relation value given the elements, which allows both querying and setting. More...
 
const_iterator begin () const
 Gets an iterator to the starting point of the elements set. More...
 
const_iterator end () const
 Gets an iterator to the ending point of the elements set. More...
 
const_reverse_iterator rbegin () const
 Gets a reverse iterator to the ending point of the elements set. More...
 
const_reverse_iterator rend () const
 Gets a reverse iterator to the starting point of the elements set. More...
 
operator[] (size_t i) const
 Operator for direct access to a element given its index. More...
 
AccessorForFirstElement getRelationFrom (size_t i)
 Gets an accessor for every value related to an element A given its index, i.e., every f(A,x). More...
 
ConstAccessorForFirstElement getRelationFrom (size_t i) const
 Gets a constant accessor for every value related to an element A given its index, i.e., every f(A,x). More...
 
AccessorForSecondElement getRelationTo (size_t i)
 Gets an accessor for every value related to an element B given its index, i.e., every f(x,B). More...
 
ConstAccessorForSecondElement getRelationTo (size_t i) const
 Gets a constant accessor for every value related to an element B given its index, i.e., every f(x,B). More...
 
AccessorForFirstElement getRelationFrom (const T &t)
 Gets an iterable accessor for every value related to an element A, i.e., every f(A,x). More...
 
ConstAccessorForFirstElement getRelationFrom (const T &t) const
 Gets an iterable constant accessor for every value related to an element A, i.e., every f(A,x). More...
 
void getRelationFrom (size_t i, vector< U > &vec)
 
void getRelationFrom (const T &t, vector< U > &vec)
 
AccessorForSecondElement getRelationTo (const T &t)
 Gets an iterable accessor for every value related to an element B, i.e., every f(x,B). More...
 
ConstAccessorForSecondElement getRelationTo (const T &t) const
 Gets an iterable constant accessor for every value related to an alement B, i.e., every f(x,B). More...
 
void getRelationTo (size_t i, vector< U > &vec)
 
void getRelationTo (const T &t, vector< U > &vec)
 
void removeElementAt (size_t i)
 Removes an element at a concrete position. More...
 
bool removeElement (const T &el)
 Removes an element. More...
 
size_t removeElements (const std::set< T > &vals)
 Removes a set of elements. More...
 
void removeElementsAt (const std::set< size_t > &poss)
 
std::pair< bool, size_t > insertElement (const T &el)
 Inserts an element. More...
 
template<typename FunctionType >
std::pair< bool, size_t > insertElement (const T &el, FunctionType fun)
 Inserts an element and initializes its relationship values, even if it was already present. More...
 
size_t insertElements (const std::set< T > &els)
 Inserts a set of elements into the relation. More...
 
template<typename FunctionType >
size_t insertElements (const std::set< T > &els, FunctionType fun)
 Inserts a set of elements into the relation, initializing the actual relation with a given function. More...
 
void setElements (const std::set< T > &newEls)
 Completely resets the relation, using a new set of elements. More...
 
size_t size () const
 Returns the amount of elements present in the relation. More...
 

Private Types

using MatrixType = typename detail::MatrixWrapper< U, UIsObject >::MatrixType
 Matrix type used to store the actual relation. More...
 

Private Member Functions

template<typename FunctionType >
void applyFunction (FunctionType fun, size_t e1, size_t e2, const T &T1, const T &T2)
 Template used to make the function interface independent from the function type. More...
 

Private Attributes

std::set< T > elements
 Actual set of elements. More...
 
MatrixType relation
 Matrix storing the relation. More...
 

Member Typedef Documentation

◆ AccessorForFirstElement

template<typename T, typename U, bool UIsObject = false>
using mrpt::math::CBinaryRelation< T, U, UIsObject >::AccessorForFirstElement = CMatrixRowAccessor<U>

Accessor type to every value related to any element A, i.e., f(A,x).

Definition at line 62 of file CBinaryRelation.h.

◆ AccessorForSecondElement

template<typename T, typename U, bool UIsObject = false>
using mrpt::math::CBinaryRelation< T, U, UIsObject >::AccessorForSecondElement = CMatrixColumnAccessor<U>

Accessor type to every value related to any element B, i.e., f(x,B).

Definition at line 64 of file CBinaryRelation.h.

◆ const_iterator

template<typename T, typename U, bool UIsObject = false>
using mrpt::math::CBinaryRelation< T, U, UIsObject >::const_iterator = typename std::set<T>::const_iterator

Constant iterator through the set elements.

Definition at line 58 of file CBinaryRelation.h.

◆ const_reverse_iterator

template<typename T, typename U, bool UIsObject = false>
using mrpt::math::CBinaryRelation< T, U, UIsObject >::const_reverse_iterator = typename std::set<T>::const_reverse_iterator

Constant reverse iterator through the set elements.

Definition at line 60 of file CBinaryRelation.h.

◆ ConstAccessorForFirstElement

template<typename T, typename U, bool UIsObject = false>
using mrpt::math::CBinaryRelation< T, U, UIsObject >::ConstAccessorForFirstElement = CConstMatrixRowAccessor<U>

Const accessor type to every value related to any element A, i.e., f(A,x).

Definition at line 67 of file CBinaryRelation.h.

◆ ConstAccessorForSecondElement

template<typename T, typename U, bool UIsObject = false>
using mrpt::math::CBinaryRelation< T, U, UIsObject >::ConstAccessorForSecondElement = CConstMatrixColumnAccessor<U>

Const accessor type to every value related to any element B, i.e., f(x,B).

Definition at line 70 of file CBinaryRelation.h.

◆ FunctionByReferencePass

template<typename T, typename U, bool UIsObject = false>
using mrpt::math::CBinaryRelation< T, U, UIsObject >::FunctionByReferencePass = void (*)(const T&, const T&, U&)

Function type which obtains the relation value by reference pass.

Definition at line 56 of file CBinaryRelation.h.

◆ FunctionByReturnValue

template<typename T, typename U, bool UIsObject = false>
using mrpt::math::CBinaryRelation< T, U, UIsObject >::FunctionByReturnValue = U (*)(const T&, const T&)

Function type which obtains the relation value by a return value.

Definition at line 54 of file CBinaryRelation.h.

◆ MatrixType

template<typename T, typename U, bool UIsObject = false>
using mrpt::math::CBinaryRelation< T, U, UIsObject >::MatrixType = typename detail::MatrixWrapper<U, UIsObject>::MatrixType
private

Matrix type used to store the actual relation.

Definition at line 48 of file CBinaryRelation.h.

◆ SimpleFunctionByReturnValue

template<typename T, typename U, bool UIsObject = false>
using mrpt::math::CBinaryRelation< T, U, UIsObject >::SimpleFunctionByReturnValue = U (*)(T, T)

Simple function type, used to initialize chunks of the matrix.

Definition at line 52 of file CBinaryRelation.h.

Constructor & Destructor Documentation

◆ CBinaryRelation() [1/2]

template<typename T, typename U, bool UIsObject = false>
mrpt::math::CBinaryRelation< T, U, UIsObject >::CBinaryRelation ( const std::set< T > &  els)
inlineexplicit

Default constructor, doesn't initialize the relation.

Definition at line 96 of file CBinaryRelation.h.

◆ CBinaryRelation() [2/2]

template<typename T, typename U, bool UIsObject = false>
template<typename FunctionType >
mrpt::math::CBinaryRelation< T, U, UIsObject >::CBinaryRelation ( const std::set< T > &  els,
FunctionType  fun 
)
inline

Constructor which initializes the relation using a given function.

Definition at line 104 of file CBinaryRelation.h.

References mrpt::math::CBinaryRelation< T, U, UIsObject >::initializeWith().

Here is the call graph for this function:

Member Function Documentation

◆ applyFunction()

template<typename T, typename U, bool UIsObject = false>
template<typename FunctionType >
void mrpt::math::CBinaryRelation< T, U, UIsObject >::applyFunction ( FunctionType  fun,
size_t  e1,
size_t  e2,
const T &  T1,
const T &  T2 
)
inlineprivate

Template used to make the function interface independent from the function type.

(wrapper for the global method - needed to make this compile under GCC).

Definition at line 85 of file CBinaryRelation.h.

Referenced by mrpt::math::CBinaryRelation< T, U, UIsObject >::initializeSymmetricallyWith(), mrpt::math::CBinaryRelation< T, U, UIsObject >::initializeWith(), mrpt::math::CBinaryRelation< T, U, UIsObject >::insertElement(), and mrpt::math::CBinaryRelation< T, U, UIsObject >::insertElements().

Here is the caller graph for this function:

◆ begin()

template<typename T, typename U, bool UIsObject = false>
const_iterator mrpt::math::CBinaryRelation< T, U, UIsObject >::begin ( ) const
inline

Gets an iterator to the starting point of the elements set.

Definition at line 224 of file CBinaryRelation.h.

References mrpt::math::CBinaryRelation< T, U, UIsObject >::elements.

Referenced by mrpt::math::CBinaryRelation< T, U, UIsObject >::insertElements().

Here is the caller graph for this function:

◆ end()

template<typename T, typename U, bool UIsObject = false>
const_iterator mrpt::math::CBinaryRelation< T, U, UIsObject >::end ( ) const
inline

Gets an iterator to the ending point of the elements set.

Definition at line 228 of file CBinaryRelation.h.

References mrpt::math::CBinaryRelation< T, U, UIsObject >::elements.

Referenced by mrpt::math::CBinaryRelation< T, U, UIsObject >::insertElements().

Here is the caller graph for this function:

◆ getRelationFrom() [1/6]

template<typename T, typename U, bool UIsObject = false>
AccessorForFirstElement mrpt::math::CBinaryRelation< T, U, UIsObject >::getRelationFrom ( size_t  i)
inline

Gets an accessor for every value related to an element A given its index, i.e., every f(A,x).

This accessor is iterable.

Definition at line 251 of file CBinaryRelation.h.

References mrpt::math::CBinaryRelation< T, U, UIsObject >::relation.

Referenced by mrpt::math::CBinaryRelation< T, U, UIsObject >::getRelationFrom().

Here is the caller graph for this function:

◆ getRelationFrom() [2/6]

template<typename T, typename U, bool UIsObject = false>
ConstAccessorForFirstElement mrpt::math::CBinaryRelation< T, U, UIsObject >::getRelationFrom ( size_t  i) const
inline

Gets a constant accessor for every value related to an element A given its index, i.e., every f(A,x).

This accessor is iterable.

Definition at line 259 of file CBinaryRelation.h.

References mrpt::math::CBinaryRelation< T, U, UIsObject >::relation.

◆ getRelationFrom() [3/6]

template<typename T, typename U, bool UIsObject = false>
AccessorForFirstElement mrpt::math::CBinaryRelation< T, U, UIsObject >::getRelationFrom ( const T &  t)
inline

Gets an iterable accessor for every value related to an element A, i.e., every f(A,x).

A domain_error will be thrown if the element is not present.

Definition at line 284 of file CBinaryRelation.h.

References mrpt::math::distance(), mrpt::math::CBinaryRelation< T, U, UIsObject >::elements, mrpt::containers::find(), and mrpt::math::CBinaryRelation< T, U, UIsObject >::getRelationFrom().

Here is the call graph for this function:

◆ getRelationFrom() [4/6]

template<typename T, typename U, bool UIsObject = false>
ConstAccessorForFirstElement mrpt::math::CBinaryRelation< T, U, UIsObject >::getRelationFrom ( const T &  t) const
inline

Gets an iterable constant accessor for every value related to an element A, i.e., every f(A,x).

A domain_error will be thrown if the element is not present.

Definition at line 298 of file CBinaryRelation.h.

References mrpt::math::distance(), mrpt::math::CBinaryRelation< T, U, UIsObject >::elements, mrpt::containers::find(), and mrpt::math::CBinaryRelation< T, U, UIsObject >::getRelationFrom().

Here is the call graph for this function:

◆ getRelationFrom() [5/6]

template<typename T, typename U, bool UIsObject = false>
void mrpt::math::CBinaryRelation< T, U, UIsObject >::getRelationFrom ( size_t  i,
vector< U > &  vec 
)
inline

Definition at line 306 of file CBinaryRelation.h.

References ASSERT_, mrpt::math::CConstMatrixRowAccessor< MAT >::begin(), mrpt::math::CBinaryRelation< T, U, UIsObject >::elements, mrpt::math::CConstMatrixRowAccessor< MAT >::end(), and mrpt::math::CBinaryRelation< T, U, UIsObject >::relation.

Here is the call graph for this function:

◆ getRelationFrom() [6/6]

template<typename T, typename U, bool UIsObject = false>
void mrpt::math::CBinaryRelation< T, U, UIsObject >::getRelationFrom ( const T &  t,
vector< U > &  vec 
)
inline

Definition at line 314 of file CBinaryRelation.h.

References mrpt::math::distance(), mrpt::math::CBinaryRelation< T, U, UIsObject >::elements, mrpt::containers::find(), and mrpt::math::CBinaryRelation< T, U, UIsObject >::getRelationFrom().

Here is the call graph for this function:

◆ getRelationTo() [1/6]

template<typename T, typename U, bool UIsObject = false>
AccessorForSecondElement mrpt::math::CBinaryRelation< T, U, UIsObject >::getRelationTo ( size_t  i)
inline

Gets an accessor for every value related to an element B given its index, i.e., every f(x,B).

This accessor is iterable.

Definition at line 267 of file CBinaryRelation.h.

References mrpt::math::CBinaryRelation< T, U, UIsObject >::relation.

Referenced by mrpt::math::CBinaryRelation< T, U, UIsObject >::getRelationTo().

Here is the caller graph for this function:

◆ getRelationTo() [2/6]

template<typename T, typename U, bool UIsObject = false>
ConstAccessorForSecondElement mrpt::math::CBinaryRelation< T, U, UIsObject >::getRelationTo ( size_t  i) const
inline

Gets a constant accessor for every value related to an element B given its index, i.e., every f(x,B).

This accessor is fully iterable.

Definition at line 275 of file CBinaryRelation.h.

References mrpt::math::CBinaryRelation< T, U, UIsObject >::relation.

◆ getRelationTo() [3/6]

template<typename T, typename U, bool UIsObject = false>
AccessorForSecondElement mrpt::math::CBinaryRelation< T, U, UIsObject >::getRelationTo ( const T &  t)
inline

Gets an iterable accessor for every value related to an element B, i.e., every f(x,B).

A domain_error will be thrown if the element is not present.

Definition at line 327 of file CBinaryRelation.h.

References mrpt::math::distance(), mrpt::math::CBinaryRelation< T, U, UIsObject >::elements, mrpt::containers::find(), and mrpt::math::CBinaryRelation< T, U, UIsObject >::getRelationTo().

Here is the call graph for this function:

◆ getRelationTo() [4/6]

template<typename T, typename U, bool UIsObject = false>
ConstAccessorForSecondElement mrpt::math::CBinaryRelation< T, U, UIsObject >::getRelationTo ( const T &  t) const
inline

Gets an iterable constant accessor for every value related to an alement B, i.e., every f(x,B).

A domain_error will be thrown if the element is not present.

Definition at line 341 of file CBinaryRelation.h.

References mrpt::math::distance(), mrpt::math::CBinaryRelation< T, U, UIsObject >::elements, mrpt::containers::find(), and mrpt::math::CBinaryRelation< T, U, UIsObject >::getRelationTo().

Here is the call graph for this function:

◆ getRelationTo() [5/6]

template<typename T, typename U, bool UIsObject = false>
void mrpt::math::CBinaryRelation< T, U, UIsObject >::getRelationTo ( size_t  i,
vector< U > &  vec 
)
inline

Definition at line 349 of file CBinaryRelation.h.

References ASSERT_, mrpt::math::CConstMatrixColumnAccessor< MAT >::begin(), mrpt::math::CBinaryRelation< T, U, UIsObject >::elements, mrpt::math::CConstMatrixColumnAccessor< MAT >::end(), and mrpt::math::CBinaryRelation< T, U, UIsObject >::relation.

Here is the call graph for this function:

◆ getRelationTo() [6/6]

template<typename T, typename U, bool UIsObject = false>
void mrpt::math::CBinaryRelation< T, U, UIsObject >::getRelationTo ( const T &  t,
vector< U > &  vec 
)
inline

Definition at line 357 of file CBinaryRelation.h.

References mrpt::math::distance(), mrpt::math::CBinaryRelation< T, U, UIsObject >::elements, mrpt::containers::find(), and mrpt::math::CBinaryRelation< T, U, UIsObject >::getRelationTo().

Here is the call graph for this function:

◆ getRelationValue() [1/4]

template<typename T, typename U, bool UIsObject = false>
const U& mrpt::math::CBinaryRelation< T, U, UIsObject >::getRelationValue ( size_t  e1,
size_t  e2 
) const
inline

Get a relation value, given the indices.

Definition at line 153 of file CBinaryRelation.h.

References mrpt::math::CBinaryRelation< T, U, UIsObject >::relation.

Referenced by mrpt::math::detail::applyFunction(), mrpt::math::CBinaryRelation< T, U, UIsObject >::getRelationValue(), and mrpt::math::CBinaryRelation< T, U, UIsObject >::operator()().

Here is the caller graph for this function:

◆ getRelationValue() [2/4]

template<typename T, typename U, bool UIsObject = false>
U& mrpt::math::CBinaryRelation< T, U, UIsObject >::getRelationValue ( size_t  e1,
size_t  e2 
)
inline

Get a reference to a relation value given its indices, which allows both querying and setting the value.

Definition at line 165 of file CBinaryRelation.h.

References mrpt::math::CBinaryRelation< T, U, UIsObject >::relation.

◆ getRelationValue() [3/4]

template<typename T, typename U, bool UIsObject = false>
U mrpt::math::CBinaryRelation< T, U, UIsObject >::getRelationValue ( const T &  t1,
const T &  t2 
) const
inline

Get a relation value, given the elements.

Throws domain_error if any of the elements is not present.

Definition at line 193 of file CBinaryRelation.h.

References mrpt::math::distance(), mrpt::math::CBinaryRelation< T, U, UIsObject >::elements, mrpt::containers::find(), and mrpt::math::CBinaryRelation< T, U, UIsObject >::getRelationValue().

Here is the call graph for this function:

◆ getRelationValue() [4/4]

template<typename T, typename U, bool UIsObject = false>
U& mrpt::math::CBinaryRelation< T, U, UIsObject >::getRelationValue ( const T &  t1,
const T &  t2 
)
inline

Get a reference to a relation value given the elements, which allows both querying and setting.

Throws domain_error if any of the elements is not present.

Definition at line 210 of file CBinaryRelation.h.

References mrpt::math::distance(), mrpt::math::CBinaryRelation< T, U, UIsObject >::elements, mrpt::containers::find(), and mrpt::math::CBinaryRelation< T, U, UIsObject >::getRelationValue().

Here is the call graph for this function:

◆ initializeSymmetricallyWith()

template<typename T, typename U, bool UIsObject = false>
template<typename FunctionType >
void mrpt::math::CBinaryRelation< T, U, UIsObject >::initializeSymmetricallyWith ( FunctionType  fun)
inline

Initialize the whole relation with a given function, assuming that the relation is symmetrical.

Definition at line 128 of file CBinaryRelation.h.

References mrpt::math::CBinaryRelation< T, U, UIsObject >::applyFunction(), mrpt::math::CBinaryRelation< T, U, UIsObject >::elements, and mrpt::math::CBinaryRelation< T, U, UIsObject >::relation.

Here is the call graph for this function:

◆ initializeWith()

template<typename T, typename U, bool UIsObject = false>
template<typename FunctionType >
void mrpt::math::CBinaryRelation< T, U, UIsObject >::initializeWith ( FunctionType  fun)
inline

Initialize the whole relation with a given function.

Definition at line 113 of file CBinaryRelation.h.

References mrpt::math::CBinaryRelation< T, U, UIsObject >::applyFunction(), and mrpt::math::CBinaryRelation< T, U, UIsObject >::elements.

Referenced by mrpt::math::CBinaryRelation< T, U, UIsObject >::CBinaryRelation().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ insertElement() [1/2]

template<typename T, typename U, bool UIsObject = false>
std::pair<bool, size_t> mrpt::math::CBinaryRelation< T, U, UIsObject >::insertElement ( const T &  el)
inline

Inserts an element.

If the element was present, returns false and its current position. If it wasn't, returns true and the position in which it was inserted.

Definition at line 426 of file CBinaryRelation.h.

References mrpt::math::distance(), mrpt::math::CBinaryRelation< T, U, UIsObject >::elements, and mrpt::math::CBinaryRelation< T, U, UIsObject >::relation.

Referenced by mrpt::math::CBinaryRelation< T, U, UIsObject >::insertElement().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ insertElement() [2/2]

template<typename T, typename U, bool UIsObject = false>
template<typename FunctionType >
std::pair<bool, size_t> mrpt::math::CBinaryRelation< T, U, UIsObject >::insertElement ( const T &  el,
FunctionType  fun 
)
inline

Inserts an element and initializes its relationship values, even if it was already present.

Definition at line 446 of file CBinaryRelation.h.

References mrpt::math::CBinaryRelation< T, U, UIsObject >::applyFunction(), mrpt::math::CBinaryRelation< T, U, UIsObject >::elements, mrpt::math::CBinaryRelation< T, U, UIsObject >::insertElement(), and mrpt::math::CBinaryRelation< T, U, UIsObject >::operator[]().

Here is the call graph for this function:

◆ insertElements() [1/2]

template<typename T, typename U, bool UIsObject = false>
size_t mrpt::math::CBinaryRelation< T, U, UIsObject >::insertElements ( const std::set< T > &  els)
inline

Inserts a set of elements into the relation.

Does not initialize the actual relation.

Definition at line 462 of file CBinaryRelation.h.

References mrpt::math::distance(), mrpt::math::CBinaryRelation< T, U, UIsObject >::elements, and mrpt::math::CBinaryRelation< T, U, UIsObject >::relation.

Referenced by mrpt::math::CBinaryRelation< T, U, UIsObject >::insertElements().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ insertElements() [2/2]

template<typename T, typename U, bool UIsObject = false>
template<typename FunctionType >
size_t mrpt::math::CBinaryRelation< T, U, UIsObject >::insertElements ( const std::set< T > &  els,
FunctionType  fun 
)
inline

Inserts a set of elements into the relation, initializing the actual relation with a given function.

Definition at line 503 of file CBinaryRelation.h.

References mrpt::math::CBinaryRelation< T, U, UIsObject >::applyFunction(), mrpt::math::CBinaryRelation< T, U, UIsObject >::begin(), mrpt::math::distance(), mrpt::math::CBinaryRelation< T, U, UIsObject >::elements, mrpt::math::CBinaryRelation< T, U, UIsObject >::end(), mrpt::containers::find(), mrpt::math::CBinaryRelation< T, U, UIsObject >::insertElements(), and mrpt::math::CBinaryRelation< T, U, UIsObject >::operator[]().

Here is the call graph for this function:

◆ operator()() [1/2]

template<typename T, typename U, bool UIsObject = false>
const U& mrpt::math::CBinaryRelation< T, U, UIsObject >::operator() ( size_t  e1,
size_t  e2 
) const
inline

Definition at line 157 of file CBinaryRelation.h.

References mrpt::math::CBinaryRelation< T, U, UIsObject >::getRelationValue().

Here is the call graph for this function:

◆ operator()() [2/2]

template<typename T, typename U, bool UIsObject = false>
U& mrpt::math::CBinaryRelation< T, U, UIsObject >::operator() ( size_t  e1,
size_t  e2 
)
inline

Definition at line 169 of file CBinaryRelation.h.

References mrpt::math::CBinaryRelation< T, U, UIsObject >::getRelationValue().

Here is the call graph for this function:

◆ operator[]()

template<typename T, typename U, bool UIsObject = false>
T mrpt::math::CBinaryRelation< T, U, UIsObject >::operator[] ( size_t  i) const
inline

Operator for direct access to a element given its index.

Definition at line 240 of file CBinaryRelation.h.

References ASSERT_BELOW_, and mrpt::math::CBinaryRelation< T, U, UIsObject >::elements.

Referenced by mrpt::math::CBinaryRelation< T, U, UIsObject >::insertElement(), and mrpt::math::CBinaryRelation< T, U, UIsObject >::insertElements().

Here is the caller graph for this function:

◆ rbegin()

template<typename T, typename U, bool UIsObject = false>
const_reverse_iterator mrpt::math::CBinaryRelation< T, U, UIsObject >::rbegin ( ) const
inline

Gets a reverse iterator to the ending point of the elements set.

Definition at line 232 of file CBinaryRelation.h.

References mrpt::math::CBinaryRelation< T, U, UIsObject >::elements.

◆ removeElement()

template<typename T, typename U, bool UIsObject = false>
bool mrpt::math::CBinaryRelation< T, U, UIsObject >::removeElement ( const T &  el)
inline

Removes an element.

Returns false if the element was not present and thus could'nt be eliminated.

Definition at line 382 of file CBinaryRelation.h.

References mrpt::math::distance(), mrpt::math::CBinaryRelation< T, U, UIsObject >::elements, mrpt::containers::find(), and mrpt::math::CBinaryRelation< T, U, UIsObject >::removeElementAt().

Here is the call graph for this function:

◆ removeElementAt()

template<typename T, typename U, bool UIsObject = false>
void mrpt::math::CBinaryRelation< T, U, UIsObject >::removeElementAt ( size_t  i)
inline

Removes an element at a concrete position.

Definition at line 368 of file CBinaryRelation.h.

References ASSERT_, mrpt::math::CBinaryRelation< T, U, UIsObject >::elements, and mrpt::math::CBinaryRelation< T, U, UIsObject >::relation.

Referenced by mrpt::math::CBinaryRelation< T, U, UIsObject >::removeElement().

Here is the caller graph for this function:

◆ removeElements()

template<typename T, typename U, bool UIsObject = false>
size_t mrpt::math::CBinaryRelation< T, U, UIsObject >::removeElements ( const std::set< T > &  vals)
inline

Removes a set of elements.

Returns the number of elements which were actually erased.

Definition at line 395 of file CBinaryRelation.h.

References mrpt::math::distance(), mrpt::math::CBinaryRelation< T, U, UIsObject >::elements, mrpt::containers::find(), and mrpt::math::CBinaryRelation< T, U, UIsObject >::removeElementsAt().

Here is the call graph for this function:

◆ removeElementsAt()

template<typename T, typename U, bool UIsObject = false>
void mrpt::math::CBinaryRelation< T, U, UIsObject >::removeElementsAt ( const std::set< size_t > &  poss)
inline

Definition at line 409 of file CBinaryRelation.h.

References mrpt::math::CBinaryRelation< T, U, UIsObject >::elements, and mrpt::math::CBinaryRelation< T, U, UIsObject >::relation.

Referenced by mrpt::math::CBinaryRelation< T, U, UIsObject >::removeElements().

Here is the caller graph for this function:

◆ rend()

template<typename T, typename U, bool UIsObject = false>
const_reverse_iterator mrpt::math::CBinaryRelation< T, U, UIsObject >::rend ( ) const
inline

Gets a reverse iterator to the starting point of the elements set.

Definition at line 236 of file CBinaryRelation.h.

References mrpt::math::CBinaryRelation< T, U, UIsObject >::elements.

◆ setElements()

template<typename T, typename U, bool UIsObject = false>
void mrpt::math::CBinaryRelation< T, U, UIsObject >::setElements ( const std::set< T > &  newEls)
inline

Completely resets the relation, using a new set of elements.

Does not initialize the relation.

Definition at line 546 of file CBinaryRelation.h.

References mrpt::math::CBinaryRelation< T, U, UIsObject >::elements, and mrpt::math::CBinaryRelation< T, U, UIsObject >::relation.

◆ setRelationValue() [1/2]

template<typename T, typename U, bool UIsObject = false>
void mrpt::math::CBinaryRelation< T, U, UIsObject >::setRelationValue ( size_t  e1,
size_t  e2,
const U &  newVal 
)
inline

Manually set a relationship value, given the indices.

Definition at line 146 of file CBinaryRelation.h.

References mrpt::math::CBinaryRelation< T, U, UIsObject >::relation.

Referenced by mrpt::math::CBinaryRelation< T, U, UIsObject >::setRelationValue().

Here is the caller graph for this function:

◆ setRelationValue() [2/2]

template<typename T, typename U, bool UIsObject = false>
bool mrpt::math::CBinaryRelation< T, U, UIsObject >::setRelationValue ( const T &  t1,
const T &  t2,
const U &  newVal 
)
inline

Manually set a relationship value, given the elements.

Returns false if any of the elements is not present.

Definition at line 177 of file CBinaryRelation.h.

References mrpt::math::distance(), mrpt::math::CBinaryRelation< T, U, UIsObject >::elements, mrpt::containers::find(), and mrpt::math::CBinaryRelation< T, U, UIsObject >::setRelationValue().

Here is the call graph for this function:

◆ size()

template<typename T, typename U, bool UIsObject = false>
size_t mrpt::math::CBinaryRelation< T, U, UIsObject >::size ( ) const
inline

Returns the amount of elements present in the relation.

Definition at line 555 of file CBinaryRelation.h.

References mrpt::math::CBinaryRelation< T, U, UIsObject >::elements.

Member Data Documentation

◆ elements

◆ relation




Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: 8fe78517f Sun Jul 14 19:43:28 2019 +0200 at lun oct 28 02:10:00 CET 2019