[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.18 and 1.22

version 1.18, 2003/01/06 01:16:38 version 1.22, 2004/05/14 09:20:56
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.17 2003/01/04 09:06:16 noro Exp $   * $OpenXM: OpenXM_contrib2/asir2000/builtin/fctr.c,v 1.21 2004/05/13 14:02:16 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 n,n0;
       char *key;
           P pp;
           LIST list;
       int get_factor=0;
   
         asir_assert(ARG0(arg),O_P,"ptozp");          asir_assert(ARG0(arg),O_P,"ptozp");
         ptozp((P)ARG0(arg),1,&t,rp);  
       /* analyze the option */
       if ( current_option ) {
         for ( tt = current_option; tt; tt = NEXT(tt) ) {
           p = BDY((LIST)BDY(tt));
           key = BDY((STRING)BDY(p));
           /*  value = (Obj)BDY(NEXT(p)); */
           if ( !strcmp(key,"factor") )  get_factor=1;
           else {
             error("ptozp: unknown option.");
           }
         }
       }
   
           ptozp((P)ARG0(arg),1,&t,&pp);
   
       /* printexpr(NULL,t); */
           /* if the option factor is given, then it returns the answer
          in the format [zpoly, num] where num*zpoly is equal to the argument.*/
       if (get_factor) {
             n0 = mknode(2,pp,t);
         MKLIST(list,n0);
             *rp = (Obj)list;
       } else
         *rp = (Obj)pp;
 }  }
   
 void Pafctr(arg,rp)  void Pafctr(arg,rp)
Line 402  LIST *rp;
Line 432  LIST *rp;
                 error("modfctr : invalid modulus");                  error("modfctr : invalid modulus");
         p = (P)ARG0(arg);          p = (P)ARG0(arg);
         clctv(CO,p,&vl);          clctv(CO,p,&vl);
         if ( !NEXT(vl) )          if ( !vl ) {
                   NEWDC(dc); COEF(dc) = p; DEG(dc) = ONE; NEXT(dc) = 0;
           } else if ( !NEXT(vl) )
                 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 */

Legend:
Removed from v.1.18  
changed lines
  Added in v.1.22

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