- nlcpy.may_share_memory(a, b, max_work=None)
Determine if two arrays might share memory.
A return of True does not necessarily mean that the two arrays share any element. It just means that they might.
- a, bndarray
- max_workint, optional
Effort to spend on solving the overlap problem. Please note that the current version supports only when max_work is None.
Dictionary containing the old settings.
If max_work is not None, NotImplementedError occurs.
>>> import nlcpy as vp >>> vp.may_share_memory(vp.array([1,2]), vp.array([5,8,9])) False >>> x = vp.zeros([3, 4]) >>> vp.may_share_memory(x[:,0], x[:,1]) True