Changeset 513673 in git
 Timestamp:
 Oct 15, 2013, 3:15:25 PM (11 years ago)
 Branches:
 (u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
 Children:
 3630419158783d9329a9e0d3d501208a60c71b10
 Parents:
 c21a6b6ea8d600f0dee5b13cbb0c042d2fe7e574
 gitauthor:
 Andreas Steenpass <steenpass@mathematik.unikl.de>20131015 15:15:25+02:00
 gitcommitter:
 Andreas Steenpass <steenpass@mathematik.unikl.de>20131015 15:19:17+02:00
 Files:

 3 edited
Legend:
 Unmodified
 Added
 Removed

Singular/LIB/realclassify.lib
rc21a6b r513673 28 28 "; 29 29 30 LIB "linalg.lib"; 30 31 LIB "elim.lib"; 31 32 LIB "primdec.lib"; … … 475 476 USAGE: realmorsesplit(f[, mu]); f poly, mu int 476 477 RETURN: a list consisting of the corank of f, the inertia index, an upper 477 bound for the determinacy, the residual form of f and 478 the transformation 478 bound for the determinacy, and the residual form of f 479 479 NOTE: The characteristic of the basering must be zero, the monomial order 480 480 must be local, f must be contained in maxideal(2) and the Milnor … … 486 486 EXAMPLE: example morsesplit; shows an example" 487 487 { 488 /* auxiliary variables */ 489 int i, j; 488 int i; 490 489 491 490 /* error check */ … … 532 531 } 533 532 534 /* preliminary stuff */ 535 list S; 533 /* compute the determinacy */ 536 534 int k = determinacy(f, mu); 537 535 f = jet(f, k); 538 def br = basering; 539 map Phi = br, maxideal(1); 540 map phi; 541 poly a, p, r; 542 543 /* treat the variables one by one */ 536 537 /* get jet(f, 2) right */ 538 matrix H = concat(jet(jacob(jacob(f)), 0)/2, unitmat(n)); 539 H = sym_reduce(H); 540 intvec perm_zero; 541 intvec perm_neg; 542 intvec perm_pos; 543 int c; 544 int lambda; 544 545 for(i = 1; i <= n; i++) 545 546 { 546 if(jet(f, 2)/var(i) == 0) 547 { 548 S = insert(S, i); 549 } 550 else 551 { 552 f, a, p, r = rewriteformorsesplit(f, k, i); 553 if(jet(a, 0) == 0) 554 { 555 for(j = i+1; j <= n; j++) 556 { 557 if(jet(f, 2)/(var(i)*var(j)) != 0) 558 { 559 break; 560 } 561 } 562 phi = br, maxideal(1); 563 phi[j] = var(j)+var(i); 564 Phi = phi(Phi); 565 f = phi(f); 566 } 567 f, a, p, r = rewriteformorsesplit(f, k, i); 568 while(p != 0) 569 { 570 phi = br, maxideal(1); 571 phi[i] = var(i)p/(2*jet(a, 0)); 572 Phi = phi(Phi); 573 f = phi(f); 574 f, a, p, r = rewriteformorsesplit(f, k, i); 575 } 576 } 577 } 578 579 /* sort variables according to corank */ 580 int cr = size(S); 581 phi = br, 0:n; 582 j = 1; 583 for(i = size(S); i > 0; i) 584 { 585 phi[S[i]] = var(j); 586 j++; 587 } 547 if(H[i, i] == 0) 548 { 549 perm_zero = perm_zero, i; 550 c++; 551 } 552 if(H[i, i] < 0) 553 { 554 perm_neg = perm_neg, i; 555 lambda++; 556 } 557 if(H[i, i] > 0) 558 { 559 perm_pos = perm_pos, i; 560 } 561 } 562 intvec perm; 563 if(size(perm_zero) > 1) 564 { 565 perm = perm, perm_zero[2..size(perm_zero)]; 566 } 567 if(size(perm_neg) > 1) 568 { 569 perm = perm, perm_neg[2..size(perm_neg)]; 570 } 571 if(size(perm_pos) > 1) 572 { 573 perm = perm, perm_pos[2..size(perm_pos)]; 574 } 575 perm = perm[2..size(perm)]; 576 matrix T[n][n]; 577 matrix D[1][n]; 588 578 for(i = 1; i <= n; i++) 589 579 { 590 if(phi[i] == 0) 591 { 592 phi[i] = var(j); 593 j++; 594 } 595 } 596 Phi = phi(Phi); 580 T[1..n, i] = H[perm[i], (n+1)..(2*n)]; 581 D[1, i] = H[perm[i], perm[i]]; 582 } 583 map phi = basering, matrix(maxideal(1))*transpose(T); 597 584 f = phi(f); 598 599 /* compute the inertia index lambda */ 600 int lambda; 601 list negCoeff, posCoeff; 602 number ai; 603 poly f2 = jet(f, 2); 604 for(i = 1; i <= n; i++) 605 { 606 ai = number(f2/var(i)^2); 607 if(ai < 0) 608 { 609 lambda++; 610 negCoeff = insert(negCoeff, i); 611 } 612 if(ai > 0) 613 { 614 posCoeff = insert(posCoeff, i); 615 } 616 } 617 618 /* sort variables according to lambda */ 619 phi = br, maxideal(1); 620 j = cr+1; 621 for(i = size(negCoeff); i > 0; i) 622 { 623 phi[negCoeff[i]] = var(j); 624 j++; 625 } 626 for(i = size(posCoeff); i > 0; i) 627 { 628 phi[posCoeff[i]] = var(j); 629 j++; 630 } 631 Phi = phi(Phi); 632 f = phi(f); 633 634 /* compute residual form */ 635 phi = br, maxideal(1); 636 for(i = size(S)+1; i <= n; i++) 637 { 638 phi[i] = 0; 639 } 640 f = phi(f); 641 642 return(list(cr, lambda, k, f, Phi)); 585 f = jet(f, k); 586 587 /* separate the variables */ 588 phi = basering, maxideal(1); 589 map corank_part = basering, maxideal(1); 590 for(i = c+1; i <= n; i++) 591 { 592 corank_part[i] = 0; 593 } 594 poly h = fjet(f, 2)corank_part(f); 595 poly hi; 596 while(h != 0) 597 { 598 for(i = c+1; i <= n; i++) 599 { 600 hi = h/var(i); 601 phi[i] = var(i)hi/(2*D[1, i]); 602 h = hhi*var(i); 603 } 604 f = phi(f); 605 f = jet(f, k); 606 h = fjet(f, 2)corank_part(f); 607 } 608 poly g = cleardenom(fjet(f, 2)); 609 610 return(list(c, lambda, k, g)); 643 611 } 644 612 example … … 649 617 poly f = (x2+3y2z)^2+xyz(xy3+x2z3)^3; 650 618 realmorsesplit(f); 619 } 620 621 /////////////////////////////////////////////////////////////////////////////// 622 /* 623 symmetric Gauss algorithm 624 625 If A is not a square matrix, then the largest upper or left submatrix 626 is assumed to be symmetric. 627 */ 628 proc sym_reduce(matrix A) 629 { 630 int r = nrows(A); 631 int c = ncols(A); 632 int n = r; 633 if(n > c) 634 { 635 n = c; 636 } 637 poly q; 638 int i, j; 639 for(i = 1; i <= n; i++) 640 { 641 for(j = i+1; j <= n; j++) 642 { 643 if(A[i, j] != 0) 644 { 645 while(A[i, i] == 0) 646 { 647 A[1..r, i] = A[1..r, i]+A[1..r, j]; 648 A[i, 1..c] = A[i, 1..c]+A[j, 1..c]; 649 } 650 q = A[i, j]/A[i, i]; 651 A[1..r, j] = A[1..r, j]q*A[1..r, i]; 652 A[j, 1..c] = A[j, 1..c]q*A[i, 1..c]; 653 } 654 } 655 } 656 return(A); 651 657 } 652 658 
Tst/Short/realclassify_s.res.gz.uu
rc21a6b r513673 1 1 begin 600 realclassify_s.res.gz 2 M'XL("&H<3%(``W)E86QC;&%S<VEF>5]S+G)E<P!=4\%NHS`0O?LK1M$>0`$* 3 MDG39.&PFTND;2_M#:4132"R"B:RB=;FZ]?%B4W7!SSXS3S//!ZO;]O="P`D 4 M.?S9_8)9+_JHH1^S#7J](3@'?7B@C/:>OT%?.^0Y\*ILCDTI!*W5042L^AN) 5 MONQM&<G!QFEDR*<U_]VRF*0O(^"4G8%#!G$`G@Q4,/@!G(3+?\SATC4*:IWC 6 M23PG*L2#_X[G4@VA)T%YA(/Q'\GKF;UO6NO#F#&Z+&:Z;&*9+]&.F=;I/L0 7 M%=B\#9H/*TV&"F).,()8Y2B8F&B&!5+$^F\1Q.AW6IH*M!Z$FN3<EIK]8W 8 M]I>.MV4#M=[6<%_NJM\=+]FG0\:%T3M6,>!7=N/BM_1%.U8Q7M:`F6G2MZ/ 9 M8[2M^HJWE)5'Y9A^9KI#*\>3DSR)HU&:MN.B$I=&?^IZ(@JV@L16"&*%""69 10 MXP<B%;:*''1E)DV$]YE&U7P($YV$]39264PLL^4[2&9](O%A#.`M\D)") 11 M`70#*G50FD,[BF6T&D=96G3BM$0[;20Y&Q*IG%L2[;"3$]$[:Y*%!5<3DJ=H 12 4_$&^W'\57N)O?J!_US0V458#```` 2 M'XL("),_75(``W)E86QC;&%S<VEF>5]S+G)E<P!=4L%.PS`,O><KK(E#J[55 3 MFW0#N@!=ID$N\"M8E/9TBFB3:>D$TF_GM!N22&7.'[VB_WLM_?5>@,`208O 4 MZR>8M+**O8Y6:*W"X(S,,X=XZSU_"7ZO2'+0"BVE>%E*S4.QEQ^AW)MFAM 5 M&LG`VFDTD(]S_OTR&X7/(Q",'T'`(\0!>"K00><'<)`N_C:#4UI*$V,I_"4 6 MZ!!W_A9/E>Y"3X6:3!7NB+\E+N?N;]5>&<"$LSV=F+;RY&.!3,PJ3S]"E./A 7 MU1D^K`T9RLG@P<@$]%:*\ME@Q2B?#Y:)NQTL]*Y/%)H2I.GD7!6"M7IQ8=\T 8 MHBXJ*,VU@.MQ7STWHN!?#ND/1J^LXHT`?JX_J;BB*5IS*EI6`.,'JJ[N&*UH 9 M2T7>+'7CNGAT51HY;AWDB=QU$M3T)2>:K,J,N1*@*$ELAB!6"*!)BI;$E 10 M2T;$^#)+Z6;Y=Y()&4U2D:E.'91F4/==#TWW<TM.EJ9Q*Q,3W(<2)1V8T_, 11 CJAR<&M[1D,PL>#<BN8_Z3?]=X[/T$G]Y@WX`&GCH!1\#```` 13 12 ` 14 13 end 
Tst/Short/realclassify_s.stat
rc21a6b r513673 1 1 >> tst_memory_0 :: 138 0719722:3160:316:ix86Linux:mamawutz:3235762 1 >> tst_memory_1 :: 138 0719722:3160:316:ix86Linux:mamawutz:23224323 1 >> tst_memory_2 :: 138 0719722:3160:316:ix86Linux:mamawutz:24013444 1 >> tst_timer_1 :: 138 0719722:3160:316:ix86Linux:mamawutz:161 1 >> tst_memory_0 :: 1381842835:3160:316:ix86Linux:mamawutz:323628 2 1 >> tst_memory_1 :: 1381842835:3160:316:ix86Linux:mamawutz:2322432 3 1 >> tst_memory_2 :: 1381842835:3160:316:ix86Linux:mamawutz:2401344 4 1 >> tst_timer_1 :: 1381842835:3160:316:ix86Linux:mamawutz:15
Note: See TracChangeset
for help on using the changeset viewer.