pyoptools.misc.cmisc.cmisc module

pyoptools.misc.cmisc.cmisc.dot_product_3x3_matrix_vector(matrix, vector)

Compute the dot product of a 3x3 matrix and a 3-element vector.

Parameters:
  • matrix (memoryview of shape (3, 3) and dtype double) – A memory view representing a 3x3 matrix.

  • vector (memoryview of shape (3,) and dtype double) – A memory view representing a 3-element vector.

Returns:

A memory view representing the resulting 3-element vector after the dot product.

Return type:

memoryview

pyoptools.misc.cmisc.cmisc.zero_memarray(shape)

Create a zero-initialized memoryview of doubles with the given shape.

Parameters:

shape (tuple) – The shape of the memoryview to be created. It determines the number of dimensions.

Returns:

double[ – A memoryview of type double initialized to zero with the given shape.

Return type:

, :], double[:, :, :], double[:, :, :, :], or double[:, :, :, :, :]