@@ -6187,80 +6187,6 @@ public NDarray ediff1d(NDarray to_end = null, NDarray to_begin = null)
61876187 return ToCsharp<NDarray>(py);
61886188 }
61896189
6190- /// <summary>
6191- /// Return the gradient of an N-dimensional array.<br></br>
6192- ///
6193- /// The gradient is computed using second order accurate central differences
6194- /// in the interior points and either first or second order accurate one-sides
6195- /// (forward or backwards) differences at the boundaries.<br></br>
6196- ///
6197- /// The returned gradient hence has the same shape as the input array.<br></br>
6198- ///
6199- /// Notes
6200- ///
6201- /// Assuming that (i.e., has at least 3 continuous
6202- /// derivatives) and let be a non-homogeneous stepsize, we
6203- /// minimize the “consistency error” between the true gradient
6204- /// and its estimate from a linear combination of the neighboring grid-points:
6205- ///
6206- /// By substituting and
6207- /// with their Taylor series expansion, this translates into solving
6208- /// the following the linear system:
6209- ///
6210- /// The resulting approximation of is the following:
6211- ///
6212- /// It is worth noting that if
6213- /// (i.e., data are evenly spaced)
6214- /// we find the standard second order approximation:
6215- ///
6216- /// With a similar procedure the forward/backward approximations used for
6217- /// boundaries can be derived.<br></br>
6218- ///
6219- /// References
6220- /// </summary>
6221- /// <param name="varargs">
6222- /// Spacing between f values.<br></br>
6223- /// Default unitary spacing for all dimensions.<br></br>
6224- ///
6225- /// Spacing can be specified using:
6226- ///
6227- /// If axis is given, the number of varargs must equal the number of axes.<br></br>
6228- ///
6229- /// Default: 1.
6230- /// </param>
6231- /// <param name="edge_order">
6232- /// Gradient is calculated using N-th order accurate differences
6233- /// at the boundaries.<br></br>
6234- /// Default: 1.
6235- /// </param>
6236- /// <param name="axis">
6237- /// Gradient is calculated only along the given axis or axes
6238- /// The default (axis = None) is to calculate the gradient for all the axes
6239- /// of the input array.<br></br>
6240- /// axis may be negative, in which case it counts from
6241- /// the last to the first axis.
6242- /// </param>
6243- /// <returns>
6244- /// A set of ndarrays (or a single ndarray if there is only one dimension)
6245- /// corresponding to the derivatives of f with respect to each dimension.<br></br>
6246- ///
6247- /// Each derivative has the same shape as f.
6248- /// </returns>
6249- public NDarray gradient(NDarray varargs = null, int? edge_order = null, Axis axis = null)
6250- {
6251- //auto-generated code, do not change
6252- var __self__=self;
6253- var pyargs=ToTuple(new object[]
6254- {
6255- varargs,
6256- });
6257- var kwargs=new PyDict();
6258- if (edge_order!=null) kwargs["edge_order"]=ToPython(edge_order);
6259- if (axis!=null) kwargs["axis"]=ToPython(axis);
6260- dynamic py = __self__.InvokeMethod("gradient", pyargs, kwargs);
6261- return ToCsharp<NDarray>(py);
6262- }
6263-
62646190 /// <summary>
62656191 /// Return the cross product of two (arrays of) vectors.<br></br>
62666192 ///
0 commit comments