Changeset af7145 in git
- Timestamp:
- Dec 1, 2010, 1:56:35 PM (13 years ago)
- Branches:
- (u'spielwiese', '828514cf6e480e4bafc26df99217bf2a1ed1ef45')
- Children:
- 35715cbb715ef8f8977fca4b923054147968c0d1
- Parents:
- 4d22d3bbe140ec25c1d800b92606f9067563c581
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/extra.cc
r4d22d3 raf7145 137 137 138 138 #include <kernel/shiftgb.h> 139 #include <kernel/linearAlgebra.h> 139 140 140 141 #ifdef HAVE_EIGENVAL … … 629 630 } 630 631 } 632 /*==================== Hensel's lemma ======================*/ 633 if(strcmp(sys_cmd, "henselfactors")==0) 634 { 635 if ((h != NULL) && (h->Typ() == POLY_CMD) && 636 (h->next != NULL) && (h->next->Typ() == POLY_CMD) && 637 (h->next->next != NULL) && (h->next->next->Typ() == POLY_CMD) && 638 (h->next->next->next != NULL) && 639 (h->next->next->next->Typ() == INT_CMD)) 640 { 641 poly hh = (poly)h->Data(); 642 poly f0 = (poly)h->next->Data(); 643 poly g0 = (poly)h->next->next->Data(); 644 int d = (int)(long)h->next->next->next->Data(); 645 poly f; poly g; 646 henselFactors(hh, f0, g0, d, f, g); 647 lists L = (lists)omAllocBin(slists_bin); 648 L->Init(2); 649 L->m[0].rtyp = POLY_CMD; L->m[0].data=(void*)f; 650 L->m[1].rtyp = POLY_CMD; L->m[1].data=(void*)g; 651 res->rtyp = LIST_CMD; 652 res->data = (char *)L; 653 return FALSE; 654 } 655 else 656 { 657 Werror( "expected argument list (poly, poly, poly, int)"); 658 return TRUE; 659 } 660 } 631 661 /*==================== forking experiments ======================*/ 632 662 if(strcmp(sys_cmd, "waitforssilinks")==0) -
kernel/linearAlgebra.cc
r4d22d3 raf7145 1199 1199 w5 = nAdd(w2, w4); 1200 1200 if (!nGreater(w5, tt)) result = i; 1201 nDelete(&w1); nDelete(&w2); nDelete(&w3); nDelete(&w4); nDelete(&w5);1202 1201 nDelete(&w1); nDelete(&w2); nDelete(&w3); nDelete(&w4); 1202 nDelete(&w5); nDelete(&rr); nDelete(&ii); 1203 1203 if (result != -1) break; 1204 1204 } … … 1227 1227 result->Init(1); 1228 1228 result->m[0].rtyp = INT_CMD; 1229 result->m[0].data = (void*)0; /* a list with a single entry (int 0) */ 1229 result->m[0].data = (void*)0; /* a list with a single entry 1230 which is the int zero */ 1230 1231 } 1231 1232 else … … 1270 1271 return result; 1271 1272 } 1273 1274 void henselFactors(const poly h, const poly f0, const poly g0, const int d, 1275 poly &f, poly &g) 1276 { 1277 f = NULL; 1278 g = NULL; 1279 } 1280 -
kernel/linearAlgebra.h
r4d22d3 raf7145 454 454 ); 455 455 456 /** 457 * Computes a factorization of a polynomial h(x, y) in K[[x]][y] up to a 458 * certain degree in x, whenever a factorization of h(0, y) is given. 459 * 460 * The algorithm is based on Hensel's lemma: Let h(x, y) denote a monic 461 * polynomial in y of degree m + n with coefficients in K[[x]]. Suppose there 462 * are two monic factors f_0(y) (of degree n) and g_0(y) of degree (m) such 463 * that h(0, y) = f_0(y) * g_0(y), and an integer d >= 0. Then there are 464 * monic polynomials in y with coefficients in K[[x]], namely f(x, y) of 465 * degree n and g(x, y) of degree m such that 466 * h(x, y) = f(x, y) * g(x, y) modulo <x^(d+1)> (*). 467 * 468 * This implementation expects h, f0, g0, and d as described and computes the 469 * factors f and g. Effectively, h will be given as an element of K[x, y] since 470 * all terms of h with x-degree larger than d can be ignored due to (*). 471 * The method expects the ground ring to contain at least two variables; then 472 * x is the first ring variable and y the second one. 473 **/ 474 void henselFactors( 475 const poly h, /**< [in] the polynomial h(x, y) to be factorized */ 476 const poly f0, /**< [in] the first univariate factor of h(0, y) */ 477 const poly g0, /**< [in] the second univariate factor of h(0, y) */ 478 const int d, /**< [in] the degree bound, d >= 0 */ 479 poly &f, /**< [out] the first factor of h(x, y) */ 480 poly &g /**< [out] the second factor of h(x, y) */ 481 ); 482 456 483 #endif 457 484 /* LINEAR_ALGEBRA_H */
Note: See TracChangeset
for help on using the changeset viewer.