def generate_exception(err_code):
 if (err_code == (-1)):
  return EigenMatException('Incompatible matrix dimensions.')
 elif (err_code == (-2)):
  return EigenMatException('CUBLAS error.')
 elif (err_code == (-3)):
  return EigenMatException(('CUDA error: ' + get_last_cuda_error()))
 elif (err_code == (-4)):
  return EigenMatException('Operation not supported on views.')
 elif (err_code == (-5)):
  return EigenMatException('Operation not supported on transposed matrices.')
 elif (err_code == (-6)):
  return EigenMatException('')
 elif (err_code == (-7)):
  return EigenMatException('Incompatible transposedness.')
 elif (err_code == (-8)):
  return EigenMatException('Matrix is not in device memory.')
 elif (err_code == (-9)):
  return EigenMatException('Operation not supported.')

def generate_exception ( err_code ) : if ( err_code == ( - 1 ) ) : return EigenMatException ( 'Incompatible matrix dimensions.' ) elif ( err_code == ( - 2 ) ) : return EigenMatException ( 'CUBLAS error.' ) elif ( err_code == ( - 3 ) ) : return EigenMatException ( ( 'CUDA error: ' + get_last_cuda_error ( ) ) ) elif ( err_code == ( - 4 ) ) : return EigenMatException ( 'Operation not supported on views.' ) elif ( err_code == ( - 5 ) ) : return EigenMatException ( 'Operation not supported on transposed matrices.' ) elif ( err_code == ( - 6 ) ) : return EigenMatException ( '' ) elif ( err_code == ( - 7 ) ) : return EigenMatException ( 'Incompatible transposedness.' ) elif ( err_code == ( - 8 ) ) : return EigenMatException ( 'Matrix is not in device memory.' ) elif ( err_code == ( - 9 ) ) : return EigenMatException ( 'Operation not supported.' )
return a cudamatexception object based on the error code err_code .