Neuro-VISOR  0.2.0
Visualize and interact with computational simulations using a virtual reality interface
C2M2.Utils.Math Class Reference

Quick, static methods for finding max, min, and clamped scalar values and arrays More...

Static Public Member Functions

static int Min (int a, int b)
 
static float Min (float a, float b)
 
static double Min (double a, double b)
 
static int Max (int a, int b)
 
static float Max (float a, float b)
 
static double Max (double a, double b)
 
static float Max (this Vector3 a)
 
static float Min (this Vector3 a)
 
static int Clamp (int value, int min, int max)
 If value < min, returns min, If min <= value <= max, returns value, If value > max, returns max More...
 
static float Clamp (float value, float min, float max)
 If value < min, returns min, If min <= value <= max, returns value, If value > max, returns max More...
 
static double Clamp (double value, double min, double max)
 If value < min, returns min, If min <= value <= max, returns value, If value > max, returns max More...
 
static Vector3 Clamp (this Vector3 value, Vector3 min, Vector3 max)
 Clamp a Vector3 betwen a min and a max Vector3 More...
 
static int Max (this int[] array)
 
static float Max (this float[] array)
 
static double Max (this double[] array)
 
static int Max (this List< int > list)
 
static float Max (this List< float > list)
 
static double Max (this List< double > list)
 
static int Min (this int[] array)
 
static float Min (this float[] array)
 
static double Min (this double[] array)
 
static int Min (this List< int > list)
 
static float Min (this List< float > list)
 
static double Min (this List< double > list)
 
static float Avg (this int[] array)
 
static float Avg (this float[] array)
 
static double Avg (this double[] array)
 
static float Avg (this List< int > list)
 
static float Avg (this List< float > list)
 
static double Avg (this List< double > list)
 
static float StdDev (this int[] array)
 
static float StdDev (this float[] array)
 
static float StdDev (this double[] array)
 
static float StdDev (this List< int > list)
 
static float StdDev (this List< float > list)
 
static float StdDev (this List< double > list)
 
static int Sum (this int[] array)
 
static float Sum (this float[] array)
 
static double Sum (this double[] array)
 
static int Sum (this List< int > list)
 
static float Sum (this List< float > list)
 
static double Sum (this List< double > list)
 
static int[] Abs (this int[] array)
 
static float[] Abs (this float[] array)
 
static double[] Abs (this double[] array)
 
static List< int > Abs (this List< int > list)
 
static List< float > Abs (this List< float > list)
 
static List< double > Abs (this List< double > list)
 
static float[] Rescale (this float[] array, float newMin, float newMax, float oldMin, float oldMax)
 
static List< float > Rescale (this List< float > array, float newMin, float newMax, float oldMin, float oldMax)
 
static Vector3 Dot (this Vector3 a, Vector3 b)
 
static void CompareToLinq (int numTrials=1000, int arraySize=1000, bool testMin=true, bool testMax=true, bool testClamp=true, bool testArrMax=true, bool testArrMin=true, bool testArrAvg=true, bool testArrStdDev=true, bool testArrSum=true, bool testArrAbs=true, float maxTimeSeconds=30f)
 Run each function in this class and compare the performance to System.Linq's matching methods More...
 

Detailed Description

Quick, static methods for finding max, min, and clamped scalar values and arrays

Should vastly outperform System.Linq methods

Member Function Documentation

◆ Abs() [1/6]

static double [] C2M2.Utils.Math.Abs ( this double[]  array)
static

◆ Abs() [2/6]

static float [] C2M2.Utils.Math.Abs ( this float[]  array)
static

◆ Abs() [3/6]

static int [] C2M2.Utils.Math.Abs ( this int[]  array)
static

◆ Abs() [4/6]

static List<double> C2M2.Utils.Math.Abs ( this List< double >  list)
static

◆ Abs() [5/6]

static List<float> C2M2.Utils.Math.Abs ( this List< float >  list)
static

◆ Abs() [6/6]

static List<int> C2M2.Utils.Math.Abs ( this List< int >  list)
static

◆ Avg() [1/6]

static double C2M2.Utils.Math.Avg ( this double[]  array)
static

◆ Avg() [2/6]

static float C2M2.Utils.Math.Avg ( this float[]  array)
static

◆ Avg() [3/6]

static float C2M2.Utils.Math.Avg ( this int[]  array)
static

◆ Avg() [4/6]

static double C2M2.Utils.Math.Avg ( this List< double >  list)
static

◆ Avg() [5/6]

static float C2M2.Utils.Math.Avg ( this List< float >  list)
static

◆ Avg() [6/6]

static float C2M2.Utils.Math.Avg ( this List< int >  list)
static

◆ Clamp() [1/4]

static double C2M2.Utils.Math.Clamp ( double  value,
double  min,
double  max 
)
static

If value < min, returns min, If min <= value <= max, returns value, If value > max, returns max

◆ Clamp() [2/4]

static float C2M2.Utils.Math.Clamp ( float  value,
float  min,
float  max 
)
static

