





def 				__UpperCamelCase  (		snake_case    ,	snake_case     )  ->						int:


   '''simple docstring'''







   for index, item in enumerate(snake_case     ):
      if item == target:
         return index
   return -1
def 				__UpperCamelCase  (		snake_case    ,	snake_case    ,	snake_case    ,	snake_case     )  ->						int:


   '''simple docstring'''







   if not (0 <= high < len(snake_case     ) and 0 <= low < len(snake_case     )):
      raise Exception('''Invalid upper or lower bound!'''     )
   if high < low:
      return -1
   if sequence[low] == target:
      return low
   if sequence[high] == target:
      return high
   return rec_linear_search(snake_case    ,	low + 1    ,	high - 1    ,	snake_case     )


if __name__ == "__main__":
    _UpperCamelCase   :							Optional[int]     =	input("""Enter numbers separated by comma:\n""").strip()
    _UpperCamelCase   :							int     =	[int(item.strip()) for item in user_input.split(""",""")]

    _UpperCamelCase   :							List[str]     =	int(input("""Enter a single number to be found in the list:\n""").strip())
    _UpperCamelCase   :							List[str]     =	linear_search(sequence, target)
    if result != -1:
        print(F"""linear_search({sequence}, {target}) = {result}""")
    else:
        print(F"""{target} was not found in {sequence}""")








import numpy as np
def 				__UpperCamelCase  (		snake_case     )  ->						Any:


   '''simple docstring'''







   __A ,						__A				 =       a.shape
   __A				 =       min(snake_case    ,	snake_case     )
   __A				 =       np.eye(snake_case     )
   __A				 =       a.copy()

   for k in range(t - 1     ):
      # select a column of modified matrix A':
      __A				 =       r[k:, [k]]
      # construct first basis vector
      __A				 =       np.zeros_like(snake_case     )
      __A				 =       1.0
      # determine scaling factor
      __A				 =       np.linalg.norm(snake_case     )
      # construct vector v for Householder reflection
      __A				 =       x + np.sign(x[0]     ) * alpha * ea
      v /= np.linalg.norm(snake_case     )

      # construct the Householder matrix
      __A				 =       np.eye(m - k     ) - 2.0 * v @ v.T
      # pad with ones and zeros as necessary
      __A				 =       np.block([[np.eye(snake_case     ), np.zeros((k, m - k)     )], [np.zeros((m - k, k)     ), q_k]]     )

      __A				 =       q @ q_k.T
      __A				 =       q_k @ r

   return q, r


if __name__ == "__main__":
    import doctest

    doctest.testmod()

