version 1.4, 2001/05/04 01:06:24 |
version 1.7, 2003/06/26 08:14:46 |
|
|
/* $OpenXM: OpenXM/src/kan96xx/Kan/order.c,v 1.3 2000/06/09 08:02:02 takayama Exp $ */ |
/* $OpenXM: OpenXM/src/kan96xx/Kan/order.c,v 1.6 2002/09/08 10:49:50 takayama Exp $ */ |
#include <stdio.h> |
#include <stdio.h> |
#include "datatype.h" |
#include "datatype.h" |
#include "stackm.h" |
#include "stackm.h" |
Line 58 void showRing(level,ringp) |
|
Line 58 void showRing(level,ringp) |
|
int P; |
int P; |
char *mtype; |
char *mtype; |
extern char *F_isSameComponent; |
extern char *F_isSameComponent; |
|
POLY f; |
|
POLY fx; |
|
POLY fd; |
|
POLY rf; |
fp = stdout; |
fp = stdout; |
|
|
N=ringp->n; M = ringp->m; L = ringp->l; C = ringp->c; |
N=ringp->n; M = ringp->m; L = ringp->l; C = ringp->c; |
Line 80 void showRing(level,ringp) |
|
Line 84 void showRing(level,ringp) |
|
fprintf(fp,"\n"); |
fprintf(fp,"\n"); |
fprintf(fp,"where "); |
fprintf(fp,"where "); |
for (i=M; i<N; i++) { |
for (i=M; i<N; i++) { |
fprintf(fp," %s %s - %s %s = 1, ",TransD[i],TransX[i], |
fx = cxx(1,i,1,ringp); fd = cdd(1,i,1,ringp); |
TransX[i],TransD[i]); |
rf = ppSub(ppMult(fd,fx),ppMult(fx,fd)); |
|
fprintf(fp," %s %s - %s %s = %s, ",TransD[i],TransX[i], |
|
TransX[i],TransD[i],POLYToString(rf,'*',0)); |
} |
} |
fprintf(fp,"\n\n"); |
fprintf(fp,"\n\n"); |
} |
} |
Line 92 void showRing(level,ringp) |
|
Line 98 void showRing(level,ringp) |
|
fprintf(fp,"\n"); |
fprintf(fp,"\n"); |
fprintf(fp,"where "); |
fprintf(fp,"where "); |
for (i=L; i<M; i++) { |
for (i=L; i<M; i++) { |
fprintf(fp," %s %s - %s %s = %s, ",TransD[i],TransX[i], |
fprintf(fp," %s %s - %s %s = ",TransD[i],TransX[i], |
TransX[i],TransD[i], |
TransX[i],TransD[i]); |
TransD[i]); |
f=ppSub(ppMult(cdd(1,i,1,ringp),cxx(1,i,1,ringp)), |
|
ppMult(cxx(1,i,1,ringp),cdd(1,i,1,ringp))); |
|
fprintf(fp," %s, ",POLYToString(f,'*',0)); |
} |
} |
fprintf(fp,"\n\n"); |
fprintf(fp,"\n\n"); |
} |
} |
Line 172 void showRing(level,ringp) |
|
Line 180 void showRing(level,ringp) |
|
printObjectList((struct object *)(ringp->gbListTower)); |
printObjectList((struct object *)(ringp->gbListTower)); |
fprintf(fp,"\n"); |
fprintf(fp,"\n"); |
} |
} |
|
if (ringp->degreeShiftSize) { |
|
fprintf(fp,"degreeShift vector = ["); |
|
{ |
|
int i; |
|
for (i=0; i<ringp->degreeShiftSize; i++) { |
|
fprintf(fp," %d ",ringp->degreeShift[i]); |
|
} |
|
} |
|
fprintf(fp,"]\n"); |
|
} |
|
fprintf(fp,"--- weight vectors ---\n"); |
if (level) printOrder(ringp); |
if (level) printOrder(ringp); |
|
|
if (ringp->next != (struct ring *)NULL) { |
if (ringp->next != (struct ring *)NULL) { |
Line 328 int mmLarger_matrix(ff,gg) |
|
Line 346 int mmLarger_matrix(ff,gg) |
|
int in2; |
int in2; |
int *from, *to; |
int *from, *to; |
int omsize; |
int omsize; |
|
int dssize; |
|
int *degreeShiftVector; |
|
|
if (ff == POLYNULL ) { |
if (ff == POLYNULL ) { |
if (gg == POLYNULL) return( 2 ); |
if (gg == POLYNULL) return( 2 ); |
Line 345 int mmLarger_matrix(ff,gg) |
|
Line 365 int mmLarger_matrix(ff,gg) |
|
from = rp->from; |
from = rp->from; |
to = rp->to; |
to = rp->to; |
omsize = rp->orderMatrixSize; |
omsize = rp->orderMatrixSize; |
|
if (dssize = rp->degreeShiftSize) { |
|
degreeShiftVector = rp->degreeShift; /* Note. 2003.06.26 */ |
|
} |
|
|
flag = 1; |
flag = 1; |
for (i=N-1,k=0; i>=0; i--,k++) { |
for (i=N-1,k=0; i>=0; i--,k++) { |
Line 361 int mmLarger_matrix(ff,gg) |
|
Line 384 int mmLarger_matrix(ff,gg) |
|
sum = 0; in2 = i*2*N; |
sum = 0; in2 = i*2*N; |
/* for (k=0; k<2*N; k++) sum += exp[k]*Order[in2+k]; */ |
/* for (k=0; k<2*N; k++) sum += exp[k]*Order[in2+k]; */ |
for (k=from[i]; k<to[i]; k++) sum += exp[k]*Order[in2+k]; |
for (k=from[i]; k<to[i]; k++) sum += exp[k]*Order[in2+k]; |
|
if (dssize && ( i == 0)) { /* Note, 2003.06.26 */ |
|
if ((f->e[N-1].x < dssize) && (f->e[N-1].x >= 0) && |
|
(g->e[N-1].x < dssize) && (g->e[N-1].x >= 0)) { |
|
sum += degreeShiftVector[f->e[N-1].x] |
|
-degreeShiftVector[g->e[N-1].x]; |
|
}else{ |
|
warningOrder("Size mismatch in the degree shift vector. It is ignored."); |
|
} |
|
} |
if (sum > 0) return(1); |
if (sum > 0) return(1); |
if (sum < 0) return(0); |
if (sum < 0) return(0); |
} |
} |