MaximalElements< T, ARRAY, COMPARE, KEEP_DUPLICATES, MINIMAL > Class Template Reference

#include <partialorder.h>

Inheritance diagram for MaximalElements< T, ARRAY, COMPARE, KEEP_DUPLICATES, MINIMAL >:

详细描述

template<typename T, typename ARRAY = BaseArraySelector<>, typename COMPARE = DefaultCompare, Bool KEEP_DUPLICATES = false, Bool MINIMAL = false>
class maxon::MaximalElements< T, ARRAY, COMPARE, KEEP_DUPLICATES, MINIMAL >

MaximalElements finds the maximal elements of a set of values with a partial order. A maximal element of such a set is an element which is not less than any other element of the set. A partially ordered set may have more than one maximal element.

要使用 MaximalElements , add all values via the Append function. Afterwards, you can use MaximalElements like an array, it then will contain the maximal elements of all added values.

For comparison, MaximalElements uses the operators < and <= on the values by default, but you can override this with the #COMPARE parameter.

Template Parameters
T The type of values. There has to be a partial order on T , given by the operators < and <=.
ARRAY An array selector template to choose the array implementation to use.
COMPARE The static LessThan and LessThanOrEqual functions found in COMPARE are used for the value comparisons.
KEEP_DUPLICATES If true, elements of the set which are equal will be kept each in the array, otherwise only one of them will be in the array.
MINIMAL If true, find the minimal elements instead. Still only < and <= are used.
另请参阅
MinimalElements

公共成员函数

const Super GetUnderlyingArray () const
Super GetUnderlyingArray ()
ResultMem   Append (const T &value)
ResultMem   Append (T &&value)

Private Types

using  Super = typename ARRAY::template Type< T >
using  Cmp = typename std::conditional< KEEP_DUPLICATES, COMPARE, maxon::details::LessThanOrEqualAsLessThan < COMPARE > >::type

Member Typedef Documentation

◆  Super

using Super = typename ARRAY::template Type<T>
private

◆  Cmp

using Cmp = typename std::conditional<KEEP_DUPLICATES, COMPARE, maxon::details::LessThanOrEqualAsLessThan <COMPARE> >::type
private

成员函数文档编制

◆  GetUnderlyingArray() [1/2]

const Super & GetUnderlyingArray ( ) const

◆  GetUnderlyingArray() [2/2]

Super & GetUnderlyingArray ( )

◆  Append() [1/2]

ResultMem Append ( const T &  value )

◆  Append() [2/2]

ResultMem Append ( T &&  value )