Class to facilitate unbiasing bitstreams represented by strings containing 0 and 1 characters. More...
Public Member Functions | |
| BitUnbiaser (BitUnbiasAlgorithm algorithm) | |
| Creates an unbiasing object. | |
| string | Process (string input) |
| Unbias an bit stream using the currently set algorithm. | |
Class to facilitate unbiasing bitstreams represented by strings containing 0 and 1 characters.
Definition at line 39 of file BitUnbiaser.cs.
| NewGamePhysics.Mathematics.BitUnbiaser.BitUnbiaser | ( | BitUnbiasAlgorithm | algorithm | ) |
Creates an unbiasing object.
| algorithm | The bit unbiasing algorithm. |
Definition at line 50 of file BitUnbiaser.cs.
| string NewGamePhysics.Mathematics.BitUnbiaser.Process | ( | string | input | ) |
Unbias an bit stream using the currently set algorithm.
| input | An input string consisting of 0 or 1 characters representing bits of minimum 2 bits in length. |
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 }
1.6.2