00001 // BiSection.h 00002 00003 #ifndef _BISECTION_H__ 00004 #define _BISECTION_H__ 00005 00006 #include "SparseConectivityMtx.h" 00007 00008 DSS_NAMESPASE_BEGIN 00009 00010 class CMcKee 00011 { 00012 private: 00013 long n; 00014 00015 SparseConectivityMtxII* mtx; 00016 long* p_node_level; 00017 long* p_order; //out 00018 // 0 - unsorted available 00019 // 00020 00021 00022 public: 00023 long* nodes; //in 00024 long size; 00025 long domA,domB; 00026 00027 CMcKee(); 00028 ~CMcKee(); 00029 00030 void Init(SparseConectivityMtxII* mtx); 00031 00032 BOOL IsAvailable(int v); 00033 00034 void PrepareValid(); 00035 00036 long FindFirstNode(); 00037 void ComputeLevels(); 00038 void DivideByMidLevel(); 00039 }; 00040 00041 00042 class CBiSection 00043 { 00044 private: 00045 SparseConectivityMtxII* mtx; 00046 CMcKee mck; 00047 00048 public: 00049 CBiSection(SparseConectivityMtxII* mtx); 00050 void RecurBiSectOrder(IntArrayList* order); 00051 00052 private: 00053 void RecurBiSect(long* nodes,long size); 00054 void BiSect(long* nodes,long size, long& domA, long& domB); 00055 }; 00056 00057 DSS_NAMESPASE_END 00058 00059 #endif //_BISECTION_H__