Changeset 0a64b14 in git
- Timestamp:
- Nov 5, 2008, 4:40:39 PM (15 years ago)
- Branches:
- (u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', '0604212ebb110535022efecad887940825b97c3f')
- Children:
- b503d0252f1680bb308156af73414127915b891a
- Parents:
- ec146d912ee5e6f0789c4f2e65c1507040db488b
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/extra.cc
rec146d r0a64b14 2 2 * Computer Algebra System SINGULAR * 3 3 *****************************************/ 4 /* $Id: extra.cc,v 1.28 3 2008-10-02 12:02:36 SingularExp $ */4 /* $Id: extra.cc,v 1.284 2008-11-05 15:40:38 wienand Exp $ */ 5 5 /* 6 6 * ABSTRACT: general interface to internals of Singular ("system" command) … … 2473 2473 else 2474 2474 #endif 2475 if (strcmp(sys_cmd, "minor")==0) 2476 { 2477 ring r = currRing; 2478 matrix a = (matrix) h->Data(); 2479 h = h->next; 2480 int ar = (int) h->Data(); 2481 h = h->next; 2482 int which = (int) h->Data(); 2483 h = h->next; 2484 ideal R = NULL; 2485 if (h != NULL) 2486 { 2487 R = (ideal) h->Data(); 2488 } 2489 res->data=(poly) idMinor(a, ar, (unsigned long) which, R); 2490 if (res->data == (poly) 1) 2491 { 2492 res->rtyp=INT_CMD; 2493 res->data = 0; 2494 } 2495 else 2496 { 2497 res->rtyp=POLY_CMD; 2498 } 2499 return(FALSE); 2500 } 2501 else 2475 2502 #ifdef HAVE_F5 2476 2503 /*==================== F5 Implementation =================*/ -
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 -
kernel/ideals.h
rec146d r0a64b14 4 4 * Computer Algebra System SINGULAR * 5 5 ****************************************/ 6 /* $Id: ideals.h,v 1.1 0 2008-03-19 17:44:09 SingularExp $ */6 /* $Id: ideals.h,v 1.11 2008-11-05 15:40:39 wienand Exp $ */ 7 7 /* 8 8 * ABSTRACT - all basic methods to manipulate ideals … … 111 111 ideal idElimination (ideal h1,poly delVar, intvec *hilb=NULL); 112 112 113 poly idMinor(matrix a, int ar, unsigned long which, ideal R=NULL); 114 113 115 ideal idMinors(matrix a, int ar, ideal R=NULL); 114 116
Note: See TracChangeset
for help on using the changeset viewer.