Class MMath
Useful math functions.
public static class MMath
- Inheritance
-
MMath
- Inherited Members
Methods
CumSum(float[])
Return cumulative sum of given vector.
public static float[] CumSum(float[] vector)
Parameters
vector
float[]
Returns
- float[]
A new vector with the cumulative sum of the input vector.
IsPrime(int)
Check whether an integer is prime or not.
public static bool IsPrime(int n)
Parameters
n
intInteger to check for primality.
Returns
- bool
True if integer is prime, false otherwise.
Remarks
Basic implementation as described in Wikipedia.
Normalize(float[], float, float)
Normalize a vector between the specified limits.
public static void Normalize(float[] vector, float min, float max)