Repository navigation
Module_Statistics_ExtremeValueFinder
Location: Home / Statistics module / Extreme value finder
Vorcyc.Mathematics.Statistics.ExtremeValueFinder is a class that provides methods for finding the maximum and minimum values in a sequence. The class uses optimized algorithms to obtain both the maximum and minimum in a single pass.
All methods below are located in class: Vorcyc.Mathematics.Statistics.ExtremeValueFinder
📒Contents
Vorcyc.Mathematics.Statistics.ExtremeValueFinder is a class that provides methods for finding the maximum and minimum values in a sequence.
Finds the maximum and minimum values in a sequence.
-
public static (float max, float min) FindExtremeValue(this float[] array, int start, int length)- Finds the maximum and minimum values in the specified range of a float array.
- Parameters:
-
array: The float array. -
start: The starting index of the range. -
length: The length of the range.
-
- Returns: A tuple containing the maximum and minimum values in the specified range.
-
public static (T max, T min) FindExtremeValue<T>(this T[] array, int start, int length) where T : INumber<T>- Finds the maximum and minimum values in the specified range of an array.
- Parameters:
-
array: The array. -
start: The starting index of the range. -
length: The length of the range.
-
- Returns: A tuple containing the maximum and minimum values in the specified range.
-
public static (float max, float min) FindExtremeValue(this float[] array)- Finds the maximum and minimum values in a float array.
- Parameters:
-
array: The float array.
-
- Returns: A tuple containing the maximum and minimum values in the array.
-
public static (T max, T min) FindExtremeValue<T>(this T[] array) where T : INumber<T>- Finds the maximum and minimum values in an array.
- Parameters:
-
array: The array.
-
- Returns: A tuple containing the maximum and minimum values in the array.
-
public static (float max, float min) FindExtremeValue(this ArraySegment<float> arraySegment)- Finds the maximum and minimum values in a float array segment.
- Parameters:
-
arraySegment: The float array segment.
-
- Returns: A tuple containing the maximum and minimum values in the array segment.
-
public static (T max, T min) FindExtremeValue<T>(this ArraySegment<T> arraySegment) where T : INumber<T>- Finds the maximum and minimum values in an array segment.
- Parameters:
-
arraySegment: The array segment.
-
- Returns: A tuple containing the maximum and minimum values in the array segment.
-
public static (float max, float min) FindExtremeValue(this Span<float> span)- Finds the maximum and minimum values in a float
Span. - Parameters:
-
span: The floatSpan.
-
- Returns: A tuple containing the maximum and minimum values in the
Span.
- Finds the maximum and minimum values in a float
The following example uses several methods from the ExtremeValueFinder class, with comments in the sample:
using System;
using Vorcyc.Mathematics.Statistics;
public class ExtremeValueFinderExample
{
public static void Main()
{
// Define a float array
float[] floatArray = { 1.0f, 2.0f, 3.0f, 4.0f, 5.0f };
// Find maximum and minimum in the array
var (maxFloat, minFloat) = floatArray.FindExtremeValue();
Console.WriteLine($"Max value in float array: {maxFloat}, Min value in float array: {minFloat}");
// Find maximum and minimum in a specified range of the array
var (maxFloatRange, minFloatRange) = floatArray.FindExtremeValue(1, 3);
Console.WriteLine($"Max value in float array range: {maxFloatRange}, Min value in float array range: {minFloatRange}");
// Define an integer array
int[] intArray = { 1, 2, 3, 4, 5 };
// Find maximum and minimum in the array
var (maxInt, minInt) = intArray.FindExtremeValue();
Console.WriteLine($"Max value in int array: {maxInt}, Min value in int array: {minInt}");
// Find maximum and minimum in a specified range of the array
var (maxIntRange, minIntRange) = intArray.FindExtremeValue(1, 3);
Console.WriteLine($"Max value in int array range: {maxIntRange}, Min value in int array range: {minIntRange}");
// Define a float array segment
ArraySegment<float> floatSegment = new ArraySegment<float>(floatArray, 1, 3);
// Find maximum and minimum in the array segment
var (maxFloatSegment, minFloatSegment) = floatSegment.FindExtremeValue();
Console.WriteLine($"Max value in float array segment: {maxFloatSegment}, Min value in float array segment: {minFloatSegment}");
// Define an integer array segment
ArraySegment<int> intSegment = new ArraySegment<int>(intArray, 1, 3);
// Find maximum and minimum in the array segment
var (maxIntSegment, minIntSegment) = intSegment.FindExtremeValue();
Console.WriteLine($"Max value in int array segment: {maxIntSegment}, Min value in int array segment: {minIntSegment}");
// Define a float Span
Span<float> floatSpan = new Span<float>(floatArray);
// Find maximum and minimum in the Span
var (maxFloatSpan, minFloatSpan) = floatSpan.FindExtremeValue();
Console.WriteLine($"Max value in float span: {maxFloatSpan}, Min value in float span: {minFloatSpan}");
}
}-
- 🔖 ArrayExtension class
- 🔖 BaseConverter class
- 🔖 BitMathExtension class
- 🔖 Combinatorics class
- 🔖 ConstantsFp32 class
- 🔖 NumberMapper class
- 🔖 PinnableArray<T> class
- 🔖 SimpleRNG_Fp32 and SimpleRNG_Fp64 classes
- 🔖 TrigonometryHelper class
- 🔖 VMath class
- 🔖 Pinned buffers (Buffers)
- 🔖 IPinnedBuffer<T> interface
- 🔖 POHBuffer<T> class
- 🔖 NativeBuffer<T> class
-
- 🔖 0.9 classifier walkthrough
- 🔖 KNN<T> class
- 🔖 MultipleLinearRegression<T> class
- 🔖 SimpleLinearRegression<T> class
- 🔖 SupportVectorMachine<TSelf> class
- 🔖 DBSCAN<T> class
- 🔖 ExpectationMaximization<T> class
- 🔖 GMM<T> class
- 🔖 HierarchicalClustering<T> class
- 🔖 KMeansClusterer<T> class
- 🔖 VectorQuantization<T> class
- 🔖 FactorAnalysis<T> class
- 🔖 PCA<TSelf> class
- 🔖 TSNE<T> class
- 🔖 Distance metric classes
-
📒 Examples
-
📒 GPU 策略说明
- 🔖 为何放弃主包 GPU
- 🔖 当前性能路径
- 🔖 若仍需要更强算力
-
📒 计算上下文模块
-
📒 核心模块
-
📒 深度学习模块
-
📒 线性代数模块
-
📒 机器学习模块
- 🔖 0.9 分类器完整示例
- 🔖 KNN<T> 类
- 🔖 MultipleLinearRegression<T> 类
- 🔖 SimpleLinearRegression<T> 类
- 🔖 SupportVectorMachine<TSelf> 类
- 🔖 DBSCAN<T> 类
- 🔖 ExpectationMaximization<T> 类
- 🔖 GMM<T> 类
- 🔖 HierarchicalClustering<T> 类
- 🔖 KMeansClusterer<T> 类
- 🔖 VectorQuantization<T> 类
- 🔖 FactorAnalysis<T> 类
- 🔖 PCA<TSelf> 类
- 🔖 TSNE<T> 类
- 🔖 距离度量类
-
📒 信号处理模块
-
📒 数值模块
-
📒 统计模块
- 🔖 基础统计函数
- 🔖 高级统计函数
- 🔖 稳健统计 / RunningMoments
- 🔖 其它统计函数
- 🔖 分布相关函数
- 🔖 时间序列分析
- 🔖 IComparable 扩展
- 🔖 ExtremeValueFinder
- 🔖 INumber 扩展
-
📒 FFTW 扩展
-
📒 示例