[BACK]Return to ntlconv.cpp CVS log [TXT][DIR] Up to [local] / OpenXM / src / ox_ntl

Diff for /OpenXM/src/ox_ntl/ntlconv.cpp between version 1.5 and 1.6

version 1.5, 2003/11/27 14:19:50 version 1.6, 2013/10/18 01:28:52
Line 1 
Line 1 
 /* $OpenXM: OpenXM/src/ox_ntl/ntlconv.cpp,v 1.4 2003/11/17 12:04:20 iwane Exp $ */  /* $OpenXM: OpenXM/src/ox_ntl/ntlconv.cpp,v 1.5 2003/11/27 14:19:50 iwane Exp $ */
   
 #include <NTL/ZZX.h>  #include <NTL/ZZX.h>
 #include <NTL/mat_ZZ.h>  #include <NTL/mat_ZZ.h>
   
 #include <strstream>  #include <sstream>
   #include <string>
   #include <string.h>
   
 #include "ntl.h"  #include "ntl.h"
   
Line 148  cmo_zz *
Line 150  cmo_zz *
 ZZ_to_cmo_zz(const ZZ &z)  ZZ_to_cmo_zz(const ZZ &z)
 {  {
         cmo_zz *c;          cmo_zz *c;
         char *ptr;          const char *ptr;
   
         std::ostrstream sout;          std::ostringstream sout;
         sout << z << '\0';          sout << z << '\0';
         ptr = sout.str();          std::string tmp = sout.str();
           ptr = tmp.c_str();
   
         BLOCK_NEW_CMO();          BLOCK_NEW_CMO();
         c = new_cmo_zz_set_string(ptr);          c = new_cmo_zz_set_string((char*)ptr);
         UNBLOCK_NEW_CMO();          UNBLOCK_NEW_CMO();
   
         delete [] ptr;  
   
         return (c);          return (c);
 }  }
   
Line 339  cmo_to_ZZX(ZZX &f, cmo *m, cmo_indeterminate *&x)
Line 340  cmo_to_ZZX(ZZX &f, cmo *m, cmo_indeterminate *&x)
                         return (NTL_FAILURE);                          return (NTL_FAILURE);
                 }                  }
                 {                  {
                         std::istrstream sin(str, strlen(str));                          std::istringstream sin(str);
                         sin >> f;                          sin >> f;
                 }                  }
                 break;                  break;
Line 348  cmo_to_ZZX(ZZX &f, cmo *m, cmo_indeterminate *&x)
Line 349  cmo_to_ZZX(ZZX &f, cmo *m, cmo_indeterminate *&x)
                 cmo_recursive_polynomial *rec = (cmo_recursive_polynomial *)m;                  cmo_recursive_polynomial *rec = (cmo_recursive_polynomial *)m;
                 cmo_polynomial_in_one_variable *poly = (cmo_polynomial_in_one_variable *)rec->coef;                  cmo_polynomial_in_one_variable *poly = (cmo_polynomial_in_one_variable *)rec->coef;
                 cell *el;                  cell *el;
                 int len;  
   
                 if (poly->tag != CMO_POLYNOMIAL_IN_ONE_VARIABLE) {                  if (poly->tag != CMO_POLYNOMIAL_IN_ONE_VARIABLE) {
                         return (NTL_FAILURE);                          return (NTL_FAILURE);
                 }                  }
   
                 el = list_first((cmo_list *)poly);                  el = list_first((cmo_list *)poly);
                 len = list_length((cmo_list *)poly);  
   
                 f = 0;                  f = 0;
   
Line 495  vec_pair_ZZX_long_to_cmo(vec_pair_ZZX_long &factors, c
Line 494  vec_pair_ZZX_long_to_cmo(vec_pair_ZZX_long &factors, c
 cmo *  cmo *
 convert_cmon(cmo *p)  convert_cmon(cmo *p)
 {  {
   
         switch (p->tag) {          switch (p->tag) {
         case CMON_ZZ:          case CMON_ZZ:
         {          {

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

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