'Creates a sparse matrix in coo format
*vals*: arrays of values of non-null entries of the matrix
*rows*: int arrays of rows of non-null entries of the matrix
*cols*: int arrays of cols of non-null entries of the matrix
*shape*: 2-tuple (n,m) of matrix shape'

def __init__(self, vals, rows, cols, shape):

    (self.n, self.m) = shape
    self.vals = np.asarray(vals, dtype=np.float64)
    self.rows = np.asarray(rows, dtype=np.int32)
    self.cols = np.asarray(cols, dtype=np.int32)
