


from __future__ import annotations
def        __lowerCamelCase		(				UpperCAmelCase_		:	list[int | float]		):




      """simple docstring"""





      if len(UpperCAmelCase_		) == 0:
            raise ValueError('''find_max() arg is an empty sequence'''		)
      a		:List[str]											= nums[0]
      for x in nums:
            if x > max_num:
                  a		:Union[str, Any]											= x
      return max_num


if __name__ == "__main__":
     import doctest

     doctest.testmod(verbose=True)









import numpy as np
def        __lowerCamelCase		(				UpperCAmelCase_		:	Optional[Any]		):




      """simple docstring"""





      a							,       a		:Union[str, Any]											= a.shape
      a		:Any											= min(UpperCAmelCase_				,						UpperCAmelCase_		)
      a		:Tuple											= np.eye(UpperCAmelCase_		)
      a		:Any											= a.copy()

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

            # construct the Householder matrix
            a		:Union[str, Any]											= np.eye(m - k		) - 2.0 * v @ v.T
            # pad with ones and zeros as necessary
            a		:Tuple											= np.block([[np.eye(UpperCAmelCase_		), np.zeros((k, m - k)		)], [np.zeros((m - k, k)		), q_k]]		)

            a		:List[Any]											= q @ q_k.T
            a		:int											= q_k @ r

      return q, r


if __name__ == "__main__":
     import doctest

     doctest.testmod()





