| 383 | } |
| 384 | |
| 385 | AMLGraph* ALGraph::ConvertToAML(){ |
| 386 | AMLGraph *converted = new AMLGraph(type); |
| 387 | for(int i = 0; i < vexList.size(); i++){ |
| 388 | converted->AddVex(vexList[i].info); |
| 389 | } |
| 390 | for(int i = 0; i < vexList.size(); i++){ |
| 391 | ALArc *p = vexList[i].firstArc; |
| 392 | while(p != nullptr){ |
| 393 | if(type == DG || (type == UDG && i == GetIdOf(p->gArc->edVex()))) |
| 394 | converted->AddArc(p->gArc, p->weight); |
| 395 | p = p->nextArc; |
| 396 | } |
| 397 | } |
| 398 | return converted; |
| 399 | } |
| 400 | |
| 401 | /**************************************************************************************/ |
| 402 |
no test coverage detected