I don't need to test my programs. I have an error-correcting modem.

UE3:MDB AF Float(UDK)

From Unreal Wiki, The Unreal Engine Documentation Site
Jump to: navigation, search
UDK MDB >> MDB_ArrayFunc >> MDB_AF_Float (custom)

Contents

Package: 
MDB_ArrayFunc


Script

//===================================================
//	Class: MDB_AF_Float
//	Creation Date: 27/08/2009 02:54
//	Last Updated: 06/04/2010 23:56
//	Contributors: 00zX
//---------------------------------------------------
//	Attribution-Noncommercial-Share Alike 3.0 Unported
//	http://creativecommons.org/licenses/by-nc-sa/3.0/
//	http://creativecommons.org/licenses/by-nc-sa/3.0/legalcode
//===================================================
class MDB_AF_Float extends MDB_ArrayFunc
	abstract;
 
`define DataType float 
`include(ArrayFunc.uci)
 
// Used to generate random values between Min and Max.
`RangeStruct()
 
// Key/Value Pair, Used to check for Duplicates within an Array.
`CheckArrayStruct()
 
// Key/Value Pair, used when sorting Arrays (depreciate?).
`SortedArrayStruct()
 
//
`PacketStruct()
 
//Scientific
 
// Complex Type/Structures, used when rounding to Type.MaximumValue isnt desired.
`ComplexStruct()
//`ComplexOperators()
 
//---------------------------------------------------
//Utility functions
 
/**
 * Creates an array filled with random variables.
 * @param	length		Number of elements to generate.
 * @return				A random array of generic Data.
 *
 * Macro Usage:			Array = `RandArray(DataType, Length);
*/
//static final function array<`DataType> RandArray(int length)
`RandArrayFunction()
 
////
// Sorting Functions
//TODO: Assign a Max.Length to dynamic arrays that can be passed to sort (1000000) recursion error
//		Currently for insertion sort its (1500 entries Max)
 
/**
 * Sorts an array by linear search/insertion into a new array.
 * @param	A			Array of elements (byte, int, float)
 * @return				New Sorted Array.
 *
 * Macro Usage:			Array = `SortArray(DataType, Array);
*/
//static final function array<`DataType> InsertionSort(array<`DataType> A)
`InsertionSortFunction()
 
/**
 * Sorts an array by 
 * @Input	A			Array of elements (byte, int, float)
 *
 * Macro Usage:			`CocktailSortArray(DataType, Array);
*/
//static final function CocktailSort(out array<`DataType> A)
`CocktailSortFunction()
 
/**
 * Sorts an array by 
 * @Input	A			Array of elements (byte, int, float)
 *
 * Macro Usage:			`SelectionSortArray(DataType, Array);
*/
//static final function SelectionSort(out array<`DataType> A)
`SelectionSortFunction()
 
 
////
// Shuffling Functions
 
/**
 * Shuffles an Array switching between 2 different shuffle algorithms,
 * performing them until the desired amount of shuffles has been reached.
 * @param	A			Shuffled Array of elements (byte, int, float)
*/
//static final function ReShuffle(out array<float> A, int length)
 
/**
 * Shuffles an Array 
 * @param	A			Shuffled Array of elements (byte, int, float)
*/
//static final function Shuffle(out array<`DataType> A)
 
/**
 * Shuffles an Array 
 * @param	A			Shuffled Array of elements (byte, int, float)
*/
//static final function ShuffleTwo(out array<`DataType> A)
 
`ShuffleFunctions()
 
/**
 * Sorts an array by linear search/insertion into a new array.
 * @param	A			Array of elements (Can be any DataType)
 * @param	B			Array of elements (Can be any DataType)
 * @return				Array with all A elements at the top and B elements at the bottom.
 *
 * Macro Usage:			Array = `MergeArray(DataType, InArrayA, InArrayB);
