10 loadGraph(
char * InVertexFileName,
char * OutVertexFileName,
char * InEdgeFileName,
char * OutEdgeFileName)
12 int IVF, OVF, IEF, OEF;
14 IVF = open(InVertexFileName, O_RDONLY);
16 OVF = open(OutVertexFileName, O_RDONLY);
18 IEF = open(InEdgeFileName, O_RDONLY);
20 OEF = open(OutEdgeFileName, O_RDONLY);
23 unsigned int vertexNumber, secondvertexNumber;
24 unsigned int inEdgeNumber;
25 unsigned int outEdgeNumber;
27 bytes_read =
read(IVF, &vertexNumber,
sizeof(
unsigned int));
28 assert(bytes_read ==
sizeof(
unsigned int));
29 bytes_read =
read(OVF, &secondvertexNumber,
sizeof(
unsigned int));
30 assert(secondvertexNumber == vertexNumber);
31 assert(bytes_read ==
sizeof(
unsigned int));
33 bytes_read =
read(IEF, &inEdgeNumber,
sizeof(
unsigned int));
34 assert(bytes_read ==
sizeof(
unsigned int));
35 bytes_read =
read(OEF, &outEdgeNumber,
sizeof(
unsigned int));
36 assert(bytes_read ==
sizeof(
unsigned int));
40 printf(
"InEdgeNumber : %d\n", inEdgeNumber);
41 printf(
"outEdgeNumber : %d\n", outEdgeNumber);
49 assert(bytes_read ==
sizeof(
Edge) * inEdgeNumber);
51 assert(bytes_read ==
sizeof(
Edge) * outEdgeNumber);
53 printf(
"Graph Loading Completed!\n");
EdgeId inEdgesIDs[MAX_VERTEX_NUMBER]
Edge outEdges[MAX_EDGE_NUMBER]
Edge inEdges[MAX_EDGE_NUMBER]
void loadGraph(char *InVertexFileName, char *OutVertexFileName, char *InEdgeFileName, char *OutEdgeFileName)
EdgeId outEdgesIDs[MAX_VERTEX_NUMBER]
short int read(short int *data)