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

Diff for /OpenXM_contrib2/asir2000/builtin/fctr.c between version 1.20 and 1.24

version 1.20, 2004/05/13 12:12:43 version 1.24, 2017/02/27 05:14:54
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/builtin/fctr.c,v 1.19 2003/01/13 06:40:40 noro Exp $   * $OpenXM: OpenXM_contrib2/asir2000/builtin/fctr.c,v 1.23 2004/07/30 07:34:40 noro Exp $
 */  */
 #include "ca.h"  #include "ca.h"
 #include "parse.h"  #include "parse.h"
Line 338  P *rp;
Line 338  P *rp;
   
 void Pptozp(arg,rp)  void Pptozp(arg,rp)
 NODE arg;  NODE arg;
 P *rp;  Obj *rp;
 {  {
         Q t;          Q t;
       NODE tt,p;
     NODE opt,tt,p;  
     NODE n,n0;      NODE n,n0;
     char *key;      char *key;
           P pp;
           LIST list;
     int get_factor=0;      int get_factor=0;
   
         asir_assert(ARG0(arg),O_P,"ptozp");          asir_assert(ARG0(arg),O_P,"ptozp");
   
     /* analyze the option */      /* analyze the option */
     if ( argc(arg) == 2 && OID(ARG1(arg)) == O_OPTLIST ) {      if ( current_option ) {
       opt = BDY((OPTLIST)ARG1(arg));        for ( tt = current_option; tt; tt = NEXT(tt) ) {
       for ( tt = opt; tt; tt = NEXT(tt) ) {  
         p = BDY((LIST)BDY(tt));          p = BDY((LIST)BDY(tt));
         key = BDY((STRING)BDY(p));          key = BDY((STRING)BDY(p));
         /*  value = (Obj)BDY(NEXT(p)); */          /*  value = (Obj)BDY(NEXT(p)); */
Line 363  P *rp;
Line 363  P *rp;
       }        }
     }      }
   
         ptozp((P)ARG0(arg),1,&t,rp);          ptozp((P)ARG0(arg),1,&t,&pp);
   
     /* printexpr(NULL,t); */      /* printexpr(NULL,t); */
         /* if the option factor is given, then it returns the answer          /* if the option factor is given, then it returns the answer
        in the format [zpoly, num] where num*zpoly is equal to the argument.*/         in the format [zpoly, num] where num*zpoly is equal to the argument.*/
     if (get_factor) {      if (get_factor) {
       n0 = n0 = 0;            n0 = mknode(2,pp,t);
       NEXTNODE(n0,n);        MKLIST(list,n0);
       BDY(n) = (pointer) *rp;            *rp = (Obj)list;
       NEXTNODE(n0,n);      } else
       BDY(n) = (pointer) t;        *rp = (Obj)pp;
       if (n0) NEXT(n) = 0;  
       MKLIST(*((LIST *)rp),n0);  
     }  
 }  }
   
 void Pafctr(arg,rp)  void Pafctr(arg,rp)
Line 441  LIST *rp;
Line 438  LIST *rp;
                 modfctrp(ARG0(arg),mod,NEWDDD,&dc);                  modfctrp(ARG0(arg),mod,NEWDDD,&dc);
         else {          else {
                 /* XXX 16384 should be replaced by a macro */                  /* XXX 16384 should be replaced by a macro */
                 for ( i = 0, t = 1; t*mod < 16384; t *= mod, i++ );                  for ( i = 1, t = mod; t*mod < 16384; t *= mod, i++ );
                 current_ff = FF_GFS;                  current_ff = FF_GFS;
                 setmod_sf(mod,i);                  setmod_sf(mod,i);
                 simp_ff((Obj)p,&u);                  simp_ff((Obj)p,&u);

Legend:
Removed from v.1.20  
changed lines
  Added in v.1.24

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