Changeset 90a60f in git
 Timestamp:
 Feb 12, 2009, 2:31:22 PM (14 years ago)
 Branches:
 (u'spielwiese', 'f6c3dc58b0df4bd712574325fe76d0626174ad97')
 Children:
 f349c5396e73ff26cd89cf807a76da5f41d2bd71
 Parents:
 2ab41e8a61345906b383b4dc90fd21e5578fc28b
 Location:
 kernel
 Files:

 2 edited
Legend:
 Unmodified
 Added
 Removed

kernel/ideals.cc
r2ab41e8 r90a60f 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: ideals.cc,v 1.6 6 20090112 16:19:45 SingularExp $ */4 /* $Id: ideals.cc,v 1.67 20090212 13:31:22 motsak Exp $ */ 5 5 /* 6 6 * ABSTRACT  all basic methods to manipulate ideals … … 3956 3956 return idChineseRemainder(xx,q,rl); 3957 3957 } 3958 3959 3960 3961 3962 /*2 3963 * transpose a module 3964 * NOTE: just a version of "ideal idTransp(ideal)" which works within specified ring. 3965 */ 3966 ideal id_Transp(ideal a, const ring rRing) 3967 { 3968 int r = a>rank, c = IDELEMS(a); 3969 ideal b = idInit(r,c); 3970 3971 for (int i=c; i>0; i) 3972 { 3973 poly p=a>m[i1]; 3974 while(p!=NULL) 3975 { 3976 poly h=p_Head(p, rRing); 3977 int co=p_GetComp(h, rRing)1; 3978 p_SetComp(h, i, rRing); 3979 p_Setm(h, rRing); 3980 b>m[co] = p_Add_q(b>m[co], h, rRing); 3981 pIter(p); 3982 } 3983 } 3984 return b; 3985 } 3986 3987 3988 3989 /*2 3990 * The following is needed to compute the image of certain map used in 3991 * the computation of cohomologies via BGG 3992 * let M = { w_1, ..., w_k }, k = size(M) == ncols(M), n = nvars(currRing). 3993 * assuming that nrows(M) <= m*n; the procedure computes: 3994 * transpose(M) * transpose( var(1) I_m  ...  var(n) I_m ) :== transpose(module{f_1, ... f_k}), 3995 * where f_i = \sum_{j=1}^{m} (w_i, v_j) gen(j), (w_i, v_j) is a `scalar` multiplication. 3996 * that is, if w_i = (a^1_1, ... a^1_m)  (a^2_1, ..., a^2_m)  ...  (a^n_1, ..., a^n_m) then 3997 3998 (a^1_1, ... a^1_m)  (a^2_1, ..., a^2_m)  ...  (a^n_1, ..., a^n_m) 3999 * var_1 ... var_1  var_2 ... var_2  ...  var_n ... var(n) 4000 * gen_1 ... gen_m  gen_1 ... gen_m  ...  gen_1 ... gen_m 4001 + => 4002 f_i = 4003 4004 a^1_1 * var(1) * gen(1) + ... + a^1_m * var(1) * gen(m) + 4005 a^2_1 * var(2) * gen(1) + ... + a^2_m * var(2) * gen(m) + 4006 ... 4007 a^n_1 * var(n) * gen(1) + ... + a^n_m * var(n) * gen(m); 4008 4009 NOTE: for every f_i we run only ONCE along w_i saving partial sums into a temporary array of polys of size m 4010 */ 4011 ideal tensorModuleMult(const int m, const ideal M, const ring rRing) 4012 { 4013 // #ifdef DEBU 4014 // WarnS("tensorModuleMult!!!!"); 4015 4016 assume(m > 0); 4017 assume(M != NULL); 4018 4019 const int n = rRing>N; 4020 4021 assume(M>rank <= m * n); 4022 4023 const int k = IDELEMS(M); 4024 4025 ideal idTemp = idInit(k,m); // = {f_1, ..., f_k } 4026 4027 for( int i = 0; i < k; i++ ) // for every w \in M 4028 { 4029 poly pTempSum = NULL; 4030 4031 poly w = M>m[i]; 4032 4033 while(w != NULL) // for each term of w... 4034 { 4035 poly h = p_Head(w, rRing); 4036 4037 const int gen = p_GetComp(h, rRing); // 1 ... 4038 4039 assume(gen > 0); 4040 assume(gen <= n*m); 4041 4042 // TODO: write a formula with %, / instead of while! 4043 /* 4044 int c = gen; 4045 int v = 1; 4046 while(c > m) 4047 { 4048 c = m; 4049 v++; 4050 } 4051 */ 4052 4053 int cc = gen % m; 4054 if( cc == 0) cc = m; 4055 int vv = 1 + (gen  cc) / m; 4056 4057 // assume( cc == c ); 4058 // assume( vv == v ); 4059 4060 // 1<= c <= m 4061 assume( cc > 0 ); 4062 assume( cc <= m ); 4063 4064 assume( vv > 0 ); 4065 assume( vv <= n ); 4066 4067 assume( (cc + (vv1)*m) == gen ); 4068 4069 4070 p_SetExp(h, vv, 1 + p_GetExp(h, vv, rRing) , rRing); // h *= var(j) && 4071 p_SetComp(h, cc, rRing); 4072 4073 p_Setm(h, rRing); // addjust degree after the previous steps! 4074 4075 pTempSum = p_Add_q(pTempSum, h, rRing); // it is slow since h will be usually put to the back of pTempSum!!! 4076 4077 pIter(w); 4078 } 4079 4080 idTemp>m[i] = pTempSum; 4081 } 4082 4083 // simplify idTemp??? 4084 4085 ideal idResult = id_Transp(idTemp, rRing); 4086 4087 id_Delete(&idTemp, rRing); 4088 4089 return(idResult); 4090 } 
kernel/ideals.h
r2ab41e8 r90a60f 4 4 * Computer Algebra System SINGULAR * 5 5 ****************************************/ 6 /* $Id: ideals.h,v 1.1 1 20081105 15:40:39 wienandExp $ */6 /* $Id: ideals.h,v 1.12 20090212 13:31:22 motsak Exp $ */ 7 7 /* 8 8 * ABSTRACT  all basic methods to manipulate ideals … … 148 148 int idElem(const ideal F); 149 149 matrix idCoeffOfKBase(ideal arg, ideal kbase, poly how); 150 // transpose a module 150 151 ideal idTransp(ideal a); 152 // version of "ideal idTransp(ideal)" which works within a given ring. 153 ideal id_Transp(ideal a, const ring rRing); 154 151 155 152 156 intvec *idQHomWeight(ideal id); … … 160 164 ideal idChineseRemainder(ideal *x, number *q, int rl); 161 165 ideal idChineseRemainder(ideal *x, intvec *iv); 166 167 168 ideal tensorModuleMult(const int m, const ideal M, const ring rRing); // image of certain map for BGG 169 170 171 162 172 #endif
Note: See TracChangeset
for help on using the changeset viewer.