






'''simple docstring'''

import unittest

import numpy as np






def 	_UpperCAmelCase    (  a		:	np.ndarray						,			a		:	np.ndarray						,			a		:	np.ndarray						,			a		:	np.ndarray | None = None						,			)			->			np.ndarray:





						"""simple docstring"""
						lowercase_      :   str        =			np.shape(a							)
						lowercase_      :   int        =			np.shape(a							)
						lowercase_      :   Optional[int]        =			np.shape(a							)

						if shape_a[0] != shape_b[0]:
												lowercase_      :   Any        =			(
												    'Expected the same number of rows for A and B. '
												    f"Instead found A of size {shape_a} and B of size {shape_b}"
												)
												raise ValueError(a							)

						if shape_b[1] != shape_c[1]:
												lowercase_      :   Dict        =			(
												    'Expected the same number of columns for B and C. '
												    f"Instead found B of size {shape_b} and C of size {shape_c}"
												)
												raise ValueError(a							)

						lowercase_      :   Dict        =			pseudo_inv
						if a_inv is None:
												try:
																		lowercase_      :   Optional[int]        =			np.linalg.inv(a							)
												except np.linalg.LinAlgError:
																		raise ValueError(
																		    'Input matrix A is not invertible. Cannot compute Schur complement.'							)

						return mat_c - mat_b.T @ a_inv @ mat_b






class 							__magic_name__     (	unittest.TestCase				):







	"""simple docstring"""



	def        lowerCamelCase__		(							self       )						->  None:
							lowercase_      :   List[Any]        =			np.array([[1, 2, 1], [2, 1, 2], [3, 2, 4]]       )
							lowercase_      :   Union[str, Any]        =			np.array([[0, 3], [3, 0], [2, 3]]       )
							lowercase_      :   Dict        =			np.array([[2, 1], [6, 3]]       )

							lowercase_      :   Any        =			schur_complement(_lowercase  ,      _lowercase  ,      _lowercase       )

							lowercase_      :   Optional[int]        =			np.block([[a, b], [b.T, c]]       )

							lowercase_      :   str        =			np.linalg.det(_lowercase       )
							lowercase_      :   Optional[int]        =			np.linalg.det(_lowercase       )
							lowercase_      :   Tuple        =			np.linalg.det(_lowercase       )

							self.assertAlmostEqual(_lowercase  ,      det_a * det_s       )
	def        lowerCamelCase__		(							self       )						->  None:
							lowercase_      :   List[str]        =			np.array([[1, 2, 1], [2, 1, 2], [3, 2, 4]]       )
							lowercase_      :   Any        =			np.array([[0, 3], [3, 0], [2, 3]]       )
							lowercase_      :   Optional[Any]        =			np.array([[2, 1], [6, 3]]       )

							with self.assertRaises(_lowercase       ):
													schur_complement(_lowercase  ,      _lowercase  ,      _lowercase       )







	def        lowerCamelCase__		(							self       )						->  None:
							lowercase_      :   Any        =			np.array([[1, 2, 1], [2, 1, 2], [3, 2, 4]]       )
							lowercase_      :   Union[str, Any]        =			np.array([[0, 3], [3, 0], [2, 3]]       )
							lowercase_      :   Optional[int]        =			np.array([[2, 1, 3], [6, 3, 5]]       )

							with self.assertRaises(_lowercase       ):
													schur_complement(_lowercase  ,      _lowercase  ,      _lowercase       )


if __name__ == "__main__":
		import doctest

		doctest.testmod()
		unittest.main()








'''simple docstring'''

def 	_UpperCAmelCase    (  a		:	int						,			a		:	int							)			->			int:





						"""simple docstring"""
						while second != 0:
												lowercase_      :   Any        =			first & second
												first ^= second
												lowercase_      :   List[str]        =			c << 1
						return first


if __name__ == "__main__":
						import doctest

						doctest.testmod()

						A:      Union[str, Any]  				=				int(input("Enter the first number: ").strip())
						A:      Union[str, Any]  				=				int(input("Enter the second number: ").strip())
						print(f"""{add(first, second) = }""")
