Graphegon / pygraphblas

GraphBLAS for Python
https://graphegon.github.io/pygraphblas/pygraphblas/index.html
Apache License 2.0
343 stars 27 forks source link

Creation of User Defined Types With Arrays #65

Open rustam-azimov opened 4 years ago

rustam-azimov commented 4 years ago

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']

michelp commented 4 years ago

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.

szarnyasg commented 4 years ago

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.

rustam-azimov commented 4 years ago

Yes, thank you.

rustam-azimov commented 3 years ago

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 commented 3 years ago

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