forked from SciSharp/NumSharp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnp.var.cs
More file actions
148 lines (140 loc) · 11.7 KB
/
np.var.cs
File metadata and controls
148 lines (140 loc) · 11.7 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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
using System;
using NumSharp.Backends;
namespace NumSharp
{
public static partial class np
{
/// <summary>
/// Compute the variance along the specified axis.
/// Returns the variance of the array elements, a measure of the spread of a distribution.
/// The variance is computed for the flattened array by default, otherwise over the specified axis.
/// </summary>
/// <param name="a">Array containing numbers whose variance is desired. If a is not an array, a conversion is attempted.</param>
/// <param name="axis">Axis or axes along which the variance is computed. The default is to compute the variance of the flattened array.</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="ddof">Means Delta Degrees of Freedom. The divisor used in calculations is N - ddof, where N represents the number of elements. By default ddof is zero.</param>
/// <returns> returns a new array containing the var values, otherwise a reference to the output array is returned.</returns>
/// <remarks>https://docs.scipy.org/doc/numpy/reference/generated/numpy.var.html</remarks>
public static NDArray var(NDArray a, bool keepdims = false, int? ddof = null, NPTypeCode? dtype = null)
{
return a.TensorEngine.ReduceVar(a, null, keepdims, ddof, dtype);
}
/// <summary>
/// Compute the variance along the specified axis.
/// Returns the variance of the array elements, a measure of the spread of a distribution.
/// The variance is computed for the flattened array by default, otherwise over the specified axis.
/// </summary>
/// <param name="a">Array containing numbers whose variance is desired. If a is not an array, a conversion is attempted.</param>
/// <param name="axis">Axis or axes along which the variance is computed. The default is to compute the variance of the flattened array.</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="ddof">Means Delta Degrees of Freedom. The divisor used in calculations is N - ddof, where N represents the number of elements. By default ddof is zero.</param>
/// <returns> returns a new array containing the var values, otherwise a reference to the output array is returned.</returns>
/// <remarks>https://docs.scipy.org/doc/numpy/reference/generated/numpy.var.html</remarks>
public static NDArray var(in NDArray a, int? ddof = null)
=> a.TensorEngine.ReduceVar(a, null);
/// <summary>
/// Compute the variance along the specified axis.
/// Returns the variance of the array elements, a measure of the spread of a distribution.
/// The variance is computed for the flattened array by default, otherwise over the specified axis.
/// </summary>
/// <param name="a">Array containing numbers whose variance is desired. If a is not an array, a conversion is attempted.</param>
/// <param name="axis">Axis or axes along which the variance is computed. The default is to compute the variance of the flattened array.</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="ddof">Means Delta Degrees of Freedom. The divisor used in calculations is N - ddof, where N represents the number of elements. By default ddof is zero.</param>
/// <returns> returns a new array containing the var values, otherwise a reference to the output array is returned.</returns>
/// <remarks>https://docs.scipy.org/doc/numpy/reference/generated/numpy.var.html</remarks>
public static NDArray var(in NDArray a, int axis, int? ddof = null)
=> a.TensorEngine.ReduceVar(a, axis, ddof: ddof);
/// <summary>
/// Compute the variance along the specified axis.
/// Returns the variance of the array elements, a measure of the spread of a distribution.
/// The variance is computed for the flattened array by default, otherwise over the specified axis.
/// </summary>
/// <param name="a">Array containing numbers whose variance is desired. If a is not an array, a conversion is attempted.</param>
/// <param name="axis">Axis or axes along which the variance is computed. The default is to compute the variance of the flattened array.</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="ddof">Means Delta Degrees of Freedom. The divisor used in calculations is N - ddof, where N represents the number of elements. By default ddof is zero.</param>
/// <returns> returns a new array containing the var values, otherwise a reference to the output array is returned.</returns>
/// <remarks>https://docs.scipy.org/doc/numpy/reference/generated/numpy.var.html</remarks>
public static NDArray var(in NDArray a, bool keepdims, int? ddof = null)
=> a.TensorEngine.ReduceVar(a, null, keepdims, ddof: ddof);
/// <summary>
/// Compute the variance along the specified axis.
/// Returns the variance of the array elements, a measure of the spread of a distribution.
/// The variance is computed for the flattened array by default, otherwise over the specified axis.
/// </summary>
/// <param name="a">Array containing numbers whose variance is desired. If a is not an array, a conversion is attempted.</param>
/// <param name="axis">Axis or axes along which the variance is computed. The default is to compute the variance of the flattened array.</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="ddof">Means Delta Degrees of Freedom. The divisor used in calculations is N - ddof, where N represents the number of elements. By default ddof is zero.</param>
/// <returns> returns a new array containing the var values, otherwise a reference to the output array is returned.</returns>
/// <remarks>https://docs.scipy.org/doc/numpy/reference/generated/numpy.var.html</remarks>
public static NDArray var(in NDArray a, int axis, Type dtype, bool keepdims = false, int? ddof = null)
=> a.TensorEngine.ReduceVar(a, axis, keepdims, ddof, dtype != null ? dtype.GetTypeCode() : (NPTypeCode?)null);
/// <summary>
/// Compute the variance along the specified axis.
/// Returns the variance of the array elements, a measure of the spread of a distribution.
/// The variance is computed for the flattened array by default, otherwise over the specified axis.
/// </summary>
/// <param name="a">Array containing numbers whose variance is desired. If a is not an array, a conversion is attempted.</param>
/// <param name="axis">Axis or axes along which the variance is computed. The default is to compute the variance of the flattened array.</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="ddof">Means Delta Degrees of Freedom. The divisor used in calculations is N - ddof, where N represents the number of elements. By default ddof is zero.</param>
/// <returns> returns a new array containing the var values, otherwise a reference to the output array is returned.</returns>
/// <remarks>https://docs.scipy.org/doc/numpy/reference/generated/numpy.var.html</remarks>
public static NDArray var(in NDArray a, int axis, NPTypeCode type, bool keepdims = false, int? ddof = null)
=> a.TensorEngine.ReduceVar(a, axis, keepdims, ddof, type);
/// <summary>
/// Compute the variance along the specified axis.
/// Returns the variance of the array elements, a measure of the spread of a distribution.
/// The variance is computed for the flattened array by default, otherwise over the specified axis.
/// </summary>
/// <param name="a">Array containing numbers whose variance is desired. If a is not an array, a conversion is attempted.</param>
/// <param name="axis">Axis or axes along which the variance is computed. The default is to compute the variance of the flattened array.</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="ddof">Means Delta Degrees of Freedom. The divisor used in calculations is N - ddof, where N represents the number of elements. By default ddof is zero.</param>
/// <returns> returns a new array containing the var values, otherwise a reference to the output array is returned.</returns>
/// <remarks>https://docs.scipy.org/doc/numpy/reference/generated/numpy.var.html</remarks>
public static NDArray var(in NDArray a, int axis, bool keepdims, int? ddof = null)
=> a.TensorEngine.ReduceVar(a, axis, keepdims, ddof: ddof);
/// <summary>
/// Compute the variance along the specified axis.
/// Returns the variance of the array elements, a measure of the spread of a distribution.
/// The variance is computed for the flattened array by default, otherwise over the specified axis.
/// </summary>
/// <param name="a">Array containing numbers whose variance is desired. If a is not an array, a conversion is attempted.</param>
/// <param name="axis">Axis or axes along which the variance is computed. The default is to compute the variance of the flattened array.</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="ddof">Means Delta Degrees of Freedom. The divisor used in calculations is N - ddof, where N represents the number of elements. By default ddof is zero.</param>
/// <returns> returns a new array containing the var values, otherwise a reference to the output array is returned.</returns>
/// <remarks>https://docs.scipy.org/doc/numpy/reference/generated/numpy.var.html</remarks>
public static NDArray var(NDArray a, int axis, bool keepdims = false, int? ddof = null, NPTypeCode? dtype = null)
{
return a.TensorEngine.ReduceVar(a, axis, keepdims, ddof, dtype);
}
}
}