Files Classes Functions Hierarchy
00001 #ifndef D3MINRECURSIVE_H 00002 #define D3MINRECURSIVE_H 00003 00004 #include <cassert> 00005 #include <vector> 00006 using namespace std; 00007 00008 #include <d3minoperator.h> 00009 00010 class d3tess; 00011 00012 // Brief: Recursively looks at all links for minimization. 00013 // 00014 // Plug in the minizizer. 00015 // The assumption is that there are no loops so a 00016 // minimum state can be found, else infinite recursion. 00017 class d3minrecursive 00018 { 00019 // Mesh 00020 d3tess & tess; 00021 00022 // The client supplied binary minimize operator. 00023 d3minoperator * minimizer; 00024 00025 // Do not instanciate this class inside a loop as 00026 // STL preallocates memory for efficiency. 00027 vector<uint> process; 00028 00029 // Iterate around surrounding simplexes and minimize them. 00030 bool const minimizesimplex(uintc a); 00031 public: 00032 00033 // Constructor gets a mesh and minimizer which it 00034 // owns. ie on deletion the minimizer is destructed. 00035 d3minrecursive(d3tess & _tess, d3minoperator * _minimizer); 00036 00037 // Destructor releases the minimizer. 00038 ~d3minrecursive(); 00039 00040 // Give an initial simplex to start from. 00041 // If the mesh is changed true is returned, else false. 00042 bool const eval(uintc a); 00043 00044 }; 00045 00046 // Brief: Implements nested recursion as a binary operator. 00047 // 00048 // An object is minimized with its neighbours until 00049 // no such minimization is possible. Beware of infinite 00050 // recursion with loops. This depends on the minimizer. 00051 class d3minrecursiveoperator : public d3minoperator 00052 { 00053 d3minrecursive x; 00054 public: 00055 00056 d3minrecursiveoperator(d3tess & _tess, d3minoperator * _minimizer); 00057 00058 virtual ~d3minrecursiveoperator(); 00059 00060 bool const eval(uintc a, uintc b); 00061 00062 }; 00063 00064 00065 00066 #endif 00067 00068
1.5.8