import numpy as np
from numpy import sin, cos, tan, pi
from pprint import pprint
import sys

def outer_product(v1, v2):
    return np.cross(v1, v2)

def inner_product(v1, v2):
    return np.dot(v1, v2)

def product(m1, m2):
    return np.dot(m1, m2)

def make_matrix1(n, defval = None, type = None):
#    matrix = [defval]*n
    matrix = []
    for i in range(n):
        if type == 'list':
            matrix.append([])
        else:
            matrix.append(defval)

    return matrix

def make_matrix2(nrow, ncolumn, defval = None):
    matrix = []
    for i in range(nrow):
        matrix.append(make_matrix1(ncolumn, defval))

    return matrix

def make_matrix3(n1, n2, n3, defval = None):
    matrix = []
    for i in range(n1):
        matrix.append(make_matrix2(n2, n3, defval))

    return matrix

def make_matrix4(n1, n2, n3, n4, defval = None):
    matrix = []
    for i in range(n1):
        matrix.append(make_matrix3(n2, n3, n4, defval))

    return matrix

 