hornet-gt / hornet

Hornet data structure for sparse dynamic graphs and matrices
BSD 3-Clause "New" or "Revised" License
78 stars 31 forks source link

GraphIO weight fixes #2

Closed kasimirgabert closed 6 years ago

kasimirgabert commented 6 years ago

Added in fixes that prevented the GraphIO GraphWeight class from working correctly. coo_t, specified in GraphStd, was being used to allocate the COO. This fix makes that allocation optional in GraphStd and the COO is then actually allocated in GraphWeight, where the size is correct. Additionally the weighted graph parsers all used _coo_size, which was not set. A simple test file was created which was used to verify that a weighted matrix market file was parsed correctly.

Prior to this fix the weight_test binary will segfault.

darioemb commented 6 years ago

i have tried to launch ./weight_test with G_weighted.mtx a small graph and it works properly.

ghost commented 6 years ago

Sorry I don't understand this pull request. Why you added const bool allocate_coo? is it to avoid the coo array allocation twice? in this case, I think there is a more elegant solution

kasimirgabert commented 6 years ago

Yes, it is to avoid allocating the coo array if the allocation will be the wrong size. A more elegant solution would be great; as it stands it's broken, so any solution soon would be appreciated.

darioemb commented 5 years ago

Kasimir rule