Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 25a7a6e

Browse filesBrowse files
authored
Merge pull request bqi343#23 from rqi3/patch-3
Fix some Polynomial Things
2 parents 5c4becd + a721c72 commit 25a7a6e
Copy full SHA for 25a7a6e

File tree

Expand file treeCollapse file tree

2 files changed

+6
-6
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+6
-6
lines changed

‎Implementations/content/numerical/Polynomials/Poly.h

Copy file name to clipboardExpand all lines: Implementations/content/numerical/Polynomials/Poly.h
+4-4Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ poly operator*(const poly& l, const poly& r) {
5858
}
5959
poly& operator*=(poly& l, const poly& r) { return l = l*r; }
6060

61-
pair<poly,poly> quoRem(poly a, poly b) {
61+
pair<poly,poly> quoRemSlow(poly a, poly b) {
6262
remz(a); remz(b); assert(sz(b));
6363
T lst = b.bk, B = T(1)/lst; each(t,a) t *= B;
6464
each(t,b) t *= B;
@@ -69,11 +69,11 @@ pair<poly,poly> quoRem(poly a, poly b) {
6969
return {q,a}; // quotient, remainder
7070
}
7171
poly operator%(const poly& a, const poly& b) {
72-
return quoRem(a,b).s; }
72+
return quoRemSlow(a,b).s; }
7373
/**poly operator/(const poly& a, const poly& b) {
74-
return quoRem(a,b).f; }
74+
return quoRemSlow(a,b).f; }
7575
poly a = {1,3,5,8,6,0,0,0,0}, b = {1,5,1};
76-
ps(quoRem(a,b)); a = 2*a, b = 2*b; ps(quoRem(a,b));
76+
ps(quoRemSlow(a,b)); a = 2*a, b = 2*b; ps(quoRemSlow(a,b));
7777
poly gcd(poly a, poly b) { return b == poly{} ? a : gcd(b,a%b); }*/
7878
T resultant(poly a, poly b) { // R(A,B)
7979
// =b_m^n*prod_{j=1}^mA(mu_j)

‎Implementations/content/numerical/Polynomials/PolyInvSimpler.h

Copy file name to clipboardExpand all lines: Implementations/content/numerical/Polynomials/PolyInvSimpler.h
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ poly sqrt(const poly& A, int n) { // Q-(Q^2-A)/(2Q)
2929
return RSZ(B,n);
3030
}
3131
// return {quotient, remainder}
32-
pair<poly,poly> divi(const poly& f, const poly& g) {
32+
pair<poly,poly> quoRem(const poly& f, const poly& g) {
3333
if (sz(f) < sz(g)) return {{},f};
3434
poly q = conv(inv(rev(g),sz(f)-sz(g)+1),rev(f));
3535
q = rev(RSZ(q,sz(f)-sz(g)+1));
@@ -52,4 +52,4 @@ poly exp(poly A, int n) { assert(A[0] == 0);
5252
// while (sz(B) < n) { int x = 2*sz(B);
5353
// B = RSZ(B+conv(B,RSZ(A,x)-log(B,x)),x); }
5454
// return RSZ(B,n);
55-
// }
55+
// }

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.