莫名其妙就好了
This commit is contained in:
parent
6099cd16c8
commit
5e4567ba3a
1 changed files with 6 additions and 6 deletions
|
@ -53,7 +53,7 @@ class graphVertex
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
Vector<Vertex<Tv> *> V;
|
Vector<Vertex<Tv> *> V;
|
||||||
Vector<Edge<Te> *> E;
|
Vector<Vector<Edge<Te> *>> E;
|
||||||
int v;
|
int v;
|
||||||
int e;
|
int e;
|
||||||
|
|
||||||
|
@ -121,14 +121,14 @@ public:
|
||||||
// 0 成功
|
// 0 成功
|
||||||
virtual int link(int id1, int id2, int w)
|
virtual int link(int id1, int id2, int w)
|
||||||
{
|
{
|
||||||
// if (V[id1] == NULL || V[id2] == NULL)
|
if (V[id1] == NULL || V[id2] == NULL)
|
||||||
// return -1;
|
return -1;
|
||||||
// if (E[id1][id2] != NULL)
|
if (E[id1][id2] != NULL)
|
||||||
// return -2;
|
return -2;
|
||||||
V[id1]->outDegree++;
|
V[id1]->outDegree++;
|
||||||
V[id2]->inDegree++;
|
V[id2]->inDegree++;
|
||||||
Edge<Te> *temp = new Edge<Te>(w);
|
Edge<Te> *temp = new Edge<Te>(w);
|
||||||
(E->_v[id1])->_v[id2] = temp;
|
(E._v[id1])._v[id2] = temp;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
// 解除 id1->id2 连接
|
// 解除 id1->id2 连接
|
||||||
|
|
Reference in a new issue