src/test/graph_test.cc
changeset 792 147eb3a58706
parent 783 81bf2d766164
child 793 9cd0aeea47b0
equal deleted inserted replaced
13:55d6b0dbcf8e 14:9846c1a7df4a
   130     v=m[k]; m[k]=v; m.set(k,v);
   130     v=m[k]; m[k]=v; m.set(k,v);
   131     v=cm[k];
   131     v=cm[k];
   132     
   132     
   133     m=cm;  
   133     m=cm;  
   134     dm=cm; //Copy from another type
   134     dm=cm; //Copy from another type
       
   135     {
       
   136       //Check the typedef's
       
   137       typename Graph::template NodeMap<int>::ValueType val;
       
   138       val=1;
       
   139       typename Graph::template NodeMap<int>::KeyType key;
       
   140       key = typename Graph::NodeIt(G);
       
   141     }
   135   }  
   142   }  
   136   { //bool NodeMap
   143   { //bool NodeMap
   137     Node k;
   144     Node k;
   138     typename Graph::template NodeMap<bool> m(G);
   145     typename Graph::template NodeMap<bool> m(G);
   139     typename Graph::template NodeMap<bool> const &cm = m;  //Const map
   146     typename Graph::template NodeMap<bool> const &cm = m;  //Const map
   146     v=cm[k];
   153     v=cm[k];
   147     
   154     
   148     m=cm;  
   155     m=cm;  
   149     dm=cm; //Copy from another type
   156     dm=cm; //Copy from another type
   150     m=dm; //Copy to another type
   157     m=dm; //Copy to another type
       
   158 
       
   159     {
       
   160       //Check the typedef's
       
   161       typename Graph::template NodeMap<bool>::ValueType val;
       
   162       val=true;
       
   163       typename Graph::template NodeMap<bool>::KeyType key;
       
   164       key= typename Graph::NodeIt(G);
       
   165     }
   151   }
   166   }
   152   //EdgeMap tests
   167   //EdgeMap tests
   153   {
   168   {
   154     Edge k;
   169     Edge k;
   155     typename Graph::template EdgeMap<int> m(G);
   170     typename Graph::template EdgeMap<int> m(G);
   162     v=m[k]; m[k]=v; m.set(k,v);
   177     v=m[k]; m[k]=v; m.set(k,v);
   163     v=cm[k];
   178     v=cm[k];
   164     
   179     
   165     m=cm;  
   180     m=cm;  
   166     dm=cm; //Copy from another type
   181     dm=cm; //Copy from another type
       
   182     {
       
   183       //Check the typedef's
       
   184       typename Graph::template EdgeMap<int>::ValueType val;
       
   185       val=1;
       
   186       typename Graph::template EdgeMap<int>::KeyType key;
       
   187       key= typename Graph::EdgeIt(G);
       
   188     }
   167   }  
   189   }  
   168   { //bool EdgeMap
   190   { //bool EdgeMap
   169     Edge k;
   191     Edge k;
   170     typename Graph::template EdgeMap<bool> m(G);
   192     typename Graph::template EdgeMap<bool> m(G);
   171     typename Graph::template EdgeMap<bool> const &cm = m;  //Const map
   193     typename Graph::template EdgeMap<bool> const &cm = m;  //Const map
   178     v=cm[k];
   200     v=cm[k];
   179     
   201     
   180     m=cm;  
   202     m=cm;  
   181     dm=cm; //Copy from another type
   203     dm=cm; //Copy from another type
   182     m=dm; //Copy to another type
   204     m=dm; //Copy to another type
       
   205     {
       
   206       //Check the typedef's
       
   207       typename Graph::template EdgeMap<bool>::ValueType val;
       
   208       val=true;
       
   209       typename Graph::template EdgeMap<bool>::KeyType key;
       
   210       key= typename Graph::EdgeIt(G);
       
   211     }
   183   }
   212   }
   184 }
   213 }
   185 
   214 
   186 template<class Graph> void checkCompile(Graph &G) 
   215 template<class Graph> void checkCompile(Graph &G) 
   187 {
   216 {