using System; using System.Runtime.InteropServices; using System.Diagnostics; namespace Math.Gmp.Native { /// /// Represents the state of a random number generator. /// /// public class gmp_randstate_t { private IntPtr _pointer; /// /// Creates a new random number generator state. /// /// /// /// When done with the random number generator state, unmanaged memory must be released with free. /// /// public gmp_randstate_t() { // Allocation sizes take into account the members alignment done by the C compiler. _pointer = gmp_lib.allocate(IntPtr.Size == 4 ? 20U : 32U).ToIntPtr(); } /// /// Get unmanaged memory pointer to the state of a random number generator. /// /// The unmanaged memory pointer to the state of a random number generator. public IntPtr ToIntPtr() { return _pointer; } } }