00001 #ifndef CONLIST_H__ 00002 #define CONLIST_H__ 00003 00004 #include "Array.h" 00005 00006 DSS_NAMESPASE_BEGIN 00007 00008 class IntLinkArray 00009 { 00010 public: 00011 long* last; 00012 long* next; 00013 00014 long first; 00015 long N; 00016 00017 IntLinkArray() 00018 { 00019 last = next = NULL; 00020 first = 0; 00021 N = 0; 00022 } 00023 00024 IntLinkArray(long* l,long* n,long N) 00025 { 00026 last = l; 00027 next = n; 00028 first = 0; 00029 this->N = N; 00030 } 00031 00032 void Init(long* l,long* n,long N) 00033 { 00034 last = l; 00035 next = n; 00036 first = 0; 00037 this->N = N; 00038 } 00039 00040 void Remove(long i) 00041 { 00042 //if(!(last[i]!=-2)) {i =i;} 00043 00044 if (last[i]>=0) next[last[i]] = next[i]; 00045 if (next[i]>=0) last[next[i]] = last[i]; 00046 00047 if (i == first) 00048 first = next[i]; 00049 N--; 00050 00051 //if(!((last[i]=-2)==-2)) {i =i;} 00052 } 00053 00054 }; 00055 00056 DSS_NAMESPASE_END 00057 00058 #endif //CONLIST_H__