*/
//static final function array<`DataType> Merge(array<`DataType> A, array<`DataType> B, optional bool bCheckforDups)
`MergeArrayFunction()
 
/**
 * Sorts an array by linear search/insertion into a new array.
 * @param	A			Array of elements (Can be any DataType)
 * @param	atIdx		Index at which to split the array.
 * @input				Top Half of the Array.
 * @input				Bottom Half of the Array.
 *
 * Macro Usage:			`SplitArray(DataType, InArray, Idx, OutArrayOne, OutArrayTwo)
*/
//static final function SplitA(array<`DataType> A, int atIdx, out array<`DataType> oA, out array<`DataType> oB)
`SplitArrayFunction()
 
////
// Packet Functions
 
//static final function SplitToPak(array<`DataType> A, int PakSize, out array<Packet`DataType> pakA)
`SplitToPacketFunction()
 
//static final function int FindPakIdx(`DataType A, array<Packet`DataType> pakA)
//static final function bool HasInPak(`DataType A, Packet`DataType pak, out int idx)
`FindInPacketFunction()
 
////
//Statistical functions
 
/**
 * Finds the largest or smallest member of an array
 * @param	A		The array to search
 * @return			The value for the smallest or largest member
 *
 * Macro Usage:		`MinInArray(DataType, Array)
 *					`MaxInArray(DataType, Array)
*/
//static final function `DataType `{MinMax}InArray(array<`DataType> A, optional Range`DataType Limit)
`MinOrMaxInArray(Max , >)
`MinOrMaxInArray(Min , <)
 
/**
 * Finds the largest and smallest member of an array
 * @param	A		The array to search
 * @input			The values (as a `Range) for the smallest or largest members
 *
 * Macro Usage:		`MinMaxInArray(DataType, Array, Range(DataType))
*/
//static final function MinMaxInArray(array<`DataType> A,out Range`DataType R, optional Range`DataType Limit)
`MinAndMaxInArray()
 
/**
 * Finds the largest or smallest member of an array
 * if there is more than one of these, we choose the first
 * @param	A		The array to search
 * @return			The index for the smallest or largest member
 *
 * Macro Usage:		`MinIndexInArray(DataType, Array)
 *					`MaxIndexInArray(DataType, Array)
*/
//static final function int `{MinMax}IndexInArray(array<`DataType> A, optional Range`DataType Limit)
`define Index Index
`MinOrMaxInArray(Max , >)
`MinOrMaxInArray(Min , <)
 
/**
 * Finds the largest and smallest member of an array
 * @param	A		The array to search
 * @input			The index for the smallest or largest members
 *
 * Macro Usage:		`MinMaxInArray(DataType, Array)
*/
//static final function MinMaxIndexInArray(array<`DataType> A,out int ojA, out int ojB, optional Range`DataType Limit)
`MinAndMaxInArray()
`undefine(Index)
 
/**
 * Average: which is the Arithmetic Mean
 * @param	A		The array to search
 * @return			The Arithmetic Mean of all the members of the array
 *
 * Macro Usage:		`AvgArray(DataType, Array)
 *
 * and is calculated by adding a group of numbers and then dividing by the count of those numbers.
 * For example, the average of 2, 3, 3, 5, 7, and 10 is 30 divided by 6, which is 5.
*/
//static final function `DataType AvgArray(array<`DataType> A, optional Limits L)
`define Arithmetic Arithmetic
`MeanFunction()
`undefine(Arithmetic)
 
/**
 * Geometric Mean: Finds the magnitude of all values in the array
 * @param	A		The array to search
 * @return			The Geometric Mean of all the members of the array
 *
 * Macro Usage:		`GeoMeanArray(DataType, Array)
*/
//static final function `DataType GeoMeanArray(array<`DataType> A, optional Limits L)
`define Geometric Geometric
`MeanFunction()
`undefine(Geometric)
 
/**
 * Median: which is the middle number of a group of numbers
 * @param	A		The array to search
 * @return			The Median of all the members of the array
 *
 * Macro Usage:		`MedianArray(DataType, Array)
 *
 * that is, half the numbers have values that are greater than the median,
 * and half the numbers have values that are less than the median.
 * For example, the median of 2, 3, 3, 5, 7, and 10 is 4.
*/
//static final function `DataType MedianArray(array<`DataType> A, optional Range`DataType L)
`MedianFunction()