Table of Contents

Class MMath

Namespace
LibGameAI.Util
Assembly
Util.dll

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 int

Integer 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)

Parameters

vector float[]

Vector to normalize, in-place.

min float

Minimum normalization range.

max float

Maximum normalization range.