Skip to content

Commit

Permalink
Updated the polynomial struct to uppercase to remove the build warning
Browse files Browse the repository at this point in the history
  • Loading branch information
lmalenfant committed Sep 14, 2024
1 parent 60a6054 commit f5c2396
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions src/Vts/MonteCarlo/Rng/DynamicCreatorMersenneTwister.cs
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ public struct mt_struct {
/// </summary>
public uint[] state; // if null then struct is mull
}
struct polynomial
struct Polynomial
{
public int[] x;
public int deg;
Expand All @@ -279,7 +279,7 @@ struct prescr_t
{
public int sizeOfA; // paramter size
public uint[][] modlist; // size[_nirredpoly][pre.sizeOfA]
public polynomial[] preModPolys; // size[pre.sizeOfA+1]
public Polynomial[] preModPolys; // size[pre.sizeOfA+1]
}

struct eqdeg_t
Expand Down Expand Up @@ -601,9 +601,9 @@ private int prescreening_dc(prescr_t pre, uint aaa)
}
private void init_prescreening_dc(ref prescr_t pre, int m, int n, int r, int w)
{
polynomial pl;
Polynomial pl;
pre.sizeOfA = w;
pre.preModPolys = new polynomial[pre.sizeOfA + 1];
pre.preModPolys = new Polynomial[pre.sizeOfA + 1];
make_pre_mod_polys(ref pre, m, n, r, w);
pre.modlist = new uint[_nirredpoly][];
for (int i = 0; i < _nirredpoly; i++)
Expand All @@ -619,7 +619,7 @@ private void init_prescreening_dc(ref prescr_t pre, int m, int n, int r, int w)
}
//was in original code: for loop (i eq 0 until i lt pre.sizeOfA) then free poly -> don't need this
}
private void next_irred_poly(ref polynomial pl, int nth)
private void next_irred_poly(ref Polynomial pl, int nth)
{
int i, max_deg;
for (max_deg = 0, i = 0; i <= _max_irred_deg; i++)
Expand All @@ -632,9 +632,9 @@ private void next_irred_poly(ref polynomial pl, int nth)
}
pl.deg = max_deg;
}
private void make_modlist(ref prescr_t pre, polynomial pl, int nPoly)
private void make_modlist(ref prescr_t pre, Polynomial pl, int nPoly)
{
polynomial tmpPl;
Polynomial tmpPl;
int i;
for (i = 0; i <= pre.sizeOfA; i++)
{
Expand All @@ -648,7 +648,7 @@ private void make_modlist(ref prescr_t pre, polynomial pl, int nPoly)
/// </summary>
/// <param name="wara">first polynomial</param>
/// <param name="waru">second polynomial</param>
private void polynomial_mod(ref polynomial wara, polynomial waru) // waru is "const" in C code
private void polynomial_mod(ref Polynomial wara, Polynomial waru) // waru is "const" in C code
{
int deg_diff, i;
while (wara.deg >= waru.deg)
Expand All @@ -668,7 +668,7 @@ private void polynomial_mod(ref polynomial wara, polynomial waru) // waru is "co
wara.deg = i;
}
}
private uint word2bit(polynomial pl)
private uint word2bit(Polynomial pl)
{
uint bx = 0;
for (int i = pl.deg; i > 0; i--)
Expand Down Expand Up @@ -719,7 +719,7 @@ private int is_reducible(prescr_t pre, uint aaa, uint[] polylist)
/// <param name="ww"></param>
private void make_pre_mod_polys(ref prescr_t pre, int mm, int nn, int rr, int ww)
{
polynomial t, t0, s, s0; // orig code had t1 and s1 in this list
Polynomial t, t0, s, s0; // orig code had t1 and s1 in this list
int i;
int j = 0;
t = new_poly(0);
Expand Down Expand Up @@ -758,18 +758,18 @@ private void make_pre_mod_polys(ref prescr_t pre, int mm, int nn, int rr, int ww
/// </summary>
/// <param name="pl">polynomial to be duplicated</param>
/// <returns>polynomial class</returns>
private polynomial polynomial_dup(polynomial pl)
private Polynomial polynomial_dup(Polynomial pl)
{
polynomial pt = new_poly(pl.deg);
Polynomial pt = new_poly(pl.deg);
for (int i = pl.deg; i >= 0; i--)
{
pt.x[i] = pl.x[i];
}
return pt;
}
private polynomial polynomial_mult(polynomial p0, polynomial p1)
private Polynomial polynomial_mult(Polynomial p0, Polynomial p1)
{
polynomial p;
Polynomial p;
if ((p0.deg < 0) || (p1.deg < 0))
{
p = new_poly(-1);
Expand All @@ -788,9 +788,9 @@ private polynomial polynomial_mult(polynomial p0, polynomial p1)
}
return p;
}
private polynomial make_tntm(int n, int m)
private Polynomial make_tntm(int n, int m)
{
polynomial p = new_poly(n);
Polynomial p = new_poly(n);
p.x[m] = 1;
p.x[n] = p.x[m];
return p;
Expand All @@ -802,9 +802,9 @@ private polynomial make_tntm(int n, int m)
/// </summary>
/// <param name="degree">degree of polynomial created</param>
/// <returns>polynomial class</returns>
private polynomial new_poly(int degree)
private Polynomial new_poly(int degree)
{
polynomial p = new polynomial();
Polynomial p = new Polynomial();
p.deg = degree;
if (degree < 0)
{
Expand Down

0 comments on commit f5c2396

Please sign in to comment.