假设我有一个矩阵 M:
>>> print type(M)
<class 'pyop2.petsc_base.Mat'>
>>> dir(M)
['Snapshot', '_Assembly', '_Versioned__version', '__call__', '__class__', '__delattr__', '__dict__', '__doc__', '__format__', '__getattribute__', '__getitem__', '__hash__', '__init__', '__iter__', '__module__', '__mul__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__slotnames__', '__str__', '__subclasshook__', '__weakref__', '_argtype', '_assemble', '_blocks', '_cow_actual_copy', '_datatype', '_force_evaluation', '_globalcount', '_init', '_init_block', '_init_monolithic', '_init_nest', '_is_scalar_field', '_is_vector_field', '_modes', '_name', '_needs_assembly', '_sparsity', '_version', '_version_before_zero', '_version_bump', '_version_set_zero', 'addto_values', 'assemble', 'blocks', 'cdim', 'create_snapshot', 'ctype', 'dim', 'dims', 'dtype', 'dump', 'duplicate', 'handle', 'name', 'nblock_cols', 'nblock_rows', 'nbytes', 'ncols', 'nrows', 'set_diagonal', 'set_local_diagonal_entries', 'set_values', 'sparsity', 'values', 'zero', 'zero_rows']
文档https://op2.github.io/PyOP2/user.html说, M.sparsity.colidx持有“ CSR 数据结构的列索引数组”,而M.sparsity.rowptr持有“ CSR 数据结构的行指针数组” ",好的,所以我已经有了所有需要的坐标来重建 CSR 矩阵,但是这个CSR 数据结构在哪里?