Skip to content

Commit

Permalink
fix bug in index_vert_array.cpp and add .gigignore
Browse files Browse the repository at this point in the history
  • Loading branch information
lhm217 committed May 5, 2015
1 parent c751e37 commit de462ac
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 10 deletions.
30 changes: 30 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
lo
*.lo
*.o
*.obj

# Precompiled Headers
*.gch
*.pch

# Compiled Dynamic libraries
*.so
*.dylib
*.dll

# Fortran module files
*.mod

# Compiled Static libraries
*.lai
*.la
*.a
*.lib

# Executables
*.exe
*.out
*.app

# bin
bin/*
24 changes: 14 additions & 10 deletions fogsrc/index_vert_array.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
*
* Routines:
* Manipulate the mmapped files
*
* Notes:
* 1.fix bug(function:num_edges())
* modified by Huiming Lv 2015/5/5
*************************************************************************************************/

#include <stdlib.h>
Expand Down Expand Up @@ -181,15 +185,15 @@ unsigned int index_vert_array<T>::num_edges( unsigned int vid, int mode )
end_edge = gen_config.num_edges;
else{
for( u32_t i=vid+1; i<=gen_config.max_vert_id; i++ ){
if (i == gen_config.max_vert_id)
{
end_edge = gen_config.num_edges;
break;
}
if( vert_array_header[i].offset != 0L ){
end_edge = vert_array_header[i].offset -1;
break;
}
if (i == gen_config.max_vert_id) //means this vertex is the last vertex which has out_edge
{
end_edge = gen_config.num_edges;
break;
}
}
}
if( end_edge < start_edge ){
Expand All @@ -211,15 +215,15 @@ unsigned int index_vert_array<T>::num_edges( unsigned int vid, int mode )
end_edge = gen_config.num_edges;
else{
for( u32_t i=vid+1; i<=gen_config.max_vert_id; i++ ){
if (i == gen_config.max_vert_id)
{
end_edge = gen_config.num_edges;
break;
}
if( in_vert_array_header[i].offset != 0L ){
end_edge = in_vert_array_header[i].offset -1;
break;
}
if (i == gen_config.max_vert_id) //means this vertex is the last vertex which has in_edge
{
end_edge = gen_config.num_edges;
break;
}
}
}
if( end_edge < start_edge ){
Expand Down

0 comments on commit de462ac

Please sign in to comment.