src/test/graph_test.cc
changeset 515 a7eeb8af6b34
parent 504 6ef30329dd50
child 542 69bde1d90c04
equal deleted inserted replaced
1:e3ea58c2cb72 2:af9c5527b6c1
   106   G.clear();
   106   G.clear();
   107 
   107 
   108   //NodeMap tests
   108   //NodeMap tests
   109   {
   109   {
   110     Node k;
   110     Node k;
   111     typename Graph::NodeMap<int> m(G);
   111     typename Graph::template NodeMap<int> m(G);
   112     typename Graph::NodeMap<int> const &cm = m;  //Const map
   112     typename Graph::template NodeMap<int> const &cm = m;  //Const map
   113     typename Graph::NodeMap<int> mdef(G,12); //Inicialize with default value
   113     //Inicialize with default value
   114     typename Graph::NodeMap<int> mm(cm);   //Copy
   114     typename Graph::template NodeMap<int> mdef(G,12);
   115     typename Graph::NodeMap<double> dm(cm); //Copy from another type
   115     typename Graph::template NodeMap<int> mm(cm);   //Copy
       
   116     typename Graph::template NodeMap<double> dm(cm); //Copy from another type
   116     int v;
   117     int v;
   117     v=m[k]; m[k]=v; m.set(k,v);
   118     v=m[k]; m[k]=v; m.set(k,v);
   118     v=cm[k];
   119     v=cm[k];
   119     
   120     
   120     m=cm;  
   121     m=cm;  
   121     dm=cm; //Copy from another type
   122     dm=cm; //Copy from another type
   122   }  
   123   }  
   123   { //bool NodeMap
   124   { //bool NodeMap
   124     Node k;
   125     Node k;
   125     typename Graph::NodeMap<bool> m(G);
   126     typename Graph::template NodeMap<bool> m(G);
   126     typename Graph::NodeMap<bool> const &cm = m;  //Const map
   127     typename Graph::template NodeMap<bool> const &cm = m;  //Const map
   127     typename Graph::NodeMap<bool> mdef(G,12); //Inicialize with default value
   128     //Inicialize with default value
   128     typename Graph::NodeMap<bool> mm(cm);   //Copy
   129     typename Graph::template NodeMap<bool> mdef(G,12);
   129     typename Graph::NodeMap<int> dm(cm); //Copy from another type
   130     typename Graph::template NodeMap<bool> mm(cm);   //Copy
       
   131     typename Graph::template NodeMap<int> dm(cm); //Copy from another type
   130     bool v;
   132     bool v;
   131     v=m[k]; m[k]=v; m.set(k,v);
   133     v=m[k]; m[k]=v; m.set(k,v);
   132     v=cm[k];
   134     v=cm[k];
   133     
   135     
   134     m=cm;  
   136     m=cm;  
   136     m=dm; //Copy to another type
   138     m=dm; //Copy to another type
   137   }
   139   }
   138   //EdgeMap tests
   140   //EdgeMap tests
   139   {
   141   {
   140     Edge k;
   142     Edge k;
   141     typename Graph::EdgeMap<int> m(G);
   143     typename Graph::template EdgeMap<int> m(G);
   142     typename Graph::EdgeMap<int> const &cm = m;  //Const map
   144     typename Graph::template EdgeMap<int> const &cm = m;  //Const map
   143     typename Graph::EdgeMap<int> mdef(G,12); //Inicialize with default value
   145     //Inicialize with default value
   144     typename Graph::EdgeMap<int> mm(cm);   //Copy
   146     typename Graph::template EdgeMap<int> mdef(G,12);
   145     typename Graph::EdgeMap<double> dm(cm); //Copy from another type
   147     typename Graph::template EdgeMap<int> mm(cm);   //Copy
       
   148     typename Graph::template EdgeMap<double> dm(cm); //Copy from another type
   146     int v;
   149     int v;
   147     v=m[k]; m[k]=v; m.set(k,v);
   150     v=m[k]; m[k]=v; m.set(k,v);
   148     v=cm[k];
   151     v=cm[k];
   149     
   152     
   150     m=cm;  
   153     m=cm;  
   151     dm=cm; //Copy from another type
   154     dm=cm; //Copy from another type
   152   }  
   155   }  
   153   { //bool EdgeMap
   156   { //bool EdgeMap
   154     Edge k;
   157     Edge k;
   155     typename Graph::EdgeMap<bool> m(G);
   158     typename Graph::template EdgeMap<bool> m(G);
   156     typename Graph::EdgeMap<bool> const &cm = m;  //Const map
   159     typename Graph::template EdgeMap<bool> const &cm = m;  //Const map
   157     typename Graph::EdgeMap<bool> mdef(G,12); //Inicialize with default value
   160     //Inicialize with default value
   158     typename Graph::EdgeMap<bool> mm(cm);   //Copy
   161     typename Graph::template EdgeMap<bool> mdef(G,12);
   159     typename Graph::EdgeMap<int> dm(cm); //Copy from another type
   162     typename Graph::template EdgeMap<bool> mm(cm);   //Copy
       
   163     typename Graph::template EdgeMap<int> dm(cm); //Copy from another type
   160     bool v;
   164     bool v;
   161     v=m[k]; m[k]=v; m.set(k,v);
   165     v=m[k]; m[k]=v; m.set(k,v);
   162     v=cm[k];
   166     v=cm[k];
   163     
   167     
   164     m=cm;  
   168     m=cm;