def reshape(self, shape):
    """
    Reshapes self to have the given shape. The number of elements cannot
    change as this only changes how the contents are interpreted.
    """

    m = ct.c_uint(shape[0])
    n = ct.c_uint(shape[1])

    err_code = _eigenmat.reshape(self.p_mat, m, n)
    if err_code:
      raise generate_exception(err_code)

    return self

    Reshapes self to have the given shape. The number of elements cannot
    change as this only changes how the contents are interpreted.
    
eigenmat/eigenmat.py