Changeset 0a64b14 in git for kernel/ideals.cc
- Timestamp:
- Nov 5, 2008, 4:40:39 PM (15 years ago)
- Branches:
- (u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'a657104b677b4c461d018cbf3204d72d34ad66a9')
- Children:
- b503d0252f1680bb308156af73414127915b891a
- Parents:
- ec146d912ee5e6f0789c4f2e65c1507040db488b
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/ideals.cc
rec146d r0a64b14 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: ideals.cc,v 1. 59 2008-08-02 14:20:22 SingularExp $ */4 /* $Id: ideals.cc,v 1.60 2008-11-05 15:40:38 wienand Exp $ */ 5 5 /* 6 6 * ABSTRACT - all basic methods to manipulate ideals … … 2527 2527 } 2528 2528 2529 /*2 2530 * compute the which-th ar-minor of the matrix a 2531 */ 2532 poly idMinor(matrix a, int ar, unsigned long which, ideal R) 2533 { 2534 int i,j,k,size; 2535 unsigned long curr; 2536 int *rowchoise,*colchoise; 2537 BOOLEAN rowch,colch; 2538 ideal result; 2539 matrix tmp; 2540 poly p,q; 2541 2542 i = binom(a->rows(),ar); 2543 j = binom(a->cols(),ar); 2544 2545 rowchoise=(int *)omAlloc(ar*sizeof(int)); 2546 colchoise=(int *)omAlloc(ar*sizeof(int)); 2547 if ((i>512) || (j>512) || (i*j >512)) size=512; 2548 else size=i*j; 2549 result=idInit(size,1); 2550 tmp=mpNew(ar,ar); 2551 k = 0; /* the index in result*/ 2552 curr = 0; /* index of current minor */ 2553 idInitChoise(ar,1,a->rows(),&rowch,rowchoise); 2554 while (!rowch) 2555 { 2556 idInitChoise(ar,1,a->cols(),&colch,colchoise); 2557 while (!colch) 2558 { 2559 if (curr == which) 2560 { 2561 for (i=1; i<=ar; i++) 2562 { 2563 for (j=1; j<=ar; j++) 2564 { 2565 MATELEM(tmp,i,j) = MATELEM(a,rowchoise[i-1],colchoise[j-1]); 2566 } 2567 } 2568 p = mpDetBareiss(tmp); 2569 if (p!=NULL) 2570 { 2571 if (R!=NULL) 2572 { 2573 q = p; 2574 p = kNF(R,currQuotient,q); 2575 pDelete(&q); 2576 } 2577 /*delete the matrix tmp*/ 2578 for (i=1; i<=ar; i++) 2579 { 2580 for (j=1; j<=ar; j++) MATELEM(tmp,i,j) = NULL; 2581 } 2582 idDelete((ideal*)&tmp); 2583 omFreeSize((ADDRESS)rowchoise,ar*sizeof(int)); 2584 omFreeSize((ADDRESS)colchoise,ar*sizeof(int)); 2585 return (p); 2586 } 2587 } 2588 curr++; 2589 idGetNextChoise(ar,a->cols(),&colch,colchoise); 2590 } 2591 idGetNextChoise(ar,a->rows(),&rowch,rowchoise); 2592 } 2593 return (poly) 1; 2594 } 2595 2529 2596 #ifdef WITH_OLD_MINOR 2530 2597 /*2
Note: See TracChangeset
for help on using the changeset viewer.