NewGamePhysics.Mathematics.BitUnbiaser Class Reference

Class to facilitate unbiasing bitstreams represented by strings containing 0 and 1 characters. More...

List of all members.

Public Member Functions

 BitUnbiaser (BitUnbiasAlgorithm algorithm)
 Creates an unbiasing object.
string Process (string input)
 Unbias an bit stream using the currently set algorithm.

Detailed Description

Class to facilitate unbiasing bitstreams represented by strings containing 0 and 1 characters.

Definition at line 39 of file BitUnbiaser.cs.


Constructor & Destructor Documentation

NewGamePhysics.Mathematics.BitUnbiaser.BitUnbiaser ( BitUnbiasAlgorithm  algorithm  ) 

Creates an unbiasing object.

Parameters:
algorithm The bit unbiasing algorithm.

Definition at line 50 of file BitUnbiaser.cs.

00051         {
00052             this.algorithm = algorithm;
00053         }


Member Function Documentation

string NewGamePhysics.Mathematics.BitUnbiaser.Process ( string  input  ) 

Unbias an bit stream using the currently set algorithm.

Parameters:
input An input string consisting of 0 or 1 characters representing bits of minimum 2 bits in length.
Returns:
The unbiased bit string in 0/1 character representation

Definition at line 65 of file BitUnbiaser.cs.

00066         {
00067             if (string.IsNullOrEmpty(input))
00068             {
00069                 throw new ArgumentNullException("input", "input string cannot be null or empty");
00070             }
00071 
00072             if (input.Length < 2)
00073             {
00074                 throw new ArgumentException("input must consist of at least 2 characters", "input"); 
00075             }
00076 
00077             StringBuilder output = new StringBuilder(input.Length);
00078             Amls(input, ref output);
00079             return output.ToString();
00080         }


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

Generated by  doxygen 1.6.2