def lower_bound(self, val, target=None):
    """
    Perform the operation target = (self < val) ? val:self, where val can be a matrix or a scalar.
    """
    if not target:
      target = self

    if isinstance(val, (int, float)):
      err_code = _eigenmat.lower_bound_scalar(self.p_mat, ct.c_float(val), target.p_mat)
    else:
      err_code = _eigenmat.lower_bound(self.p_mat, val.p_mat, target.p_mat)

    if err_code:
      raise generate_exception(err_code)

    return target

    Perform the operation target = (self < val) ? val:self, where val can be a matrix or a scalar.
    
eigenmat/eigenmat.py