vecalgo.h

Go to the documentation of this file.
00001 #ifndef  __vecalgo_h
00002 #define  __vecalgo_h
00003 
00004 #include  <vector>
00005 #include  <set>
00006 #include  "gascoignemath.h"
00007 
00008 namespace Gascoigne
00009 {
00010 void transfer(int n, std::vector<int>& tr, const std::set<int>& del);
00011 void transfer(int n, std::vector<int>& tr, std::vector  <int>& del);
00012 
00013 template<class C>
00014 void compress(std::vector<C>& dst, const std::vector<int>& src) {
00015   //int n = 0;
00016   int mmax = 0;
00017 
00018   for (int i=0; i<src.size(); i++)
00019     {
00020       int j = src[i];
00021       if (j>=0)
00022         {
00023           dst[j] = dst[i];
00024           mmax = max_int(mmax,j);
00025           //n++;
00026         }
00027     }
00028   //dst.resize(n);
00029   dst.resize(mmax+1);
00030 }
00031 }
00032 
00033 #endif

Generated on Thu Sep 14 10:34:35 2006 for Gascoigne by  doxygen 1.4.7