# AUTOGENERATED! DO NOT EDIT! File to edit: 10_matrix_multiply.ipynb (unless otherwise specified).

__all__ = ['dotp', 'mmult']

# Cell
def dotp(v1, v2):
    "Get dot product of 2 vectors"
    sum = 0
    for i in range(0, len(v1)):
        sum += v1[i] * v2[i]
    return sum

# Cell
def mmult(m1, m2):
    "Get product of 2 matrices using [dotp](/mmult#dotp) "
    import numpy as np
    assert m1.shape[1] == m2.shape[0]
    vsize = m1.shape[1]
    pmatrix = np.zeros((m1.shape[0],m2.shape[1]))
    for i in range(0,m1.shape[0]):
        for j in range(0,m2.shape[1]):
            nv = dotp(m1[i,:], m2[:,j])
            pmatrix[i,j] = nv
    return pmatrix