00001
00002
00003 #ifndef _ORDERING_H__
00004 #define _ORDERING_H__
00005
00006 #include "IntArrayList.h"
00007 #include "BigMatrix.h"
00008
00009 DSS_NAMESPASE_BEGIN
00010
00011 struct IConectMatrix;
00012
00013
00014
00015
00016 class Ordering
00017 {
00018 public:
00019 enum Type
00020 {
00021 None = 0,
00022 ReverseCuthillMcKee = 1,
00023 CuthillMcKee = 2,
00024 MinimumDegree = 3,
00025 ApproxMinimumDegree = 4,
00026 ApproxMinimumDegreeIncomplete = 5,
00027 NestedGraphBisection = 6,
00028 MetisND = 7,
00029 ColAMD = 8,
00030 ApproxMinimumDegreeAA = 9,
00031 };
00032
00033
00034 public:
00035 IntArrayList* perm;
00036 IntArrayList* order;
00037 Type type;
00038 IConectMatrix* cm;
00039
00040 Ordering(IntArrayList* perm,IntArrayList* order)
00041 {
00042 cm = NULL;
00043 type = None;
00044 this->perm = perm;
00045 this->order = order;
00046 }
00047
00048 Ordering(IntArrayList* order)
00049 {
00050 cm = NULL;
00051 this->order = order;
00052 perm = new IntArrayList(order->Count);
00053 perm->Alloc();
00054 for (long i=0; i<perm->Count; i++)
00055 perm->Items[order->Items[i]] = i;
00056 }
00057
00058 virtual ~Ordering()
00059 {
00060 if (perm) {delete perm;perm = NULL;}
00061 if (order) {delete order;order = NULL;}
00062 if (cm) {delete cm;cm = NULL;}
00063 }
00064 };
00065
00066 DSS_NAMESPASE_END
00067
00068 #endif //_ORDERING_H__