forked from SciSharp/NumSharp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnp.sqrt.cs
More file actions
28 lines (26 loc) · 1.96 KB
/
np.sqrt.cs
File metadata and controls
28 lines (26 loc) · 1.96 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
using System;
using NumSharp.Backends;
namespace NumSharp
{
public static partial class np
{
/// <summary>
/// Return the non-negative square-root of an array, element-wise.
/// </summary>
/// <param name="outType">The dtype the returned ndarray should be of, only non integer values are supported.</param>
/// <param name="x">The values whose square-roots are required.</param>
/// <returns>An array of the same shape as x, containing the positive square-root of each element in x. If any element in x is complex, a complex array is returned (and the square-roots of negative reals are calculated). If all of the elements in x are real, so is y, with negative elements returning nan. If out was provided, y is a reference to it. This is a scalar if x is a scalar.</returns>
/// <remarks>https://docs.scipy.org/doc/numpy/reference/generated/numpy.sqrt.html</remarks>
public static NDArray sqrt(in NDArray x, NPTypeCode? outType = null)
=> x.TensorEngine.Sqrt(x, outType);
/// <summary>
/// Return the non-negative square-root of an array, element-wise.
/// </summary>
/// <param name="x">The values whose square-roots are required.</param>
/// <param name="outType">The dtype the returned ndarray should be of, only non integer values are supported.</param>
/// <returns>An array of the same shape as x, containing the positive square-root of each element in x. If any element in x is complex, a complex array is returned (and the square-roots of negative reals are calculated). If all of the elements in x are real, so is y, with negative elements returning nan. If out was provided, y is a reference to it. This is a scalar if x is a scalar.</returns>
/// <remarks>https://docs.scipy.org/doc/numpy/reference/generated/numpy.sqrt.html</remarks>
public static NDArray sqrt(in NDArray x, Type outType)
=> x.TensorEngine.Sqrt(x);
}
}