示例#1
0
 public static void EvaluatePoly(SieveRequest sievereq, SievingData sievedat)
 {
     sievedat.V = new BigInteger[sievereq.L];
     for (int i = 0; i < sievereq.L; i++)
     {
         sievedat.V[i] = sievereq.polyFunction(i + sievereq.AStart + StartIdx);
     }
 }
示例#2
0
 public static void CreateFormattedSievingResult(SieveRequest sievereq, SievingData sievedat, SieveResult sieveres)
 {
     sieveres.SourceRequest   = sievereq;
     sieveres.SmoothRelations = new List <BinaryVector>();
     sieveres.V = new List <BigInteger>();
     for (int i = 0; i < sievereq.L; i++)
     {
         //if number only consisted of primes that were sieved, then it is smooth
         if (sievedat.V[i] == 1)
         {
             sieveres.V.Add(sievereq.polyFunction(i + sievereq.AStart + StartIdx));
             sieveres.SmoothRelations.Add(sievedat.Coefficients[i]);
         }
     }
 }
 /// <summary>
 /// Generates data to be sieved from the given SieveRequest
 /// </summary>
 /// <param name="sievereq"></param>
 /// <param name="sievedat">The SieveData object to fill with data</param>
 public static void EvaluatePoly(SieveRequest sievereq, SievingData sievedat)
 {
     sievedat.V = new BigInteger[sievereq.L];
     for (int i = 0; i < sievereq.L; i++)
     {
         sievedat.V[i] = sievereq.polyFunction(i + sievereq.AStart + sievereq.StartIdx);
     }
 }
 /// <summary>
 /// Formats data in a SieveData object into a proper SieveResult
 /// </summary>
 /// <param name="sievereq"></param>
 /// <param name="sievedat">The data to be formatted</param>
 /// <param name="sieveres">The SieveResult object where the formatted data will be put</param>
 public static void CreateFormattedSievingResult(SieveRequest sievereq, SievingData sievedat, SieveResult sieveres)
 {
     sieveres.SourceRequest = sievereq;
     sieveres.SmoothRelations = new List<BinaryVector>();
     sieveres.V = new List<BigInteger>();
     for (int i = 0; i < sievereq.L; i++)
     {
         if (sievedat.V[i] == 1)
         {
             sieveres.V.Add(sievereq.polyFunction(i + sievereq.AStart + sievereq.StartIdx));
             sieveres.SmoothRelations.Add(sievedat.Coefficients[i]);
         }
     }
 }