Hermes2D  3.0
Hermes::Hermes2D::RefinementSelectors::OrderPermutator Class Reference

Hermes::Order permutator. Generates all permutations of orders from a set defined by a range of orders. More...

#include <order_permutator.h>

Public Member Functions

 OrderPermutator (unsigned short start_quad_order=0, unsigned short end_quad_order=0, bool iso_p=false, unsigned short *tgt_quad_order=nullptr)
 Constructor. More...
 
bool next ()
 Moves to the next permutation of orders. More...
 
void reset ()
 Resets permutator to the starting order.
 
unsigned short get_order_h () const
 Returns the current horizontal order. More...
 
unsigned short get_order_v () const
 Returns the current vertical order. More...
 
unsigned short get_quad_order () const
 Returns the current order in an encoded form. More...
 
unsigned short get_start_quad_order () const
 Returns the starting order in an encoded form. More...
 
unsigned short get_end_quad_order () const
 Returns the ending order in an encoded form. More...
 

Protected Attributes

unsigned short order_h
 The current horizontal order.
 
unsigned short order_v
 The current verical order.
 
unsigned short start_order_h
 The starting horizontal order.
 
unsigned short start_order_v
 The starting vertical order.
 
unsigned short end_order_h
 The ending horizontal order.
 
unsigned short end_order_v
 The ending vertical order.
 
bool iso_p
 True if orders is incresed in both the horizontal order and the vertical order are increased simultaneously.
 
unsigned short * tgt_quad_order
 A pointer to which a current order is stored in encoded form. Ignored if nullptr.
 

Detailed Description

Hermes::Order permutator. Generates all permutations of orders from a set defined by a range of orders.

Used to generate all possible generation of horizontal and vertical orders bettween the starting order and the ending order. Both the starting order and the ending order are included.

Suggested Use
OrderPermutator order_perm(start_order, end_order, false);
do {
int order_h = order_perm.get_order_h();
} while (order_perm.next());

Definition at line 37 of file order_permutator.h.

Constructor & Destructor Documentation

Hermes::Hermes2D::RefinementSelectors::OrderPermutator::OrderPermutator ( unsigned short  start_quad_order = 0,
unsigned short  end_quad_order = 0,
bool  iso_p = false,
unsigned short *  tgt_quad_order = nullptr 
)

Constructor.

Parameters
[in]start_quad_orderThe starting order in an encoded form.
[in]end_quad_orderThe ending order in an encoded form.
[in]iso_pTrue if both orders (i.e. horizontal and vertical) should be increased simultaneously.
[in]tgt_quad_orderA point to a location to which a current orders (i.e. horizontal and vertical) are stored in an encoded form. Ignored if nullptr.

Definition at line 24 of file order_permutator.cpp.

Member Function Documentation

unsigned short Hermes::Hermes2D::RefinementSelectors::OrderPermutator::get_end_quad_order ( ) const

Returns the ending order in an encoded form.

Returns
The ending order in an encoded form.

Definition at line 88 of file order_permutator.cpp.

unsigned short Hermes::Hermes2D::RefinementSelectors::OrderPermutator::get_order_h ( ) const

Returns the current horizontal order.

Returns
The current horizontal order.

Definition at line 68 of file order_permutator.cpp.

Referenced by Hermes::Hermes2D::RefinementSelectors::ProjBasedSelector< Scalar >::calc_error_cand_element().

unsigned short Hermes::Hermes2D::RefinementSelectors::OrderPermutator::get_order_v ( ) const

Returns the current vertical order.

Returns
The current vertical order.

Definition at line 73 of file order_permutator.cpp.

Referenced by Hermes::Hermes2D::RefinementSelectors::ProjBasedSelector< Scalar >::calc_error_cand_element().

unsigned short Hermes::Hermes2D::RefinementSelectors::OrderPermutator::get_quad_order ( ) const

Returns the current order in an encoded form.

Returns
The current order in an encoded form.

Definition at line 78 of file order_permutator.cpp.

Referenced by Hermes::Hermes2D::RefinementSelectors::ProjBasedSelector< Scalar >::calc_error_cand_element().

unsigned short Hermes::Hermes2D::RefinementSelectors::OrderPermutator::get_start_quad_order ( ) const

Returns the starting order in an encoded form.

Returns
The starting order in an encoded form.

Definition at line 83 of file order_permutator.cpp.

bool Hermes::Hermes2D::RefinementSelectors::OrderPermutator::next ( )

Moves to the next permutation of orders.

Returns
True if there is a next permutation of orders.

Definition at line 32 of file order_permutator.cpp.

Referenced by Hermes::Hermes2D::RefinementSelectors::ProjBasedSelector< Scalar >::calc_error_cand_element().


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