def subtract(self, val, target=None):
    """Subtract val from self, where val can be a scalar or a EigenMatrix with
    the same dimensions as self. """

    if not target:
      target = self

    if isinstance(val, EigenMatrix):
      err_code = _eigenmat.subtract_elementwise(self.p_mat, val.p_mat, target.p_mat)
    elif isinstance(val, (int, float)):
      err_code = _eigenmat.add_scalar(self.p_mat, ct.c_float(-1*val), target.p_mat)
    else:
      raise ValueError, "Value must be of type EigenMatrix, int, or float."

    if err_code:
      raise generate_exception(err_code)

    return target
Subtract val from self, where val can be a scalar or a EigenMatrix with
    the same dimensions as self. 
eigenmat/eigenmat.py