[BACK]Return to up_lm.c CVS log [TXT][DIR] Up to [local] / OpenXM_contrib2 / asir2000 / engine

Diff for /OpenXM_contrib2/asir2000/engine/up_lm.c between version 1.5 and 1.6

version 1.5, 2001/09/03 07:01:06 version 1.6, 2001/10/09 01:36:14
Line 45 
Line 45 
  * DEVELOPER SHALL HAVE NO LIABILITY IN CONNECTION WITH THE USE,   * DEVELOPER SHALL HAVE NO LIABILITY IN CONNECTION WITH THE USE,
  * PERFORMANCE OR NON-PERFORMANCE OF THE SOFTWARE.   * PERFORMANCE OR NON-PERFORMANCE OF THE SOFTWARE.
  *   *
  * $OpenXM: OpenXM_contrib2/asir2000/engine/up_lm.c,v 1.4 2001/05/09 01:41:42 noro Exp $   * $OpenXM: OpenXM_contrib2/asir2000/engine/up_lm.c,v 1.5 2001/09/03 07:01:06 noro Exp $
 */  */
 #include "ca.h"  #include "ca.h"
 #include <math.h>  #include <math.h>
Line 56  extern int debug_up;
Line 56  extern int debug_up;
 extern int up_lazy;  extern int up_lazy;
 extern int current_ff;  extern int current_ff;
   
 void crup_lm(ModNum **,int,int *,int,N,N,UP *);  void fft_mulup_lm(UP n1,UP n2,UP *nr)
   
 void fft_mulup_lm(n1,n2,nr)  
 UP n1,n2;  
 UP *nr;  
 {  {
         ModNum *f1,*f2,*w,*fr;          ModNum *f1,*f2,*w,*fr;
         ModNum *frarray[1024];          ModNum *frarray[1024];
Line 109  UP *nr;
Line 105  UP *nr;
         error("fft_mulup : FFT_primes exhausted");          error("fft_mulup : FFT_primes exhausted");
 }  }
   
 void fft_squareup_lm(n1,nr)  void fft_squareup_lm(UP n1,UP *nr)
 UP n1;  
 UP *nr;  
 {  {
         ModNum *f1,*w,*fr;          ModNum *f1,*w,*fr;
         ModNum *frarray[1024];          ModNum *frarray[1024];
Line 158  UP *nr;
Line 152  UP *nr;
         error("fft_squareup : FFT_primes exhausted");          error("fft_squareup : FFT_primes exhausted");
 }  }
   
 void trunc_fft_mulup_lm(n1,n2,dbd,nr)  void trunc_fft_mulup_lm(UP n1,UP n2,int dbd,UP *nr)
 UP n1,n2;  
 int dbd;  
 UP *nr;  
 {  {
         ModNum *f1,*f2,*fr,*w;          ModNum *f1,*f2,*fr,*w;
         ModNum *frarray[1024];          ModNum *frarray[1024];
Line 211  UP *nr;
Line 202  UP *nr;
         error("trunc_fft_mulup : FFT_primes exhausted");          error("trunc_fft_mulup : FFT_primes exhausted");
 }  }
   
 void crup_lm(f,d,mod,index,m,lm_mod,r)  void crup_lm(ModNum **f,int d,int *mod,int index,N m,N lm_mod,UP *r)
 ModNum **f;  
 int d;  
 int *mod;  
 int index;  
 N m;  
 N lm_mod;  
 UP *r;  
 {  {
         double *k;          double *k;
         double c2;          double c2;
Line 232  UP *r;
Line 216  UP *r;
         unsigned int **sum;          unsigned int **sum;
         unsigned int *sum_b;          unsigned int *sum_b;
         Q q;          Q q;
         struct oEGT eg0,eg1;  
   
         if ( !lm_mod )          if ( !lm_mod )
                 error("crup_lm : current_mod_lm is not set");                  error("crup_lm : current_mod_lm is not set");
Line 304  UP *r;
Line 287  UP *r;
         addup(s,s1,r);          addup(s,s1,r);
 }  }
   
 void fft_rembymulup_special_lm(n1,n2,inv2,nr)  void fft_rembymulup_special_lm(UP n1,UP n2,UP inv2,UP *nr)
 UP n1,n2,inv2;  
 UP *nr;  
 {  {
         int d1,d2,d;          int d1,d2,d;
         UP r1,t,s,q,u;          UP r1,t,s,q,u;
Line 329  UP *nr;
Line 310  UP *nr;
         }          }
 }  }
   
 void uptolmup(n,nr)  void uptolmup(UP n,UP *nr)
 UP n;  
 UP *nr;  
 {  {
         int i,d;          int i,d;
         Q *c;          Q *c;
Line 353  UP *nr;
Line 332  UP *nr;
         }          }
 }  }
   
 save_up(obj,name)  void save_up(UP obj,char *name)
 UP obj;  
 char *name;  
 {  {
         P p;          P p;
         Obj ret;          Obj ret;
         NODE n0,n1;          NODE n0,n1;
         STRING s;          STRING s;
           void Pbsave();
   
         uptop(obj,&p);          uptop(obj,&p);
         MKSTR(s,name);          MKSTR(s,name);
Line 368  char *name;
Line 346  char *name;
         Pbsave(n0,&ret);          Pbsave(n0,&ret);
 }  }
   
 void hybrid_powermodup(f,xp)  void hybrid_powermodup(UP f,UP *xp)
 UP f;  
 UP *xp;  
 {  {
         N n;          N n;
         UP x,y,t,invf,s;          UP x,y,t,invf,s;
         int k;          int k;
         LM lm;          LM lm;
         struct oEGT eg_sq,eg_rem,eg_mul,eg_inv,eg0,eg1,eg2,eg3;  
         char name[BUFSIZ];  
   
         getmod_lm(&n);          getmod_lm(&n);
         if ( !n )          if ( !n )
Line 401  UP *xp;
Line 375  UP *xp;
         *xp = y;          *xp = y;
 }  }
   
 void powermodup(f,xp)  void powermodup(UP f,UP *xp)
 UP f;  
 UP *xp;  
 {  {
         N n;          N n;
         UP x,y,t,invf,s;          UP x,y,t,invf,s;
         int k;          int k;
         Num c;          Num c;
         struct oEGT eg_sq,eg_rem,eg_mul,eg_inv,eg0,eg1,eg2,eg3;  
   
         if ( !current_ff )          if ( !current_ff )
                 error("powermodup : current_ff is not set");                  error("powermodup : current_ff is not set");
Line 447  UP *xp;
Line 418  UP *xp;
   
 /* g^d mod f */  /* g^d mod f */
   
 void hybrid_generic_powermodup(g,f,d,xp)  void hybrid_generic_powermodup(UP g,UP f,Q d,UP *xp)
 UP g,f;  
 Q d;  
 UP *xp;  
 {  {
         N e;          N e;
         UP x,y,t,invf,s;          UP x,y,t,invf,s;
         int k;          int k;
         LM lm;          LM lm;
         struct oEGT eg_sq,eg_rem,eg_mul,eg_inv,eg0,eg1,eg2,eg3;  
   
         e = NM(d);          e = NM(d);
         MKLM(ONEN,lm);          MKLM(ONEN,lm);
Line 484  UP *xp;
Line 451  UP *xp;
         *xp = y;          *xp = y;
 }  }
   
 void generic_powermodup(g,f,d,xp)  void generic_powermodup(UP g,UP f,Q d,UP *xp)
 UP g,f;  
 Q d;  
 UP *xp;  
 {  {
         N e;          N e;
         UP x,y,t,invf,s;          UP x,y,t,invf,s;
         int k;          int k;
         Num c;          Num c;
         struct oEGT eg_sq,eg_rem,eg_mul,eg_inv,eg0,eg1,eg2,eg3;  
   
         e = NM(d);          e = NM(d);
         one_ff(&c);          one_ff(&c);
Line 521  UP *xp;
Line 484  UP *xp;
         *xp = y;          *xp = y;
 }  }
   
 void hybrid_powertabup(f,xp,tab)  void hybrid_powertabup(UP f,UP xp,UP *tab)
 UP f;  
 UP xp;  
 UP *tab;  
 {  {
         UP y,t,invf;          UP y,t,invf;
         int i,d;          int i,d;
         LM lm;          LM lm;
         struct oEGT eg_rem,eg_mul,eg0,eg1,eg2;  
   
         d = f->d;          d = f->d;
         MKLM(ONEN,lm);          MKLM(ONEN,lm);
Line 548  UP *tab;
Line 507  UP *tab;
         }          }
 }  }
   
 void powertabup(f,xp,tab)  void powertabup(UP f,UP xp,UP *tab)
 UP f;  
 UP xp;  
 UP *tab;  
 {  {
         UP y,t,invf;          UP y,t,invf;
         int i,d;          int i,d;
         Num c;          Num c;
         struct oEGT eg_rem,eg_mul,eg0,eg1,eg2;  
   
         d = f->d;          d = f->d;
         one_ff(&c);          one_ff(&c);

Legend:
Removed from v.1.5  
changed lines
  Added in v.1.6

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>