forked from SciSharp/NumSharp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNDArray.amin.cs
More file actions
87 lines (81 loc) · 4.89 KB
/
NDArray.amin.cs
File metadata and controls
87 lines (81 loc) · 4.89 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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
using System;
using System.Diagnostics.CodeAnalysis;
using NumSharp.Backends;
namespace NumSharp
{
public partial class NDArray
{
/// <summary>
/// Return the minimum of an array or minimum along an axis.
/// </summary>
/// <typeparam name="T">The expected return type, cast will be performed if necessary.</typeparam>
/// <returns>Minimum of a. If axis is None, the result is a scalar value. If axis is given, the result is an array of dimension a.ndim - 1.</returns>
/// <remarks>https://docs.scipy.org/doc/numpy/reference/generated/numpy.amin.html</remarks>
public T amin<T>() where T : unmanaged
{
return np.asscalar<T>(TensorEngine.AMin(this, null, typeof(T).GetTypeCode(), false));
}
/// <summary>
/// Return the minimum of an array or minimum along an axis.
/// </summary>
/// <param name="axis">Axis or axes along which to operate. </param>
/// <param name="keepdims">If this is set to True, the axes which are reduced are left in the result as dimensions with size one. With this option, the result will broadcast correctly against the input array.</param>
/// <param name="dtype">the type expected as a return, null will remain the same dtype.</param>
/// <returns>Minimum of a. If axis is None, the result is a scalar value. If axis is given, the result is an array of dimension a.ndim - 1.</returns>
/// <remarks>https://docs.scipy.org/doc/numpy/reference/generated/numpy.amin.html</remarks>
[SuppressMessage("ReSharper", "TooWideLocalVariableScope")]
[SuppressMessage("ReSharper", "ParameterHidesMember")]
public NDArray amin(int axis, bool keepdims = false, Type dtype = null)
{
return TensorEngine.AMin(this, axis, dtype, keepdims);
}
/// <summary>
/// Return the minimum of an array or minimum along an axis.
/// </summary>
/// <param name="dtype">the type expected as a return, null will remain the same dtype.</param>
/// <returns>Minimum of a. If axis is None, the result is a scalar value. If axis is given, the result is an array of dimension a.ndim - 1.</returns>
/// <remarks>https://docs.scipy.org/doc/numpy/reference/generated/numpy.amin.html</remarks>
[SuppressMessage("ReSharper", "TooWideLocalVariableScope")]
[SuppressMessage("ReSharper", "ParameterHidesMember")]
public NDArray amin(Type dtype = null)
{
return TensorEngine.AMin(this, null, dtype?.GetTypeCode(), false);
}
/// <summary>
/// Return the minimum of an array or minimum along an axis.
/// </summary>
/// <typeparam name="T">The expected return type, cast will be performed if necessary.</typeparam>
/// <returns>Minimum of a. If axis is None, the result is a scalar value. If axis is given, the result is an array of dimension a.ndim - 1.</returns>
/// <remarks>https://docs.scipy.org/doc/numpy/reference/generated/numpy.amin.html</remarks>
public T min<T>() where T : unmanaged
{
return amin<T>();
}
/// <summary>
/// Return the minimum of an array or minimum along an axis.
/// </summary>
/// <param name="axis">Axis or axes along which to operate. </param>
/// <param name="keepdims">If this is set to True, the axes which are reduced are left in the result as dimensions with size one. With this option, the result will broadcast correctly against the input array.</param>
/// <param name="dtype">the type expected as a return, null will remain the same dtype.</param>
/// <returns>Minimum of a. If axis is None, the result is a scalar value. If axis is given, the result is an array of dimension a.ndim - 1.</returns>
/// <remarks>https://docs.scipy.org/doc/numpy/reference/generated/numpy.amin.html</remarks>
[SuppressMessage("ReSharper", "TooWideLocalVariableScope")]
[SuppressMessage("ReSharper", "ParameterHidesMember")]
public NDArray min(int axis, bool keepdims = false, Type dtype = null)
{
return amin(axis, keepdims, dtype);
}
/// <summary>
/// Return the minimum of an array or minimum along an axis.
/// </summary>
/// <param name="dtype">the type expected as a return, null will remain the same dtype.</param>
/// <returns>Minimum of a. If axis is None, the result is a scalar value. If axis is given, the result is an array of dimension a.ndim - 1.</returns>
/// <remarks>https://docs.scipy.org/doc/numpy/reference/generated/numpy.amin.html</remarks>
[SuppressMessage("ReSharper", "TooWideLocalVariableScope")]
[SuppressMessage("ReSharper", "ParameterHidesMember")]
public NDArray min(Type dtype = null)
{
return amin(dtype);
}
}
}