pygraphblas icon indicating copy to clipboard operation
pygraphblas copied to clipboard

Creation of User Defined Types With Arrays

Open rustam-azimov opened this issue 3 years ago • 5 comments

Is it possible to create user defined types for matrix elements that contain int array, for example? If so, what types should be entered instead of double and uint64_t in the following line?

members = ['double w', 'uint64_t h', 'uint64_t pi']

rustam-azimov avatar Aug 03 '20 13:08 rustam-azimov

Hi @rustam-azimov,

Unfortunately at the moment matrix elements can only be scalar elements of a fixed size. This is a limitation of the underlying GraphBLAS spec. There has been talk of having variable length elements, or event elements that are sub-matrices themselves but that's still in the discussion phase.

michelp avatar Aug 04 '20 20:08 michelp

I think this will be possible with the C++ API but (I think) providing a solution for this is not even on the roadmap for the C API. So we might close this issue as a wontfix for the time being.

szarnyasg avatar Aug 21 '20 09:08 szarnyasg

Yes, thank you.

rustam-azimov avatar Aug 21 '20 10:08 rustam-azimov

I would like to share that we were able to implement our algorithm for CFPQ that can restore all founded paths. We use C realization of GraphBLAS and C++ structure with int* array and int size members for matrix elements. It will be great if in the future it will be possible to use int* in matrix element types in pygraphblas.

rustam-azimov avatar Feb 07 '21 11:02 rustam-azimov

How you think, is it possible or there are some limitations from cffi or Python itself?

rustam-azimov avatar Feb 10 '21 10:02 rustam-azimov