/** \page dynset_reorganization Reorganization

\section reorganization_concept Introduction
This concept originally came for doubleton representations:
\f[
x+C \cdot r0+B \cdot r
\f]
In the beginning r0 holds the initial set size and r is set to zero. But as we propagate the set the r0 is unchanged but all errors are put into r and finally  it can become a dominant part (especially for small initial sets).  It occurs that sometimes it is better to reorganize the set from time to time.
Our first strategy was to put everything into the r0 and set the r to zero again. Now for doubleton we have several different reorganization schemes. The choice should depend on a doubleton set type and on a dynamical system used.

\section reorganization_definition How to define reorganization

Reorganization class should implement 3 methods:
- isReorganizationNeeded(set) - implements some strategy and returns true if the set should be reorganized
- reorganize(set) - do the reorganization of the set
- reorganizeIfNeeded(set) - it perform reorganization if it is needed. We normally use combination of above functions but sometimes it is more convenient/faster to re-implement them together.

\section reorganization_usage How to use reorganizations?

-# Choose set you want to be reorganized e.g. \link capd::dynset::C0Rect2Set CORect2Set \endlink
-# Choose suitable reorganization e.g.  C0Rect2SetReorganization or FullReorganization
-# Use \ref dynset_reorganizedset to put them together
  \code
  typedef C0Rect2Set<IMatrix>  MySet;
  typedef ReorganizedSet<MySet, FullReorganization<MySet> >  MyReorganizedSet;
  \endcode
-# Now you can use MyReorganizedSet exactly in the way you would use C0Rect2Set.
  \code
  /// returns image of set x0 after N iterates of given dynamical system dynsys
  IVector moveNSteps(C0DynSys & dynsys, const IVector & x0, int N) {
     MyReorganizedSet set(x0);
     for( int i = 0; i<N; ++i){
       set.move(dynsys);
     }
     return (IVector) set;
  }
  \endcode

\section reorganization_types Implemented reorganizations

*/


/** \page dynset_reorganizedset ReorganizedSet

ReorganizedSet is a template that connects a \link dynset_module dynamical set \endlink and its \link dynset_reorganization reorganization \endlink (these are template parameters).

ReorganizedSet after each set's move calls reorganizeIfNeeded(set).
\code
typedef capd::dynset::C0Rect2Set<IMatrix>  C0Rect2Set;
typedef  capd::dynset::ReorganizedSet< C0Rect2Set,  C0Rect2Reorganization<C0Rect2Set> >   C0Rect2ReorganizedSet;
\endcode
in this case because C0Rect2Reorganization is the default reorganization for the C0Rect2Set it can be omitted:
\code
typedef  capd::dynset::ReorganizedSet< C0Rect2Set>   C0Rect2ReorganizedSet;
\endcode
 */
