|
| 1 | +using System; |
| 2 | +using NumSharp.Backends; |
| 3 | + |
| 4 | +namespace NumSharp |
| 5 | +{ |
| 6 | + public static partial class np |
| 7 | + { |
| 8 | + /// <summary> |
| 9 | + /// Clip (limit) the values in an array.<br></br> |
| 10 | + /// Given an interval, values outside the interval are clipped to the interval edges. For example, if an interval of [0, 1] is specified, values smaller than 0 become 0, and values larger than 1 become 1. |
| 11 | + /// </summary> |
| 12 | + /// <param name="a">Array containing elements to clip.</param> |
| 13 | + /// <param name="a_max">Maximum value. If None, clipping is not performed on upper interval edge. Not more than one of a_min and a_max may be None.</param> |
| 14 | + /// <param name="a_min">Minimum value. If None, clipping is not performed on lower interval edge. Not more than one of a_min and a_max may be None.</param> |
| 15 | + /// <param name="outType">The dtype the returned ndarray should be of, only non integer values are supported.</param> |
| 16 | + /// <returns>An array with the elements of a, but where values < a_min are replaced with a_min, and those > a_max with a_max.</returns> |
| 17 | + /// <remarks>https://docs.scipy.org/doc/numpy-1.15.0/reference/generated/numpy.clip.html</remarks> |
| 18 | + public static NDArray clip(in NDArray a, ValueType a_min, ValueType a_max, NPTypeCode? outType = null) |
| 19 | + => a.TensorEngine.Clip(a, a_min, a_max, outType); |
| 20 | + |
| 21 | + /// <summary> |
| 22 | + /// Clip (limit) the values in an array.<br></br> |
| 23 | + /// Given an interval, values outside the interval are clipped to the interval edges. For example, if an interval of [0, 1] is specified, values smaller than 0 become 0, and values larger than 1 become 1. |
| 24 | + /// </summary> |
| 25 | + /// <param name="a">Array containing elements to clip.</param> |
| 26 | + /// <param name="a_max">Maximum value. If None, clipping is not performed on upper interval edge. Not more than one of a_min and a_max may be None.</param> |
| 27 | + /// <param name="a_min">Minimum value. If None, clipping is not performed on lower interval edge. Not more than one of a_min and a_max may be None.</param> |
| 28 | + /// <param name="outType">The dtype the returned ndarray should be of, only non integer values are supported.</param> |
| 29 | + /// <returns>An array with the elements of a, but where values < a_min are replaced with a_min, and those > a_max with a_max.</returns> |
| 30 | + /// <remarks>https://docs.scipy.org/doc/numpy-1.15.0/reference/generated/numpy.clip.html</remarks> |
| 31 | + public static NDArray clip(in NDArray a, ValueType a_min, ValueType a_max, Type outType) |
| 32 | + => a.TensorEngine.Clip(a, a_min, a_max, outType); |
| 33 | + |
| 34 | + /// <summary> |
| 35 | + /// Clip (limit) the values in an array.<br></br> |
| 36 | + /// Given an interval, values outside the interval are clipped to the interval edges. For example, if an interval of [0, 1] is specified, values smaller than 0 become 0, and values larger than 1 become 1. |
| 37 | + /// </summary> |
| 38 | + /// <param name="a">Array containing elements to clip.</param> |
| 39 | + /// <param name="a_max">Maximum value. If None, clipping is not performed on upper interval edge. Not more than one of a_min and a_max may be None.</param> |
| 40 | + /// <param name="a_min">Minimum value. If None, clipping is not performed on lower interval edge. Not more than one of a_min and a_max may be None.</param> |
| 41 | + /// <param name="outType">The dtype the returned ndarray should be of, only non integer values are supported.</param> |
| 42 | + /// <returns>An array with the elements of a, but where values < a_min are replaced with a_min, and those > a_max with a_max.</returns> |
| 43 | + /// <remarks>https://docs.scipy.org/doc/numpy-1.15.0/reference/generated/numpy.clip.html</remarks> |
| 44 | + public static NDArray clip(in NDArray a, NDArray a_min, NDArray a_max, NPTypeCode? outType = null) |
| 45 | + => a.TensorEngine.ClipNDArray(a, a_min, a_max, outType); |
| 46 | + |
| 47 | + /// <summary> |
| 48 | + /// Clip (limit) the values in an array.<br></br> |
| 49 | + /// Given an interval, values outside the interval are clipped to the interval edges. For example, if an interval of [0, 1] is specified, values smaller than 0 become 0, and values larger than 1 become 1. |
| 50 | + /// </summary> |
| 51 | + /// <param name="a">Array containing elements to clip.</param> |
| 52 | + /// <param name="a_max">Maximum value. If None, clipping is not performed on upper interval edge. Not more than one of a_min and a_max may be None.</param> |
| 53 | + /// <param name="a_min">Minimum value. If None, clipping is not performed on lower interval edge. Not more than one of a_min and a_max may be None.</param> |
| 54 | + /// <param name="outType">The dtype the returned ndarray should be of, only non integer values are supported.</param> |
| 55 | + /// <returns>An array with the elements of a, but where values < a_min are replaced with a_min, and those > a_max with a_max.</returns> |
| 56 | + /// <remarks>https://docs.scipy.org/doc/numpy-1.15.0/reference/generated/numpy.clip.html</remarks> |
| 57 | + public static NDArray clip(in NDArray a, NDArray a_min, NDArray a_max, Type outType) |
| 58 | + => a.TensorEngine.ClipNDArray(a, a_min, a_max, outType); |
| 59 | + |
| 60 | + /// <summary> |
| 61 | + /// Clip (limit) the values in an array.<br></br> |
| 62 | + /// Given an interval, values outside the interval are clipped to the interval edges. For example, if an interval of [0, 1] is specified, values smaller than 0 become 0, and values larger than 1 become 1. |
| 63 | + /// </summary> |
| 64 | + /// <param name="a">Array containing elements to clip.</param> |
| 65 | + /// <param name="a_max">Maximum value. If None, clipping is not performed on upper interval edge. Not more than one of a_min and a_max may be None.</param> |
| 66 | + /// <param name="a_min">Minimum value. If None, clipping is not performed on lower interval edge. Not more than one of a_min and a_max may be None.</param> |
| 67 | + /// <param name="outType">The dtype the returned ndarray should be of, only non integer values are supported.</param> |
| 68 | + /// <returns>An array with the elements of a, but where values < a_min are replaced with a_min, and those > a_max with a_max.</returns> |
| 69 | + /// <remarks>https://docs.scipy.org/doc/numpy-1.15.0/reference/generated/numpy.clip.html</remarks> |
| 70 | + public static NDArray clip<TMax>(in NDArray a, NDArray a_min, TMax a_max, NPTypeCode? outType = null) where TMax : unmanaged |
| 71 | + => a.TensorEngine.ClipNDArray(a, a_min, NDArray.Scalar(a_max), outType); |
| 72 | + |
| 73 | + /// <summary> |
| 74 | + /// Clip (limit) the values in an array.<br></br> |
| 75 | + /// Given an interval, values outside the interval are clipped to the interval edges. For example, if an interval of [0, 1] is specified, values smaller than 0 become 0, and values larger than 1 become 1. |
| 76 | + /// </summary> |
| 77 | + /// <param name="a">Array containing elements to clip.</param> |
| 78 | + /// <param name="a_max">Maximum value. If None, clipping is not performed on upper interval edge. Not more than one of a_min and a_max may be None.</param> |
| 79 | + /// <param name="a_min">Minimum value. If None, clipping is not performed on lower interval edge. Not more than one of a_min and a_max may be None.</param> |
| 80 | + /// <param name="outType">The dtype the returned ndarray should be of, only non integer values are supported.</param> |
| 81 | + /// <returns>An array with the elements of a, but where values < a_min are replaced with a_min, and those > a_max with a_max.</returns> |
| 82 | + /// <remarks>https://docs.scipy.org/doc/numpy-1.15.0/reference/generated/numpy.clip.html</remarks> |
| 83 | + public static NDArray clip<TMax>(in NDArray a, NDArray a_min, TMax a_max, Type outType) where TMax : unmanaged |
| 84 | + => a.TensorEngine.ClipNDArray(a, a_min, NDArray.Scalar(a_max), outType); |
| 85 | + |
| 86 | + /// <summary> |
| 87 | + /// Clip (limit) the values in an array.<br></br> |
| 88 | + /// Given an interval, values outside the interval are clipped to the interval edges. For example, if an interval of [0, 1] is specified, values smaller than 0 become 0, and values larger than 1 become 1. |
| 89 | + /// </summary> |
| 90 | + /// <param name="a">Array containing elements to clip.</param> |
| 91 | + /// <param name="a_max">Maximum value. If None, clipping is not performed on upper interval edge. Not more than one of a_min and a_max may be None.</param> |
| 92 | + /// <param name="a_min">Minimum value. If None, clipping is not performed on lower interval edge. Not more than one of a_min and a_max may be None.</param> |
| 93 | + /// <param name="outType">The dtype the returned ndarray should be of, only non integer values are supported.</param> |
| 94 | + /// <returns>An array with the elements of a, but where values < a_min are replaced with a_min, and those > a_max with a_max.</returns> |
| 95 | + /// <remarks>https://docs.scipy.org/doc/numpy-1.15.0/reference/generated/numpy.clip.html</remarks> |
| 96 | + public static NDArray clip<TMin>(in NDArray a, TMin a_min, NDArray a_max, NPTypeCode? outType = null) where TMin : unmanaged |
| 97 | + => a.TensorEngine.ClipNDArray(a, NDArray.Scalar(a_min), a_max, outType); |
| 98 | + |
| 99 | + /// <summary> |
| 100 | + /// Clip (limit) the values in an array.<br></br> |
| 101 | + /// Given an interval, values outside the interval are clipped to the interval edges. For example, if an interval of [0, 1] is specified, values smaller than 0 become 0, and values larger than 1 become 1. |
| 102 | + /// </summary> |
| 103 | + /// <param name="a">Array containing elements to clip.</param> |
| 104 | + /// <param name="a_max">Maximum value. If None, clipping is not performed on upper interval edge. Not more than one of a_min and a_max may be None.</param> |
| 105 | + /// <param name="a_min">Minimum value. If None, clipping is not performed on lower interval edge. Not more than one of a_min and a_max may be None.</param> |
| 106 | + /// <param name="outType">The dtype the returned ndarray should be of, only non integer values are supported.</param> |
| 107 | + /// <returns>An array with the elements of a, but where values < a_min are replaced with a_min, and those > a_max with a_max.</returns> |
| 108 | + /// <remarks>https://docs.scipy.org/doc/numpy-1.15.0/reference/generated/numpy.clip.html</remarks> |
| 109 | + public static NDArray clip<TMin>(in NDArray a, TMin a_min, NDArray a_max, Type outType) where TMin : unmanaged |
| 110 | + => a.TensorEngine.ClipNDArray(a, NDArray.Scalar(a_min), a_max, outType); |
| 111 | + } |
| 112 | +} |
0 commit comments