GraphBLAS / graphblas-api-c

Other
7 stars 3 forks source link

Consider making GrB_DESC_S the default #49

Closed DrTimothyAldenDavis closed 2 years ago

DrTimothyAldenDavis commented 2 years ago

It's far more common that the Mask is used in a structural sense, instead of a valued sense. GrB_DESC_S should be the default. This will make algorithms easier to write. It would require a change to all of the pre-defined descriptors, of course. But since the v2.0 C API is already breaking backward compatibility, this would be a good time to consider it.

DrTimothyAldenDavis commented 2 years ago

To implement this change, the existing GrBDESC* could remain unchanged. Just define "GrB_NULL" as the same as GrB_DESC_S. Add a built-in descriptor GrB_DESC_V for "valued mask".

GrB_Descriptor_new would create a default descriptor, with the GrB_MASK option set as GrB_STRUCTURE. To change this, the setting GrB_VALUE could be added to the mask option.

This would be minimal change, but it would remove the ubiquitous "GrB_DESC_S" descriptor used so frequently. It would also encourage people to use the structural mask, which is faster than the valued mask, sometimes asymptotically so.

DrTimothyAldenDavis commented 2 years ago

Rethinking this ... it would be too disruptive.