forked from SciSharp/NumSharp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNDArray.amax.cs
More file actions
87 lines (81 loc) · 4.87 KB
/
NDArray.amax.cs
File metadata and controls
87 lines (81 loc) · 4.87 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 maximum of an array or maximum along an axis.
/// </summary>
/// <typeparam name="T">The expected return type, cast will be performed if necessary.</typeparam>
/// <returns>Maximum 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.amax.html</remarks>
public T amax<T>() where T : unmanaged
{
return np.asscalar<T>(TensorEngine.AMax(this, null, typeof(T).GetTypeCode(), false));
}
/// <summary>
/// Return the maximum of an array or maximum 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>Maximum 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.amax.html</remarks>
[SuppressMessage("ReSharper", "TooWideLocalVariableScope")]
[SuppressMessage("ReSharper", "ParameterHidesMember")]
public NDArray amax(int axis, bool keepdims = false, Type dtype = null)
{
return TensorEngine.AMax(this, axis, dtype, keepdims);
}
/// <summary>
/// Return the maximum of an array or maximum along an axis.
/// </summary>
/// <param name="dtype">the type expected as a return, null will remain the same dtype.</param>
/// <returns>Maximum 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.amax.html</remarks>
[SuppressMessage("ReSharper", "TooWideLocalVariableScope")]
[SuppressMessage("ReSharper", "ParameterHidesMember")]
public NDArray amax(Type dtype = null)
{
return TensorEngine.AMax(this, null, dtype?.GetTypeCode(), false);
}
/// <summary>
/// Return the maximum of an array or maximum along an axis.
/// </summary>
/// <typeparam name="T">The expected return type, cast will be performed if necessary.</typeparam>
/// <returns>Maximum 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.amax.html</remarks>
public T max<T>() where T : unmanaged
{
return amax<T>();
}
/// <summary>
/// Return the maximum of an array or maximum 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>Maximum 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.amax.html</remarks>
[SuppressMessage("ReSharper", "TooWideLocalVariableScope")]
[SuppressMessage("ReSharper", "ParameterHidesMember")]
public NDArray max(int axis, bool keepdims = false, Type dtype = null)
{
return amax(axis, keepdims, dtype);
}
/// <summary>
/// Return the maximum of an array or maximum along an axis.
/// </summary>
/// <param name="dtype">the type expected as a return, null will remain the same dtype.</param>
/// <returns>Maximum 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.amax.html</remarks>
[SuppressMessage("ReSharper", "TooWideLocalVariableScope")]
[SuppressMessage("ReSharper", "ParameterHidesMember")]
public NDArray max(Type dtype = null)
{
return amax(dtype);
}
}
}