I am new to numba and used it worked quite well so far in speeding up some of my code. But i have hit a dead end in a naive implementation of a vektor-matrix multiplikation.

I have the matrix A, the vector b and the Produkt Ab. But everytime i try to add the product

of the matrix A and vector b to a temporary variable, i get the same error:

raise e.with_traceback(None)

numba.core.errors.TypingError: Failed in nopython mode pipeline (step: nopython frontend)

No implementation of function Function() found for signature:

iadd(float64, array(float64, 1d, C))

There are 16 candidate implementations:

- Of which 14 did not match due to:

Overload of function ‘iadd’: File: : Line N/A.

With argument(s): ‘(float64, array(float64, 1d, C))’:

No match. - Of which 2 did not match due to:

Operator Overload in function ‘iadd’: File: unknown: Line unknown.

With argument(s): ‘(float64, array(float64, 1d, C))’:

No match for registered cases:- (int64, int64) → int64
- (int64, uint64) → int64
- (uint64, int64) → int64
- (uint64, uint64) → uint64
- (float32, float32) → float32
- (float64, float64) → float64
- (complex64, complex64) → complex64
- (complex128, complex128) → complex128

File “src/code/eigenvector-centrality/eigenvector_numba.py”, line 46:

def mat_vector_mul(A, b, Ab):

Code:

@numba.njit(parallel = True)

def mat_vector_mul(A, b, Ab):

tmp = 0.0

for i in numba.prange(b.shape[0]):

for j in numba.prange(A.shape[1]):

tmp += A[i, j] * b[i]

Ab[i] = tmp

I am pretty sure i am overlooking something absolutely obvious, but cannot get a hold of it. Any suggestions or help is highly appreciated! Thanks!