Ejemplo n.º 1
0
 public bool IsSolution(IEnumerable <double> x)
 {
     if (x.Count() != Coefficients.Count)
     {
         throw new ArgumentException("x must have the same length as coefficients.");
     }
     return(Coefficients.Zip(x, (a, var) => (a, var)).Sum(c => c.a * c.var) == B);
 }
Ejemplo n.º 2
0
 public T Subtract(T other)
 {
     return(New(Coefficients.Zip(other.Coefficients, (x, y) => (x - y).Mod(Bn128Curve.P))));
 }
Ejemplo n.º 3
0
 public T Add(T other)
 {
     return(New(Coefficients.Zip(other.Coefficients, (x, y) => (x + y).Mod(Bn128Curve.P))));
 }