libkissinferencesharp 1.0.x
Kiss.Utils Class Reference

This class is a collection of static methods usefull for use with kissinference. More...

Static Public Member Functions

static float[] CreateRange (float start, float end, int size, bool log)
 Converts an array containing a linear or log range.
 
static float Grad (float[] data, float[] omegas, int index)
 Approximates the the derivative of an array at the given index.
 
static float Median (float[] data)
 Calculates the median of the values given.
 
static bool FloatEq (float a, float b, uint ulp)
 Checks the given floats for equality with a tollerance of ulp epsilons around the sum of the inputs.
 
static string CheckEnv ()
 Checks the envirment to see if this libary can work correctly.
 
static void CheckEnvThrow ()
 Checks the envirment to see if this libary can work correctly and throws a EnviromentException if its not.
 

Detailed Description

This class is a collection of static methods usefull for use with kissinference.

Member Function Documentation

◆ CheckEnv()

static string Kiss.Utils.CheckEnv ( )
inlinestatic

Checks the envirment to see if this libary can work correctly.

Returns
string.Empty if the environment is acceptable and an error message if it is not.

References Kiss.VersionFixed.GetVersionNoCheck().

Referenced by Kiss.Utils.CheckEnvThrow().

◆ CheckEnvThrow()

static void Kiss.Utils.CheckEnvThrow ( )
inlinestatic

Checks the envirment to see if this libary can work correctly and throws a EnviromentException if its not.

Exceptions
Kiss.EnviromentExceptionThown if the environment is unacceptable.

References Kiss.Utils.CheckEnv().

Referenced by Kiss.Utils.CreateRange(), Kiss.Utils.FloatEq(), Kiss.VersionFixed.GetVersion(), Kiss.Utils.Grad(), Kiss.Utils.Median(), Kiss.Network.Network(), and Kiss.Spectra.Spectra().

◆ CreateRange()

static float[] Kiss.Utils.CreateRange ( float start,
float end,
int size,
bool log )
inlinestatic

Converts an array containing a linear or log range.

Parameters
startThe startig value of the range.
endThe ending value of the range.
sizeThe number of elements in the range.
logIf this is set to true the elements in the range are spaced in log10 fashion, otherwise linear spaceing is used.
Returns
An array containing the requested range

References Kiss.Utils.CheckEnvThrow().

◆ FloatEq()

static bool Kiss.Utils.FloatEq ( float a,
float b,
uint ulp )
inlinestatic

Checks the given floats for equality with a tollerance of ulp epsilons around the sum of the inputs.

Parameters
aThe first paramter for the comperasin
bb The second input to be compared with the first.
ulplp number of epsilons of tollerance..
Returns
True if the value of b is within ulp epsilons of a, false otherwise.

References Kiss.Utils.CheckEnvThrow().

◆ Grad()

static float Kiss.Utils.Grad ( float[] data,
float[] omegas,
int index )
inlinestatic

Approximates the the derivative of an array at the given index.

Parameters
dataThe array, or y values, to approximate the derivative on
omegasThe omega, or x values to approximate the derivative on
indexThe index at which to aproxmiate the gradiant at.
Returns
The aproxmiate derivative.

References Kiss.Utils.CheckEnvThrow().

◆ Median()

static float Kiss.Utils.Median ( float[] data)
inlinestatic

Calculates the median of the values given.

Parameters
inputThe input array.
Returns
The median value

References Kiss.Utils.CheckEnvThrow().