Changeset 3068e8 in git
 Timestamp:
 Sep 4, 2013, 5:33:28 PM (11 years ago)
 Branches:
 (u'fiekerDuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', '648d28f488f6ff08f5607ff229b9ad9e4a5b93c2')
 Children:
 96847c7348e137cdf7a7b5a6ae39fb69f9104ed3a009faa5fdde26a448e61937ef0e92779f9a83a6
 Parents:
 8243aa7b444fb1e2e7a9c62630c681e5d778193c0b8402984cde399f7cfc35b9e16b563913f207e1
 Files:

 1 added
 5 edited
Legend:
 Unmodified
 Added
 Removed

Singular/iparith.cc
r8243aa r3068e8 33 33 #include <Singular/mod_lib.h> 34 34 #include <polys/weight.h> 35 35 #include <polys/ext_fields/transext.h> 36 36 37 37 #include <kernel/stairc.h> … … 4366 4366 } 4367 4367 res>data = (char *)i; 4368 return FALSE; 4369 } 4370 static BOOLEAN jjDIFF_COEF(leftv res, leftv u, leftv v) 4371 { 4372 if (!nCoeff_is_transExt(currRing>cf)) 4373 { 4374 WerrorS("differentiation not defined in the coefficient ring"); 4375 return TRUE; 4376 } 4377 number n = (number) u>Data(); 4378 number k = (number) v>Data(); 4379 res>data = ntDiff(n,k,currRing>cf); 4368 4380 return FALSE; 4369 4381 } 
Singular/table.h
r8243aa r3068e8 522 522 ,{D(jjDIFF_ID), DIFF_CMD, MODUL_CMD, MODUL_CMD, POLY_CMD, ALLOW_PLURAL ALLOW_RING} 523 523 ,{D(jjDIFF_ID), DIFF_CMD, MATRIX_CMD, MATRIX_CMD, POLY_CMD, ALLOW_PLURAL ALLOW_RING} 524 ,{D(jjDIFF_COEF), DIFF_CMD, NUMBER_CMD, NUMBER_CMD, NUMBER_CMD, ALLOW_PLURAL ALLOW_RING} 524 525 ,{D(jjDIM2), DIM_CMD, INT_CMD, IDEAL_CMD, IDEAL_CMD, ALLOW_PLURAL NO_RING} 525 526 ,{D(jjDIM2), DIM_CMD, INT_CMD, MODUL_CMD, IDEAL_CMD, ALLOW_PLURAL NO_RING} 
libpolys/polys/ext_fields/transext.cc
r8243aa r3068e8 33 33 * TODO: the description above needs a major update!!! 34 34 */ 35 36 37 38 39 35 40 #define TRANSEXT_PRIVATES 36 41 … … 67 72 #define ADD_COMPLEXITY 1 /**< complexity increase due to + and  */ 68 73 #define MULT_COMPLEXITY 2 /**< complexity increase due to * and / */ 74 #define DIFF_COMPLEXITY 2 /**< complexity increase due to * and / */ 69 75 #define BOUND_COMPLEXITY 10 /**< maximum complexity of a number */ 70 76 … … 740 746 */ 741 747 } 748 749 number ntDiff(number a, number d, const coeffs cf) 750 { 751 ntTest(a); 752 ntTest(d); 753 754 fraction t = (fraction) d; 755 if (IS0(d)) 756 { 757 WerrorS("ringvar expected"); 758 return NULL; 759 } 760 if (!DENIS1(t)) 761 { 762 WerrorS("expected differentiation by a variable"); 763 return a; 764 } 765 int k=p_Var(NUM(t),ntRing); 766 if (k==0) 767 { 768 WerrorS("expected differentiation by a variable"); 769 return a; 770 } 771 772 if (IS0(a)) return ntCopy(a, cf); 773 774 fraction fa = (fraction)a; 775 if (DENIS1(fa)) { 776 777 fraction result = (fraction)omAlloc0Bin(fractionObjectBin); 778 NUM(result) = p_Diff(NUM(fa),k,ntRing); 779 DEN(result) = NULL; 780 COM(result) = COM(fa); 781 return (number)result; 782 } 783 784 fraction result = (fraction)omAlloc0Bin(fractionObjectBin); 785 poly fg = p_Mult_q(p_Copy(DEN(fa),ntRing),p_Diff(NUM(fa),k,ntRing),ntRing); 786 poly gf = p_Mult_q(p_Copy(NUM(fa),ntRing),p_Diff(DEN(fa),k,ntRing),ntRing); 787 NUM(result) = p_Sub(fg,gf,ntRing); 788 if (NUM(result)==NULL) return(NULL); 789 DEN(result) = pp_Mult_qq(DEN(fa), DEN(fa), ntRing); 790 COM(result) = COM(fa) + COM(fa) + DIFF_COMPLEXITY; 791 heuristicGcdCancellation((number)result, cf); 792 793 return (number)result; 794 } 795 742 796 743 797 number ntAdd(number a, number b, const coeffs cf) 
libpolys/polys/ext_fields/transext.h
r8243aa r3068e8 98 98 BOOLEAN ntInitChar(coeffs cf, void* infoStruct); 99 99 100 number ntDiff(number a, number d, const coeffs cf); 101 100 102 /* Private hidden interface 101 103 BOOLEAN ntGreaterZero(number a, const coeffs cf);
Note: See TracChangeset
for help on using the changeset viewer.