Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion system/graph/TupleGraph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ TupleGraph TupleGraph::load_tsv( std::string path ) {
}

/// Matrix Market format loader
TupleGraph TupleGraph::load_mm( std::string path ) {
TupleGraph TupleGraph::load_mm( std::string path, bool one_indexed ) {
// make sure file exists
CHECK( fs::exists( path ) ) << "File not found.";
CHECK( fs::is_regular_file( path ) ) << "File is not a regular file.";
Expand Down Expand Up @@ -442,8 +442,10 @@ TupleGraph TupleGraph::load_mm( std::string path ) {
std::getline( infile, str );
} else {
infile >> v0;
if(one_indexed) v0--;
if( !infile.good() ) break;
infile >> v1;
if(one_indexed) v1--;
if( header_info.field_double ) {
double d;
infile >> d;
Expand Down
2 changes: 1 addition & 1 deletion system/graph/TupleGraph.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ namespace Grappa {
void save_generic( std::string, void (*f)( const char *, Edge*, Edge*) );

static TupleGraph load_tsv( std::string path );
static TupleGraph load_mm( std::string path );
static TupleGraph load_mm( std::string path, bool one_indexed = true );

public:
GlobalAddress<Edge> edges;
Expand Down