1. 首先看一下引用主程序。
#include "patharrayoptimized.h"
using namespace std;
int main(int argc, char *argv[])
{
/*
(0)--(1)--(2)
| / \ |
| / \ |
| / \ |
(3)-------(4)
*/
vector<vector<bool>> graph = {
{0, 1, 0, 1, 0},
{0, 1, 1, 1},
{0, 0, 1},
{0, 1},
{0}
};
cout << "G1" << endl;
PathArrayOptimized G1(graph);
G1.help();
PathArrayOptimized G = G1;
for (int i=0; i<4; i++) {
G = G * G1;
cout << "G" << i+2 << endl;
G.help();
}
if(G.isZero()){