/// <summary> /// Calculates the product of the elements along the specified axis. /// </summary> /// <param name="axis">The axis to calculate the product along.</param> /// <param name="source">The NdArray containing the source values.</param> /// <returns>A new NdArray containing the result of this operation.</returns> public static NdArray <T> ProductAxis(int axis, NdArray <T> source) { var(result, src) = NdArray <T> .PrepareAxisReduceTarget <T, T>(axis, source); var(src1, _) = NdArray <T> .PrepareAxisReduceSources(result, axis, source, null); result.Backend.ProductLastAxis(result, src1); return(result); }
public static void FillMinAxis(NdArray <T> target, int axis, NdArray <T> source) { var(preparedSource, _) = NdArray <T> .PrepareAxisReduceSources(target, axis, source, null); target.Backend.MinLastAxis(target, preparedSource); }
public static void FillCountTrueAxis(NdArray <int> target, int axis, NdArray <bool> source) { var(preparedSource, _) = NdArray <int> .PrepareAxisReduceSources(target, axis, source, null); target.Backend.CountTrueLastAxis(target, preparedSource); }
/// <summary> /// Finds the first occurence of the specfied value along the specified axis and write its index into the target NdArray. /// </summary> /// <param name="target">A target NdArray containing the result of this operation.</param> /// <param name="value">The value to find.</param> /// <param name="axis">The axis to find the value along.</param> /// <param name="source">The NdArray containing the source values.</param> public static void FillFindAxis(NdArray <int> target, T value, int axis, NdArray <T> source) { var(preparedSource, _) = NdArray <T> .PrepareAxisReduceSources(target, axis, source, null); target.Backend.FindLastAxis(value, target, preparedSource); }