pyCGM_Single.pyCGM.matrixmult

pyCGM_Single.pyCGM.matrixmult(A, B)

Matrix multiplication.

This function returns the product of a matrix multiplication given two matrices.

Let the dimension of the matrix A be: m by n, let the dimension of the matrix B be: p by q, multiplication will only possible if n = p, creating a matrix of m by q size.

Parameters
Alist

First matrix, in a 2D array format.

Blist

Second matrix, in a 2D array format.

Returns
Clist

The product of the matrix multiplication.

Examples

>>> from .pyCGM import matrixmult
>>> A = [[11,12,13],[14,15,16]]
>>> B = [[1,2],[3,4],[5,6]]
>>> matrixmult(A, B)
[[112, 148], [139, 184]]