If value < min, returns min, If min <= value <= max, returns value, If value > max, returns max

◆ Clamp() [3/4]

static int C2M2.Utils.Math.Clamp ( int  value,
int  min,
int  max 
)
static

If value < min, returns min, If min <= value <= max, returns value, If value > max, returns max

◆ Clamp() [4/4]

static Vector3 C2M2.Utils.Math.Clamp ( this Vector3  value,
Vector3  min,
Vector3  max 
)
static

Clamp a Vector3 betwen a min and a max Vector3

◆ CompareToLinq()

static void C2M2.Utils.Math.CompareToLinq ( int  numTrials = 1000,
int  arraySize = 1000,
bool  testMin = true,
bool  testMax = true,
bool  testClamp = true,
bool  testArrMax = true,
bool  testArrMin = true,
bool  testArrAvg = true,
bool  testArrStdDev = true,
bool  testArrSum = true,
bool  testArrAbs = true,
float  maxTimeSeconds = 30f 
)
static

Run each function in this class and compare the performance to System.Linq's matching methods

◆ Dot()

static Vector3 C2M2.Utils.Math.Dot ( this Vector3  a,
Vector3  b 
)
static

◆ Max() [1/10]

static double C2M2.Utils.Math.Max ( double  a,
double  b 
)
static

◆ Max() [2/10]

static float C2M2.Utils.Math.Max ( float  a,
float  b 
)
static

◆ Max() [3/10]

static int C2M2.Utils.Math.Max ( int  a,
int  b 
)
static

◆ Max() [4/10]

static double C2M2.Utils.Math.Max ( this double[]  array)
static

◆ Max() [5/10]

static float C2M2.Utils.Math.Max ( this float[]  array)
static

◆ Max() [6/10]

static int C2M2.Utils.Math.Max ( this int[]  array)
static

◆ Max() [7/10]

static double C2M2.Utils.Math.Max ( this List< double >  list)
static

◆ Max() [8/10]

static float C2M2.Utils.Math.Max ( this List< float >  list)
static

◆ Max() [9/10]

static int C2M2.Utils.Math.Max ( this List< int >  list)
static

◆ Max() [10/10]

static float C2M2.Utils.Math.Max ( this Vector3  a)
static

◆ Min() [1/10]

static double C2M2.Utils.Math.Min ( double  a,
double  b 
)
static

◆ Min() [2/10]

static float C2M2.Utils.Math.Min ( float  a,
float  b 
)
static

◆ Min() [3/10]

static int C2M2.Utils.Math.Min ( int  a,
int  b 
)
static

◆ Min() [4/10]

static double C2M2.Utils.Math.Min ( this double[]  array)
static

◆ Min() [5/10]

static float C2M2.Utils.Math.Min ( this float[]  array)
static

◆ Min() [6/10]

static int C2M2.Utils.Math.Min ( this int[]  array)
static

◆ Min() [7/10]

static double C2M2.Utils.Math.Min ( this List< double >  list)
static

◆ Min() [8/10]

static float C2M2.Utils.Math.Min ( this List< float >  list)
static

◆ Min() [9/10]

static int C2M2.Utils.Math.Min ( this List< int >  list)
static

◆ Min() [10/10]

static float C2M2.Utils.Math.Min ( this Vector3  a)
static

◆ Rescale() [1/2]

static float [] C2M2.Utils.Math.Rescale ( this float[]  array,
float  newMin,
float  newMax,
float  oldMin,
float  oldMax 
)
static

◆ Rescale() [2/2]

static List<float> C2M2.Utils.Math.Rescale ( this List< float >  array,
float  newMin,
float  newMax,
float  oldMin,
float  oldMax 
)
static

◆ StdDev() [1/6]

static float C2M2.Utils.Math.StdDev ( this double[]  array)
static

◆ StdDev() [2/6]

static float C2M2.Utils.Math.StdDev ( this float[]  array)
static

◆ StdDev() [3/6]

static float C2M2.Utils.Math.StdDev ( this int[]  array)
static

◆ StdDev() [4/6]

static float C2M2.Utils.Math.StdDev ( this List< double >  list)
static

◆ StdDev() [5/6]

static float C2M2.Utils.Math.StdDev ( this List< float >  list)
static

◆ StdDev() [6/6]

static float C2M2.Utils.Math.StdDev ( this List< int >  list)
static

◆ Sum() [1/6]

static double C2M2.Utils.Math.Sum ( this double[]  array)
static

◆ Sum() [2/6]

static float C2M2.Utils.Math.Sum ( this float[]  array)
static

◆ Sum() [3/6]

static int C2M2.Utils.Math.Sum ( this int[]  array)
static

◆ Sum() [4/6]

static double C2M2.Utils.Math.Sum ( this List< double >  list)
static

◆ Sum() [5/6]

static float C2M2.Utils.Math.Sum ( this List< float >  list)
static

◆ Sum() [6/6]

static int C2M2.Utils.Math.Sum ( this List< int >  list)
static

The documentation for this class was generated from the following file: