SPH
Public Member Functions | List of all members
Order Class Reference

Permutation, i.e. (discrete) invertible function int->int. More...

#include <Order.h>

Inheritance diagram for Order:
Noncopyable

Public Member Functions

 Order ()=default
 
 Order (Order &&other)
 
 Order (const Size n)
 Construct identity of given size. More...
 
Orderoperator= (Order &&other)
 
template<typename TBinaryPredicate >
void shuffle (TBinaryPredicate &&predicate)
 Shuffles the order using a binary predicate. More...
 
Order getInverted () const
 Returns the inverted order. More...
 
Order clone () const
 Clones the order. More...
 
Order compose (const Order &other) const
 Composes two orders. More...
 
template<typename T >
Array< T > apply (const Array< T > &input)
 Shuffles given array using this order. More...
 
INLINE Size operator[] (const Size idx) const
 
INLINE Size size () const
 
INLINE bool operator== (const Order &other) const
 
- Public Member Functions inherited from Noncopyable
 Noncopyable ()=default
 
 Noncopyable (const Noncopyable &)=delete
 
 Noncopyable (Noncopyable &&)=default
 
Noncopyableoperator= (const Noncopyable &)=delete
 
Noncopyableoperator= (Noncopyable &&)=default
 

Detailed Description

Permutation, i.e. (discrete) invertible function int->int.

Simple wrapper of Array<size_t> with convenient interface that guarantees the object will be always valid permutation. Only way to modify the object is via shuffle function.

Definition at line 18 of file Order.h.

Constructor & Destructor Documentation

◆ Order() [1/3]

Order::Order ( )
default

◆ Order() [2/3]

Order::Order ( Order &&  other)
inline

Definition at line 29 of file Order.h.

◆ Order() [3/3]

Order::Order ( const Size  n)
inlineexplicit

Construct identity of given size.

Definition at line 33 of file Order.h.

Member Function Documentation

◆ apply()

template<typename T >
Array<T> Order::apply ( const Array< T > &  input)
inline

Shuffles given array using this order.

Definition at line 76 of file Order.h.

◆ clone()

Order Order::clone ( ) const
inline

Clones the order.

Definition at line 61 of file Order.h.

◆ compose()

Order Order::compose ( const Order other) const
inline

Composes two orders.

Definition at line 66 of file Order.h.

◆ getInverted()

Order Order::getInverted ( ) const
inline

Returns the inverted order.

Definition at line 52 of file Order.h.

◆ operator=()

Order& Order::operator= ( Order &&  other)
inline

Definition at line 40 of file Order.h.

◆ operator==()

INLINE bool Order::operator== ( const Order other) const
inline

Definition at line 92 of file Order.h.

◆ operator[]()

INLINE Size Order::operator[] ( const Size  idx) const
inline

Definition at line 84 of file Order.h.

◆ shuffle()

template<typename TBinaryPredicate >
void Order::shuffle ( TBinaryPredicate &&  predicate)
inline

Shuffles the order using a binary predicate.

Definition at line 47 of file Order.h.

◆ size()

INLINE Size Order::size ( ) const
inline

Definition at line 88 of file Order.h.


The documentation for this class was generated from the following file: