version 1.3, 2001/05/04 01:06:25 |
version 1.9, 2020/10/06 11:33:46 |
|
|
/* $OpenXM: OpenXM/src/kan96xx/Kan/poly3.c,v 1.2 2000/01/16 07:55:40 takayama Exp $ */ |
/* $OpenXM: OpenXM/src/kan96xx/Kan/poly3.c,v 1.8 2004/06/12 07:29:46 takayama Exp $ */ |
#include <stdio.h> |
#include <stdio.h> |
#include "datatype.h" |
#include "datatype.h" |
#include "extern2.h" |
#include "extern2.h" |
|
|
|
void outputTable(void); |
|
|
int Homogenize = 1; |
int Homogenize = 1; |
|
|
#define I(i,j) (i*N0+j) |
#define I(i,j) (i*N0+j) |
Line 31 void initT(void) { |
|
Line 33 void initT(void) { |
|
DList = (int *)sGC_malloc(sizeof(int)*Lsize*N0); |
DList = (int *)sGC_malloc(sizeof(int)*Lsize*N0); |
MList = (int *)sGC_malloc(sizeof(int)*Lsize*N0); |
MList = (int *)sGC_malloc(sizeof(int)*Lsize*N0); |
*/ |
*/ |
DList = (int *)malloc(sizeof(int)*Lsize*N0); |
DList = (int *)sGC_malloc(sizeof(int)*Lsize*N0); |
MList = (int *)malloc(sizeof(int)*Lsize*N0); |
MList = (int *)sGC_malloc(sizeof(int)*Lsize*N0); |
|
|
RList = (POLY *)sGC_malloc(sizeof(POLY)*Lsize); |
RList = (POLY *)sGC_malloc(sizeof(POLY)*Lsize); |
RListRoot = (POLY *)sGC_malloc(sizeof(POLY)*Lsize); |
RListRoot = (POLY *)sGC_malloc(sizeof(POLY)*Lsize); |
Line 98 void monomialMult_diff(e,f) |
|
Line 100 void monomialMult_diff(e,f) |
|
/* (e) * f = [Plist] monomials */ |
/* (e) * f = [Plist] monomials */ |
{ |
{ |
|
|
int n,k,c,l,q,i,m; |
int n,k,c,l,q,i,m, weightedHomogenization; |
struct coeff *a; |
struct coeff *a; |
struct monomial tmp; |
struct monomial tmp; |
struct ring *ringp; |
struct ring *ringp; |
Line 106 void monomialMult_diff(e,f) |
|
Line 108 void monomialMult_diff(e,f) |
|
|
|
tmp.ringp = ringp = f->m->ringp; |
tmp.ringp = ringp = f->m->ringp; |
n = ringp->n; c = ringp->c; l = ringp->l; m = ringp->m; |
n = ringp->n; c = ringp->c; l = ringp->l; m = ringp->m; |
|
weightedHomogenization = ringp->weightedHomogenization; |
for (k=Plist-1; k>=0; k--) { |
for (k=Plist-1; k>=0; k--) { |
/* coeff */ |
/* coeff */ |
a = coeffCopy(CList[k]); |
a = coeffCopy(CList[k]); |
Line 115 void monomialMult_diff(e,f) |
|
Line 118 void monomialMult_diff(e,f) |
|
for (i=0; i<n; i++) { |
for (i=0; i<n; i++) { |
tmp.e[i] = f->m->e[i]; |
tmp.e[i] = f->m->e[i]; |
} |
} |
if (Homogenize) { |
if ((!weightedHomogenization) && Homogenize) { |
tmp.e[0].D += EList[k]; /* homogenization. |
if (Homogenize == 3) { |
e[0].D will be added later. */ |
tmp.e[0].D += EList[k]/2; /* Double homogenization. */ |
} |
tmp.e[0].x += EList[k]/2; /* Dx x = x Dx + h H */ |
|
}else{ |
|
tmp.e[0].D += EList[k]; /* homogenization. |
|
e[0].D will be added later. */ |
|
} |
|
}else if (weightedHomogenization && Homogenize) { |
|
tmp.e[0].D += EList[k]/2 ; /* homogenization. Weight is (1,0) (special). |
|
*/ |
|
} |
|
|
/* from m to n: Differential variables. */ |
/* from m to n: Differential variables. */ |
for (i=0; i<Maxv; i++) { |
for (i=0; i<Maxv; i++) { |
Line 214 POLY mpMult_diff(POLY f,POLY g) |
|
Line 225 POLY mpMult_diff(POLY f,POLY g) |
|
return(r); |
return(r); |
} |
} |
|
|
POLY mpMult_difference(POLY f,POLY g) |
POLY mpMult_difference_org(POLY f,POLY g) |
{ |
{ |
POLY r; |
POLY r; |
int m,l; |
int m,l; |
Line 253 POLY mpMult_difference(POLY f,POLY g) |
|
Line 264 POLY mpMult_difference(POLY f,POLY g) |
|
return(r); |
return(r); |
} |
} |
|
|
outputTable() { |
void outputTable() { |
int i,j; |
int i,j; |
printf("Maxv = %d Plist=%d\n",Maxv,Plist); |
printf("Maxv = %d Plist=%d\n",Maxv,Plist); |
for (i=0; i<Maxv; i++) printf("%5d",V[i]); |
for (i=0; i<Maxv; i++) printf("%5d",V[i]); |