Changeset 542864 in git
- Timestamp:
- May 10, 2012, 12:20:57 PM (12 years ago)
- Branches:
- (u'spielwiese', '5b153614cbc72bfa198d75b1e9e33dab2645d9fe')
- Children:
- 9752db56bd70fbd38b267a2485e46bc0758823a5
- Parents:
- e89ff5740c084fd5cddf6186f601b597b3a47538
- git-author:
- Martin Lee <martinlee84@web.de>2012-05-10 12:20:57+02:00
- git-committer:
- Oleksandr Motsak <motsak@mathematik.uni-kl.de>2012-05-15 18:37:45+02:00
- Location:
- factory
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
factory/facFqBivar.cc
re89ff5 r542864 2283 2283 { 2284 2284 int d; 2285 int* bounds= computeBounds (F, d); 2285 bool isIrreducible= false; 2286 int* bounds= computeBounds (F, d, isIrreducible); 2287 if (isIrreducible) 2288 { 2289 delete [] bounds; 2290 CanonicalForm G= F; 2291 F= 1; 2292 return CFList (G); 2293 } 2286 2294 CFArray * A= new CFArray [factors.length()]; 2287 2295 CFArray bufQ= CFArray (factors.length()); … … 2414 2422 { 2415 2423 int d; 2416 int* bounds= computeBounds (F, d); 2424 bool isIrreducible= false; 2425 int* bounds= computeBounds (F, d, isIrreducible); 2426 if (isIrreducible) 2427 { 2428 delete [] bounds; 2429 CanonicalForm G= F; 2430 F= 1; 2431 return CFList (G); 2432 } 2417 2433 CFArray * A= new CFArray [factors.length()]; 2418 2434 CFArray bufQ= CFArray (factors.length()); … … 2477 2493 delete [] A; 2478 2494 delete [] bounds; 2479 return CFList (F); 2495 CanonicalForm G= F; 2496 F= 1; 2497 return CFList (G); 2480 2498 } 2481 2499 } … … 2547 2565 Variable alpha= info.getAlpha(); 2548 2566 int d; 2549 int* bounds= computeBounds (F, d); 2567 bool isIrreducible= false; 2568 int* bounds= computeBounds (F, d, isIrreducible); 2569 if (isIrreducible) 2570 { 2571 delete [] bounds; 2572 CanonicalForm G= F; 2573 F= 1; 2574 return CFList (G); 2575 } 2550 2576 2551 2577 CFArray * A= new CFArray [factors.length()]; … … 2668 2694 delete [] A; 2669 2695 delete [] bounds; 2696 F= 1; 2670 2697 return CFList (tmp); 2671 2698 } … … 2734 2761 { 2735 2762 int d; 2736 int* bounds= computeBounds (F, d); 2763 bool isIrreducible= false; 2764 int* bounds= computeBounds (F, d, isIrreducible); 2765 if (isIrreducible) 2766 { 2767 delete [] bounds; 2768 return CFList (F); 2769 } 2737 2770 CFArray * A= new CFArray [factors.length()]; 2738 2771 CFArray bufQ= CFArray (factors.length()); … … 2854 2887 { 2855 2888 int d; 2856 int* bounds= computeBounds (F, d); 2889 bool isIrreducible= false; 2890 int* bounds= computeBounds (F, d, isIrreducible); 2891 if (isIrreducible) 2892 { 2893 delete [] bounds; 2894 CanonicalForm G= F; 2895 F= 1; 2896 return CFList (G); 2897 } 2857 2898 int extensionDeg= degree (getMipo (alpha)); 2858 2899 CFArray * A= new CFArray [factors.length()]; … … 2918 2959 delete [] A; 2919 2960 delete [] bounds; 2920 return CFList (F); 2961 CanonicalForm G= F; 2962 F= 1; 2963 return CFList (G); 2921 2964 } 2922 2965 } … … 4561 4604 Variable x= Variable (1); 4562 4605 int d; 4563 int* bounds= computeBounds (F, d); 4564 4606 bool isIrreducible= false; 4607 int* bounds= computeBounds (F, d, isIrreducible); 4608 if (isIrreducible) 4609 { 4610 delete [] bounds; 4611 return CFList (G); 4612 } 4565 4613 int minBound= bounds[0]; 4566 4614 for (int i= 1; i < d; i++) … … 4630 4678 F= H; 4631 4679 delete [] bounds; 4632 bounds= computeBounds (F, d); 4680 bounds= computeBounds (F, d, isIrreducible); 4681 if (isIrreducible) 4682 { 4683 smallFactors.append (F); 4684 delete [] bounds; 4685 return smallFactors; 4686 } 4633 4687 LCF= LC (F, 1); 4634 4688 … … 5107 5161 5108 5162 delete [] bounds; 5109 bounds= computeBounds (F, d); 5163 bounds= computeBounds (F, d, isIrreducible); 5164 if (isIrreducible) 5165 { 5166 delete [] bounds; 5167 result= Union (result, smallFactors); 5168 result.append (F); 5169 return result; 5170 } 5110 5171 minBound= bounds[0]; 5111 5172 for (int i= 1; i < d; i++) … … 5214 5275 5215 5276 int d; 5216 int* bounds= computeBounds (F, d); 5277 bool isIrreducible= false; 5278 int* bounds= computeBounds (F, d, isIrreducible); 5279 if (isIrreducible) 5280 { 5281 delete [] bounds; 5282 return CFList (F); 5283 } 5217 5284 int minBound= bounds[0]; 5218 5285 for (int i= 1; i < d; i++) … … 5286 5353 F= H; 5287 5354 delete [] bounds; 5288 bounds= computeBounds (F, d); 5355 bounds= computeBounds (F, d, isIrreducible); 5356 if (isIrreducible) 5357 { 5358 delete [] bounds; 5359 CFList source, dest; 5360 CanonicalForm tmp= F (y - evaluation, y); 5361 tmp= mapDown (tmp, info, source, dest); 5362 smallFactors.append (tmp); 5363 return smallFactors; 5364 } 5289 5365 LCF= LC (F, 1); 5290 5366 … … 5577 5653 5578 5654 delete [] bounds; 5579 bounds= computeBounds (F, d); 5655 bounds= computeBounds (F, d, isIrreducible); 5656 if (isIrreducible) 5657 { 5658 delete [] bounds; 5659 CFList source, dest; 5660 CanonicalForm tmp= F (y - evaluation, y); 5661 tmp= mapDown (tmp, info, source, dest); 5662 smallFactors.append (tmp); 5663 result= Union (result, smallFactors); 5664 return result; 5665 } 5580 5666 minBound= bounds[0]; 5581 5667 for (int i= 1; i < d; i++) … … 5748 5834 } 5749 5835 5836 int boundsLength; 5837 bool isIrreducible= false; 5838 int * bounds= computeBounds (A, boundsLength, isIrreducible); 5839 if (isIrreducible) 5840 { 5841 delete [] bounds; 5842 factors.append (A); 5843 5844 appendSwapDecompress (factors, contentAxFactors, contentAyFactors, 5845 swap, false, N); 5846 5847 normalize (factors); 5848 return factors; 5849 } 5850 5750 5851 bool fail= false; 5751 5852 CanonicalForm Aeval, evaluation, bufAeval, bufEvaluation, buf; … … 5961 6062 int liftBound= degree (A, y) + 1; 5962 6063 5963 int boundsLength; 5964 int * bounds= computeBounds (A, boundsLength); 6064 if (swap2) 6065 bounds= computeBounds (A, boundsLength, isIrreducible); 6066 5965 6067 int minBound= bounds[0]; 5966 6068 for (int i= 1; i < boundsLength; i++) -
factory/facFqBivarUtil.cc
re89ff5 r542864 662 662 #endif 663 663 664 int * computeBounds (const CanonicalForm& F, int& n )664 int * computeBounds (const CanonicalForm& F, int& n, bool& isIrreducible) 665 665 { 666 666 n= degree (F, 1); … … 668 668 int sizeOfNewtonPolygon; 669 669 int** newtonPolyg= newtonPolygon (F, sizeOfNewtonPolygon); 670 671 isIrreducible= false; 672 if (sizeOfNewtonPolygon == 3) 673 { 674 bool check1= 675 (newtonPolyg[0][0]==0 || newtonPolyg[1][0]==0 || newtonPolyg[2][0]==0); 676 if (check1) 677 { 678 bool check2= 679 (newtonPolyg[0][1]==0 || newtonPolyg[1][1]==0 || newtonPolyg[2][0]==0); 680 if (check2) 681 { 682 int p=getCharacteristic(); 683 int d=1; 684 char bufGFName='Z'; 685 bool GF= (CFFactory::gettype()==GaloisFieldDomain); 686 if (GF) 687 { 688 d= getGFDegree(); 689 bufGFName=gf_name; 690 } 691 setCharacteristic(0); 692 CanonicalForm tmp= gcd (newtonPolyg[0][0],newtonPolyg[0][1]); 693 tmp= gcd (tmp, newtonPolyg[1][0]); 694 tmp= gcd (tmp, newtonPolyg[1][1]); 695 tmp= gcd (tmp, newtonPolyg[2][0]); 696 tmp= gcd (tmp, newtonPolyg[2][1]); 697 isIrreducible= (tmp==1); 698 if (GF) 699 setCharacteristic (p, d, bufGFName); 700 else 701 setCharacteristic(p); 702 } 703 } 704 } 670 705 671 706 int minX, minY, maxX, maxY; -
factory/facFqBivarUtil.h
re89ff5 r542864 208 208 int * 209 209 computeBounds (const CanonicalForm& F,///< [in] compressed bivariate polynomial 210 int& n ///< [in,out] length of output 210 int& n, ///< [in,out] length of output 211 bool& isIrreducible ///< [in,out] check if poly is irreducible 211 212 ); 212 213
Note: See TracChangeset
for help on using the changeset viewer.