imate
C++/CUDA Reference
types.h File Reference
#include "./definitions.h"
Include dependency graph for types.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Typedefs

typedef int LongIndexType
 
typedef int IndexType
 
typedef int FlagType
 

Typedef Documentation

◆ FlagType

typedef int FlagType

Definition at line 68 of file types.h.

◆ IndexType

typedef int IndexType

Definition at line 65 of file types.h.

◆ LongIndexType

typedef int LongIndexType

Use LongIndexType type for long indices where parallelization could be important. This could include, for instance, indices of long columns of matrices, but not short rows.

This type is intended to be set as long. However, because the indices of scipy.sparse matrices are stored as int (and not long) here, a fused type is used to accommodate both int and long.

The type of indices of sparse arrays can be cast, for instance by:

// In this file:
ctypedef long IndexType

// In linear_operator.pyx:LinearOperator:__cinit__()
// Add .astype('uint64') to these variables:
self.A_indices = A.indices.astype('uint64')
self.B_indices = A.indices.astype('uint64')
self.A_index_pointer = A.indptr.astype('uint64')
self.B_index_pointer = B.indptr.astype('uint64')

In the above, uint64 is equivalent to long. Note, this will copy the data, since scipy's sparse indices should be casted from uint32.

Definition at line 60 of file types.h.