All Classes Functions Friends
dmpolynomial.h
1 #ifndef _MMPolynomial_H_
2 #define _MMPolynomial_H_
3 
4 /**
5  * Data Structure for multivariate modulo polynomial
6  * stored in a distributed dense case
7  **/
8 
9 #include "../polynomial.h"
10 
11 template <class Field>
12 inline void coef_add_mod(Field* c, Field a, Field b, Field p) {
13  *c = (a + b) % p;
14 }
15 template <class Field>
16 inline void coef_sub_mod(Field* c, Field a, Field b, Field p) {
17  *c = (a - b) % p;
18  if (*c < 0) { *c += p; }
19 }
20 template <class Field>
21 inline void coef_neg_mod(Field* c, Field a, Field p) {
22  *c = p - a;
23 }
24 template <class Field>
25 inline void coef_mul_mod(Field* c, Field a, Field b, Field p) {
26  *c = (a * b) % p;
27 }
28 
29 template <class Field>
31  private:
32  std::string* names; // Variable names
33  int var; // Number of variables
34  int n; // Number of terms
35  Field* coefs; // Coefficients in Prime field
36  int* degs; // Partial size
37  Field p; // Prime
38 
39 
40  int* acc;
41 
42  inline void zeros() {
43  for (int i = 0; i < n; ++i)
44  coefs[i] = 0;
45  }
46 
47  inline bool isSameRing(DistributedDenseMultivariateModularPolynomial& b) {
48  if (var != b.var || names[0] != b.names[0])
49  return 0;
50  if (names[0] == "9") {
51  for (int i = 1; i <= var; ++i) {
52  if (names[i] != b.names[i])
53  return 0;
54  }
55  }
56  return 1;
57  }
58 
59  public:
60  static int characteristic;
61  static bool isPrimeField;
62  static bool isComplexField;
63  /**
64  * Constructor using a default field
65  **/
67  coefs = new Field[1];
68  coefs[0] = 0;
69  degs = new int[1];
70  degs[0] = 0;
71  acc = new int[1];
72  acc[0] = 1;
73  names = new std::string[1];
74  names[0] = "1";
75  }
76  /**
77  * Constructor with the Field
78  *
79  * @param m: The prime
80  **/
81  DistributedDenseMultivariateModularPolynomial (Field m) : var(0), n(0), p(m) {
82  coefs = new Field[1];
83  coefs[0] = 0;
84  degs = new int[1];
85  degs[0] = 0;
86  acc = new int[1];
87  acc[0] = 1;
88  names = new std::string[1];
89  names[0] = "1";
90  }
91  /**
92  * Constructor with number of variables and terms
93  *
94  * @param v: Number of variables
95  * @param ds: Partial degrees
96  * @param m: The prime
97  **/
98  DistributedDenseMultivariateModularPolynomial(int v, int* ds, Field m) : var(v), p(m) {
99  degs = new int[var];
100  acc = new int[var];
101  acc[0] = 1;
102  for (int i = 0; i < var; ++i) {
103  degs[i] = ds[i];
104  if (i < var - 1)
105  acc[i+1] = acc[i] * (degs[i] + 1);
106  }
107  n = acc[var-1] * (degs[var-1] + 1);
108  coefs = new Field[n];
109  zeros();
110  //coefs[0] = 0;
111  names = new std::string[var+1];
112  names[0] = "1";
113  for (int i = 1; i <= var; ++i) {
114  std::ostringstream convert;
115  convert << var - i + 1;
116  names[i] = "_";
117  names[i] += convert.str();
118  }
119  }
120  /**
121  * Construct with a variable name
122  * such that f(x) = x;
123  *
124  * @param x: The variable name
125  * @param m: The prime
126  **/
127  DistributedDenseMultivariateModularPolynomial (std::string x, Field m) : var(1), n(2), p(m) {
128  names = new std::string[2];
129  names[0] = "9";
130  names[1] = x;
131  degs = new int[1];
132  degs[0] = 1;
133  acc = new int[1];
134  acc[0] = 1;
135  coefs = new Field[2];
136  coefs[0] = 0;
137  coefs[1] = 1;
138  }
139  /**
140  * Copy constructor
141  *
142  * @param b: A multivariate modular polynomial
143  **/
145  degs = new int[var];
146  std::copy(b.degs, b.degs+var, degs);
147  acc = new int[var];
148  std::copy(b.acc, b.acc+var, acc);
149  coefs = new Field[n];
150  std::copy(b.coefs, b.coefs+n, coefs);
151  names = new std::string[var+1];
152  std::copy(b.names, b.names+var+1, names);
153  }
154  /**
155  * Deconstructor
156  *
157  * @param
158  **/
160  delete [] coefs;
161  delete [] degs;
162  delete [] names;
163  delete [] acc;
164  }
165  /**
166  * Overload operator =
167  *
168  * @param b: A multivariate modular polynomial
169  **/
171  if (this != &b) {
172  delete [] coefs;
173  delete [] degs;
174  delete [] names;
175  delete [] acc;
176 
177  var = b.var;
178  degs = new int[var];
179  std::copy(b.degs, b.degs+var, degs);
180  acc = new int[var];
181  std::copy(b.acc, b.acc+var, acc);
182  n = b.n;
183  coefs = new Field[n];
184  std::copy(b.coefs, b.coefs+n, coefs);
185  names = new std::string[var+1];
186  std::copy(b.names, b.names+var+1, names);
187  p = b.p;
188  }
189  return *this;
190  }
191  /**
192  * Is a zero polynomial
193  *
194  * @param
195  **/
196  inline bool isZero() {
197  for (int i = 0; i < n; ++i) {
198  if (coefs[i] != 0)
199  return 0;
200  }
201  return 1;
202  }
203  /**
204  * Zero polynomial
205  *
206  * @param
207  **/
208  inline void zero() {
209  zeros();
210  }
211  /**
212  * Is polynomial 1
213  *
214  * @param
215  **/
216  inline bool isOne() {
217  for (int i = 1; i < n; ++i) {
218  if (coefs[i] != 0)
219  return 0;
220  }
221  return (coefs[0] == 1);
222  }
223  /**
224  * Set polynomial to 1
225  *
226  * @param
227  **/
228  inline void one() {
229  coefs[0] = 1;
230  for (int i = 1; i < n; ++i)
231  coefs[i] = 0;
232  }
233  /**
234  * Is polynomial -1
235  *
236  * @param
237  **/
238  inline bool isNegativeOne() {
239  for (int i = 1; i < n; ++i) {
240  if (coefs[i] != 0)
241  return 0;
242  }
243  return (coefs[0] == p - 1);
244  }
245  /**
246  * Set polynomial to -1
247  *
248  * @param
249  **/
250  inline void negativeOne() {
251  coefs[0] = p - 1;
252  for (int i = 1; i < n; ++i)
253  coefs[i] = 0;
254  }
255  /**
256  * Is a constant
257  *
258  * @param
259  **/
260  inline int isConstant() {
261  for (int i = 1; i < n; ++i) {
262  if (coefs[i] != 0)
263  return 0;
264  }
265  if (coefs[0] < (p >> 1)) { return 1; }
266  else { return -1; }
267  }
268  /**
269  * Get the number of variables
270  *
271  * @param
272  **/
273  inline int numberOfVariables() {
274  return var;
275  }
276  /**
277  * Get the number of non-zero terms
278  *
279  * @param
280  **/
281  inline int numberOfTerms() {
282  int k = 0;
283  for (int i = 0; i < n; ++i)
284  if (coefs[i] != 0) { k++; }
285  return k;
286  }
287  /**
288  * Get the size of the polynomial
289  *
290  * @param
291  **/
292  inline int size() {
293  return n;
294  }
295  /**
296  * Get a partial degree of variable x
297  *
298  * @param x: The variable name
299  **/
300  inline int degree(std::string x) {
301  int k = 0, d = 0;
302  for (int i = 1; i <= var; ++i) {
303  if (names[i] == x)
304  k = i;
305  }
306  if (k) {
307  k--;
308  for (int i = 0; i < n; ++i) {
309  int e = (i / acc[k]) % (degs[k] + 1);
310  if (coefs[i] != 0 && e > d)
311  d = e;
312  }
313  }
314  return d;
315  }
316  /**
317  * Get the leading coefficient
318  *
319  * @param
320  **/
321  inline Field leadingCoefficient() {
322  for (int i = n-1; i > -1; --i) {
323  if (coefs[i] != 0)
324  return coefs[i];
325  }
326  return 0;
327  }
328  /**
329  * Get a coefficient
330  *
331  * @param v: Number of variables
332  * @param d: The exponent of each variable
333  **/
334  inline Field coefficient(int v, int* d) {
335  int k = 0;
336  for (int i = var-1, j = 0; i > -1 && j < v; --i, ++j) {
337  if (d[j] <= degs[i])
338  k += d[j] * acc[i];
339  else { return 0; }
340  }
341  for (int i = v-var-1; i > -1; --i)
342  if (d[i]) { return 0; }
343  return coefs[k];
344  }
345  /**
346  * Set a coefficient
347  *
348  * @param v: Number of variables
349  * @param d: The exponent of each variable
350  * @param val: Value of the coefficient
351  **/
352  inline void setCoefficient(int v, int* d, Field val) {
353  if (v != var) {
354  std::cout << "BPAS: error, DDMMP(" << var << "), but trying to setCoefficient with " << v << " variables." << std::endl;
355  exit(1);
356  }
357  int k = 0;
358  for (int i = var-1, j = 0; i > -1 && j < v; --i, ++j) {
359  if (d[j] <= degs[i])
360  k += d[j] * acc[i];
361  else {
362  std::cout << "BPAS: error, the degree of " << names[i+1] << " in DDMMP is " << degs[i] << "." << std::endl;
363  exit(1);
364  }
365  }
366  coefs[k] = val;
367  }
368 
369  /**
370  * Set a coefficient
371  *
372  * @param k: The offset in the coefficient array
373  * @param val: Value of the coefficient
374  **/
375  inline void setCoefficient(int k, Field val) {
376  if (k >= n || k < 0) {
377  std::cout << "BPAS: error, trying to access a non-exist coefficient in DDMMP<Field>." << std::endl;
378  exit(1);
379  }
380  coefs[k] = val;
381  }
382 
383  /**
384  * Overload operator ==
385  *
386  * @param b: A multivariate modular polynomial
387  **/
389  if (var != b.var || p != b.p)
390  return 0;
391 
392  int prev = 0;
393  for (int i = 0; i < n; ++i) {
394  int k = 0;
395  for (int j = 0; j < var; ++j) {
396  int e = (i / acc[j]) % (degs[j] + 1);
397  if (e <= b.degs[j])
398  k += e * b.acc[j];
399  else if (coefs[i] != 0)
400  return 0;
401  }
402  for (int j = prev+1; j < k; ++j) {
403  if (b.coefs[j] != 0)
404  return 0;
405  }
406  if (coefs[i] != b.coefs[k])
407  return 0;
408  prev = k;
409  }
410  for (int i = n; i < b.n; ++i) {
411  if (b.coefs[i] != 0)
412  return 0;
413  }
414  return 1;
415  }
416  /**
417  * Overload operator !=
418  *
419  * @param b: A multivariate modular polynomial
420  **/
422  return !(*this == b);
423  }
424 
425  /**
426  * Overload operator +
427  *
428  * @param b: A multivariate modular polynomial
429  **/
431  if (p != b.p) {
432  std::cout << "BPAS: error, trying to add between Z/" << p << "Z and Z/" << b.p << "Z from DDMMP<Field>." << std::endl;
433  exit(1);
434  }
435  if (isConstant()) { return b + coefs[0]; }
436  if (b.isConstant()) { return *this + b.coefs[0]; }
437 
438  bool isSame = isSameRing(b);
439  if (!isSame) {
440  std::cout << "BPAS: error, trying to add between Z/" << p << "Z[";
441  for (int i = 1; i <= var; ++i) {
442  std::cout << names[i];
443  if (i < var)
444  std::cout << ", ";
445  }
446  std::cout << "] and Z/" << b.p << "Z[";
447  for (int i = 1; i <= b.var; ++i) {
448  std::cout << b.names[i];
449  if (i < b.var)
450  std::cout << ", ";
451  }
452  std::cout << "] from DDMMP<Field>." << std::endl;
453  exit(1);
454  }
455 
456  int* ds = new int[var];
457  for (int i = 0; i < var; ++i)
458  ds[i] = (degs[i] >= b.degs[i])? degs[i] : b.degs[i];
460  std::copy(names, names+var+1, res.names);
461 
462  //#pragma cilk_grainsize = 1024;
463  for (int i = 0; i < res.n; ++i) {
464  Field elem = 0;
465  int offseta = 0, offsetb = 0;
466  for (int j = 0; j < var; ++j) {
467  int k = (i / res.acc[j]) % (res.degs[j] + 1);
468  if (offseta >= 0 && k <= degs[j])
469  offseta += k * acc[j];
470  else
471  offseta = -1;
472  if (offsetb >= 0 && k <= b.degs[j])
473  offsetb += k * b.acc[j];
474  else
475  offsetb = -1;
476  }
477  if (offseta >= 0 && offsetb >= 0)
478  coef_add_mod(&elem, coefs[offseta], b.coefs[offsetb], p);
479  else if (offseta >= 0)
480  elem = coefs[offseta];
481  else if (offsetb >= 0)
482  elem = b.coefs[offsetb];
483  res.coefs[i] = elem;
484  }
485 
486  delete [] ds;
487  return res;
488  }
489  /**
490  * Overload operator +=
491  *
492  * @param b: A multivariate modular polynomial
493  **/
495  *this = *this + b;
496  return *this;
497  }
498  /**
499  * Overload operator +
500  *
501  * @param e: A constant
502  **/
505  return (r += e);
506  }
508  return (f + e);
509  }
510  /**
511  * Overload operator +=
512  *
513  * @param e: A constant
514  **/
516  coef_add_mod(&coefs[0], coefs[0], e, p);
517  return *this;
518  }
519  /**
520  * Overload operator -
521  *
522  * @param b: A multivariate modular polynomial
523  **/
525  if (p != b.p) {
526  std::cout << "BPAS: error, trying to subtract between Z/" << p << "Z and Z/" << b.p << "Z from DDMMP<Field>." << std::endl;
527  exit(1);
528  }
529  if (isConstant()) { return -b + coefs[0]; }
530  if (b.isConstant()) { return *this - b.coefs[0]; }
531 
532  bool isSame = isSameRing(b);
533  if (!isSame) {
534  std::cout << "BPAS: error, trying to subtract between Z/" << p << "Z[";
535  for (int i = 1; i <= var; ++i) {
536  std::cout << names[i];
537  if (i < var)
538  std::cout << ", ";
539  }
540  std::cout << "] and Z/" << b.p << "Z[";
541  for (int i = 1; i <= b.var; ++i) {
542  std::cout << b.names[i];
543  if (i < b.var)
544  std::cout << ", ";
545  }
546  std::cout << "] from DDMMP<Field>." << std::endl;
547  exit(1);
548  }
549 
550  int* ds = new int[var];
551  for (int i = 0; i < var; ++i)
552  ds[i] = (degs[i] >= b.degs[i])? degs[i] : b.degs[i];
554  std::copy(names, names+var+1, res.names);
555 
556  for (int i = 0; i < res.n; ++i) {
557  Field elem = 0;
558  int offseta = 0, offsetb = 0;
559  for (int j = 0; j < var; ++j) {
560  int k = (i / res.acc[j]) % (res.degs[j] + 1);
561  if (offseta >= 0 && k <= degs[j])
562  offseta += k * acc[j];
563  else { offseta = -1; }
564  if (offsetb >= 0 && k <= b.degs[j])
565  offsetb += k * b.acc[j];
566  else { offsetb = -1; }
567  }
568  if (offseta >= 0 && offsetb >= 0)
569  coef_sub_mod(&elem, coefs[offseta], b.coefs[offsetb], p);
570  else if (offseta >= 0)
571  elem = coefs[offseta];
572  else if (offsetb >= 0)
573  coef_neg_mod(&elem, b.coefs[offsetb], p);
574  res.coefs[i] = elem;
575  }
576  delete [] ds;
577  return res;
578  }
579  /**
580  * Overload operator -=
581  *
582  * @param b: A multivariate modular polynomial
583  **/
585  *this = *this - b;
586  return *this;
587  }
588  /**
589  * Overload operator -, negate
590  *
591  * @param
592  **/
595  std::copy(names, names+var+1, res.names);
596  for (int i = 0; i < res.n; ++i)
597  coef_neg_mod(&res.coefs[i], coefs[i], p);
598  return res;
599  }
600  /**
601  * Overload operator -
602  *
603  * @param e: A constant
604  **/
607  return (r -= e);
608  }
610  return (-f + e);
611  }
612  /**
613  * Overload operator -=
614  *
615  * @param e: A constant
616  **/
618  coef_sub_mod(&coefs[0], coefs[0], e, p);
619  return *this;
620  }
621 
622  /**
623  * Negate, f(-x)
624  *
625  * @param
626  **/
627  inline void negate() {
628  for (int i = 0; i < n; ++i)
629  coef_neg_mod(&coefs[i], coefs[i], p);
630  }
631 
632  /**
633  * Overload operator *
634  *
635  * @param b: A multivariate modular polynomial
636  **/
638  if (p != b.p) {
639  std::cout << "BPAS: error, trying to multiply between Z/" << p << "Z and Z/" << b.p << "Z from DDMMP<Field>." << std::endl;
640  exit(1);
641  }
642  if (isConstant()) { return b * coefs[0]; }
643  if (b.isConstant()) { return *this * b.coefs[0]; }
644 
645  bool isSame = isSameRing(b);
646  if (!isSame) {
647  std::cout << "BPAS: error, trying to multiply between Z/" << p << "Z[";
648  for (int i = 1; i <= var; ++i) {
649  std::cout << names[i];
650  if (i < var)
651  std::cout << ", ";
652  }
653  std::cout << "] and Z/" << b.p << "Z[";
654  for (int i = 1; i <= b.var; ++i) {
655  std::cout << b.names[i];
656  if (i < b.var)
657  std::cout << ", ";
658  }
659  std::cout << "] from DDMMP<Field>." << std::endl;
660  exit(1);
661  }
662 
663  int* ds = new int[var];
664  for (int i = 0; i < var; ++i)
665  ds[i] = degs[i] + b.degs[i];
667  std::copy(names, names+var+1, res.names);
668 
669  for (int i = 0; i < n; ++i) {
670  for (int v = 0; v < var; ++v)
671  ds[v] = (i / acc[v]) % (degs[v] + 1);
672  for (int j = 0; j < b.n; ++j) {
673  int k = 0;
674  for (int v = 0; v < b.var; ++v) {
675  int e = (j / b.acc[v]) % (b.degs[v] + 1);
676  if (v < var)
677  k += (ds[v] + e) * res.acc[v];
678  else
679  k += e * res.acc[v];
680  }
681  for (int v = b.var; v < var; ++v)
682  k += ds[v] * res.acc[v];
683  // res.coefs[k] += coefs[i] * b.coefs[j];
684  Field t;
685  coef_mul_mod(&t, coefs[i], b.coefs[j], p);
686  coef_add_mod(&res.coefs[k], res.coefs[k], t, p);
687  }
688  }
689 
690  delete [] ds;
691  return res;
692  }
693  /**
694  * Overload operator *=
695  *
696  * @param b: A multivariate modular polynomial
697  **/
699  *this = *this * b;
700  return *this;
701  }
702  /**
703  * Overload operator *
704  *
705  * @param e: A constant
706  **/
709  return (r *= e);
710  }
712  return (f * e);
713  }
714  /**
715  * Overload operator *=
716  *
717  * @param e: A constant
718  **/
720  if (e != 0 && e != 1) {
721  if (e < 0) { e = e % p + p; }
722  for (int i = 0; i < n; ++i)
723  coef_mul_mod(&coefs[i], coefs[i], e, p);
724  }
725  else if (e == 0) { zero(); }
726  return *this;
727  }
728 
729  /**
730  * Set variable names
731  *
732  * @param xs: Variable names
733  **/
734  inline void setVariableNames (std::vector<std::string> xs) {
735  int ns = xs.size();
736  if (ns != var) {
737  std::cout << "BPAS: error, DDMMP(" << var << "), but trying to setVariableNames with " << ns << " variables." << std::endl;
738  exit(1);
739  }
740  names[0] = "9";
741  for (int i = var, j = 0; i > 0 && j < ns; --i, ++j)
742  names[i] = xs[j];
743  }
744 
745  /**
746  * Get variable names
747  *
748  * @param
749  **/
750  inline std::vector<std::string> variables() {
751  std::vector<std::string> xs;
752  for (int i = var; i > 0; --i)
753  xs.push_back(names[i]);
754  return xs;
755  }
756 
757  /**
758  * Overload stream operator <<
759  *
760  * @param out: Stream object
761  * @param b: The multivariate modular polynomial
762  **/
763  inline friend std::ostream& operator<< (std::ostream &out, DistributedDenseMultivariateModularPolynomial<Field> b) {
764  bool isFirst = 0;
765  for (int i = 0; i < b.n; ++i) {
766  if (b.coefs[i] != 0) {
767  if (isFirst) {
768  if (b.coefs[i] >= 0)
769  out << "+";
770  else if (b.coefs[i] == -1)
771  out << "-";
772  if (b.coefs[i] != 1 && b.coefs[i] != -1)
773  out << b.coefs[i];
774  bool isIt = 1;
775  for (int j = 0; j < b.var; ++j) {
776  int exp = (i / b.acc[j]) % (b.degs[j] + 1);
777  if (exp) {
778  if ((b.coefs[i] != 1 && b.coefs[i] != -1 && isIt) || !isIt)
779  out << "*";
780  out << b.names[j+1];
781  if (exp > 1)
782  out << "^" << exp;
783  isIt = 0;
784  }
785  }
786  }
787  else { out << b.coefs[i]; }
788  isFirst = 1;
789  }
790  }
791  if (!isFirst) { out << "0"; }
792  return out;
793  }
794 };
795 
796 #endif
797 /* This file is part of the BPAS library http://www.bpaslib.org
798 
799  BPAS is free software: you can redistribute it and/or modify
800  it under the terms of the GNU General Public License as published by
801  the Free Software Foundation, either version 3 of the License, or
802  (at your option) any later version.
803 
804  BPAS is distributed in the hope that it will be useful,
805  but WITHOUT ANY WARRANTY; without even the implied warranty of
806  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
807  GNU General Public License for more details.
808 
809  You should have received a copy of the GNU General Public License
810  along with BPAS. If not, see <http://www.gnu.org/licenses/>.
811 
812  Copyright: Changbo Chen <changbo.chen@hotmail.com>
813  Farnam Mansouri <mansouri.farnam@gmail.com>
814  Marc Moreno Maza <moreno@csd.uwo.ca>
815  Ning Xie <nxie6@csd.uwo.ca>
816  Yuzhen Xie <yuzhenxie@yahoo.ca>
817 
818 */
819 
820 
void setCoefficient(int k, Field val)
Definition: dmpolynomial.h:375
DistributedDenseMultivariateModularPolynomial(const DistributedDenseMultivariateModularPolynomial< Field > &b)
Definition: dmpolynomial.h:144
void setCoefficient(int v, int *d, Field val)
Definition: dmpolynomial.h:352
void negate()
Definition: dmpolynomial.h:627
bool isOne()
Definition: dmpolynomial.h:216
Field coefficient(int v, int *d)
Definition: dmpolynomial.h:334
bool operator==(DistributedDenseMultivariateModularPolynomial< Field > &b)
Definition: dmpolynomial.h:388
DistributedDenseMultivariateModularPolynomial< Field > operator*(DistributedDenseMultivariateModularPolynomial< Field > b)
Definition: dmpolynomial.h:637
DistributedDenseMultivariateModularPolynomial(std::string x, Field m)
Definition: dmpolynomial.h:127
DistributedDenseMultivariateModularPolynomial< Field > operator-()
Definition: dmpolynomial.h:593
DistributedDenseMultivariateModularPolynomial(int v, int *ds, Field m)
Definition: dmpolynomial.h:98
void setVariableNames(std::vector< std::string > xs)
Definition: dmpolynomial.h:734
DistributedDenseMultivariateModularPolynomial(Field m)
Definition: dmpolynomial.h:81
DistributedDenseMultivariateModularPolynomial()
Definition: dmpolynomial.h:66
DistributedDenseMultivariateModularPolynomial< Field > & operator-=(DistributedDenseMultivariateModularPolynomial< Field > b)
Definition: dmpolynomial.h:584
std::vector< std::string > variables()
Definition: dmpolynomial.h:750
DistributedDenseMultivariateModularPolynomial< Field > operator+(DistributedDenseMultivariateModularPolynomial< Field > b)
Definition: dmpolynomial.h:430
void negativeOne()
Definition: dmpolynomial.h:250
Field leadingCoefficient()
Definition: dmpolynomial.h:321
int numberOfTerms()
Definition: dmpolynomial.h:281
DistributedDenseMultivariateModularPolynomial< Field > & operator*=(DistributedDenseMultivariateModularPolynomial< Field > b)
Definition: dmpolynomial.h:698
DistributedDenseMultivariateModularPolynomial< Field > & operator=(DistributedDenseMultivariateModularPolynomial< Field > b)
Definition: dmpolynomial.h:170
int degree(std::string x)
Definition: dmpolynomial.h:300
bool isNegativeOne()
Definition: dmpolynomial.h:238
Definition: polynomial.h:74
DistributedDenseMultivariateModularPolynomial< Field > & operator+=(DistributedDenseMultivariateModularPolynomial< Field > b)
Definition: dmpolynomial.h:494
~DistributedDenseMultivariateModularPolynomial()
Definition: dmpolynomial.h:159
void zero()
Definition: dmpolynomial.h:208
void one()
Definition: dmpolynomial.h:228
int numberOfVariables()
Definition: dmpolynomial.h:273
int size()
Definition: dmpolynomial.h:292
int isConstant()
Definition: dmpolynomial.h:260
bool operator!=(DistributedDenseMultivariateModularPolynomial< Field > &b)
Definition: dmpolynomial.h:421
bool isZero()
Definition: dmpolynomial.h:196