def cho_solve(c_and_lower, b, overwrite_b=False, check_finite=True):
 (c, lower) = c_and_lower
 if check_finite:
  b1 = asarray_chkfinite(b)
  c = asarray_chkfinite(c)
 else:
  b1 = asarray(b)
  c = asarray(c)
 if ((c.ndim != 2) or (c.shape[0] != c.shape[1])):
  raise ValueError('The factored matrix c is not square.')
 if (c.shape[1] != b1.shape[0]):
  raise ValueError('incompatible dimensions.')
 overwrite_b = (overwrite_b or _datacopied(b1, b))
 (potrs,) = get_lapack_funcs(('potrs',), (c, b1))
 (x, info) = potrs(c, b1, lower=lower, overwrite_b=overwrite_b)
 if (info != 0):
  raise ValueError(('illegal value in %d-th argument of internal potrs' % (- info)))
 return x

def cho_solve ( c_and_lower , b , overwrite_b = False , check_finite = True ) : ( c , lower ) = c_and_lower if check_finite : b1 = asarray_chkfinite ( b ) c = asarray_chkfinite ( c ) else : b1 = asarray ( b ) c = asarray ( c ) if ( ( c . ndim != 2 ) or ( c . shape [ 0 ] != c . shape [ 1 ] ) ) : raise ValueError ( 'The factored matrix c is not square.' ) if ( c . shape [ 1 ] != b1 . shape [ 0 ] ) : raise ValueError ( 'incompatible dimensions.' ) overwrite_b = ( overwrite_b or _datacopied ( b1 , b ) ) ( potrs , ) = get_lapack_funcs ( ( 'potrs' , ) , ( c , b1 ) ) ( x , info ) = potrs ( c , b1 , lower = lower , overwrite_b = overwrite_b ) if ( info != 0 ) : raise ValueError ( ( 'illegal value in %d-th argument of internal potrs' % ( - info ) ) ) return x
solve the linear equations a x = b .