agd.Eikonal.HFM_CUDA.misc
1# Copyright 2020 Jean-Marie Mirebeau, University Paris-Sud, CNRS, University Paris-Saclay 2# Distributed WITHOUT ANY WARRANTY. Licensed under the Apache License, Version 2.0, see http://www.apache.org/licenses/LICENSE-2.0 3 4import numpy as np 5 6def integral_largest_nextlargest(dtype): 7 dtype = np.dtype(dtype) 8 integral = dtype.kind in ('i','u') # signed or unsigned integer 9 largest = np.iinfo(dtype).max if integral else np.inf 10 nextlargest = largest-1 if integral else np.finfo(dtype).max 11 return integral,largest,nextlargest
def
integral_largest_nextlargest(dtype):