Beispiel #1
0
 /// <summary>
 /// See http://mpir.org/mpir-3.0.0.pdf.
 /// </summary>
 /// <param name="state">The state.</param>
 /// <param name="seed">The seed.</param>
 public static void randseed_ui(randstate_t state, ulong seed)
 {
     NativeMethods.mp_randseed_ui(ref state.Value, (NativeMethods.mpir_ui)seed);
 }
Beispiel #2
0
 /// <summary>
 /// See http://mpir.org/mpir-3.0.0.pdf.
 /// </summary>
 /// <param name="state">The state.</param>
 public static void randclear(randstate_t state)
 {
     NativeMethods.mp_randclear(ref state.Value);
 }
Beispiel #3
0
 /// <summary>
 /// See http://mpir.org/mpir-3.0.0.pdf.
 /// </summary>
 /// <param name="state">The state.</param>
 /// <param name="seed">The seed.</param>
 public static void randseed(randstate_t state, mpz_t seed)
 {
     NativeMethods.mp_randseed(ref state.Value, ref seed.Value);
 }
Beispiel #4
0
 /// <summary>
 /// See http://mpir.org/mpir-3.0.0.pdf.
 /// </summary>
 /// <param name="state">The state.</param>
 /// <param name="size">The size.</param>
 public static void randinit_lc_2exp_size(randstate_t state, ulong size)
 {
     NativeMethods.mp_randinit_lc_2exp_size(ref state.Value, (NativeMethods.mp_bitcnt_t)size);
 }
Beispiel #5
0
 /// <summary>
 /// See http://mpir.org/mpir-3.0.0.pdf.
 /// </summary>
 /// <param name="rop">The result operand.</param>
 /// <param name="op">The operand.</param>
 public static void randinit_set(randstate_t rop, randstate_t op)
 {
     NativeMethods.mp_randinit_set(ref rop.Value, ref op.Value);
 }
Beispiel #6
0
 /// <summary>
 /// See http://mpir.org/mpir-3.0.0.pdf.
 /// </summary>
 /// <param name="state">The state.</param>
 public static void randinit_mt(randstate_t state)
 {
     NativeMethods.mp_randinit_mt(ref state.Value);
 }
Beispiel #7
0
 /// <summary>
 /// See http://mpir.org/mpir-3.0.0.pdf.
 /// </summary>
 /// <param name="state">The state.</param>
 /// <param name="a">The value of a.</param>
 /// <param name="c">The value of c.</param>
 /// <param name="m2exp">The value of m2exp.</param>
 public static void randinit_lc_2exp(randstate_t state, mpz_t a, ulong c, ulong m2exp)
 {
     NativeMethods.mp_randinit_lc_2exp(ref state.Value, ref a.Value, (NativeMethods.mpir_ui)c, (NativeMethods.mp_bitcnt_t)m2exp);
 }
Beispiel #8
0
 /// <summary>
 /// See http://mpir.org/mpir-3.0.0.pdf.
 /// </summary>
 /// <param name="state">The state.</param>
 /// <param name="n">The n.</param>
 public static ulong urandomm_ui(randstate_t state, ulong n)
 {
     return((ulong)NativeMethods.mp_urandomm_ui(ref state.Value, (NativeMethods.mpir_ui)n));
 }
Beispiel #9
0
 /// <summary>
 /// See http://mpir.org/mpir-3.0.0.pdf.
 /// </summary>
 /// <param name="state">The state.</param>
 /// <param name="m2exp">The m2exp.</param>
 public static ulong urandomb_ui(randstate_t state, ulong m2exp)
 {
     return((ulong)NativeMethods.mp_urandomb_ui(ref state.Value, (NativeMethods.mpir_ui)m2exp));
 }
Beispiel #10
0
 /// <summary>
 /// See http://mpir.org/mpir-3.0.0.pdf.
 /// </summary>
 /// <param name="rop">The result operand.</param>
 /// <param name="state">The state.</param>
 /// <param name="max_size">The max size.</param>
 /// <param name="exp">The exponent.</param>
 public static void rrandomb(mpf_t rop, randstate_t state, ulong max_size, int exp)
 {
     NativeMethods.mpf_rrandomb(ref rop.Value, ref state.Value, (NativeMethods.size_t)max_size, (NativeMethods.mp_exp_t)exp);
 }
Beispiel #11
0
 /// <summary>
 /// See http://mpir.org/mpir-3.0.0.pdf.
 /// </summary>
 /// <param name="rop">The result operand.</param>
 /// <param name="state">The state.</param>
 /// <param name="nbits">The count of bits.</param>
 public static void urandomb(mpf_t rop, randstate_t state, ulong nbits)
 {
     NativeMethods.mpf_urandomb(ref rop.Value, ref state.Value, (NativeMethods.mp_bitcnt_t)nbits);
 }
Beispiel #12
0
 /// <summary>
 /// Initializes a new instance of the <see cref="randstate_t"/> class.
 /// </summary>
 /// <param name="other">The other object.</param>
 public randstate_t(randstate_t other)
 {
     mp_randinit_set(ref Value, ref other.Value);
 }