Changeset 1e5bbd7 in git


Ignore:
Timestamp:
Sep 11, 2013, 5:08:08 PM (11 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'spielwiese', '5b153614cbc72bfa198d75b1e9e33dab2645d9fe')
Children:
4c882fb60d7ba637abe2966f73c796be805cfcc7
Parents:
6b78289a8dba923a7ab1eef981cfa76e2a719def142afdb13c43074bd1d8e25bc17989486e397819
Message:
Merge pull request #366 from mmklee/memory_sw

Memory sw
Files:
2 deleted
7 edited

Legend:

Unmodified
Added
Removed
  • Singular/links/s_buff.h

    r142afd r1e5bbd7  
    3030int s_isready(s_buff F);
    3131int s_iseof(s_buff F);
    32 
    33 extern sigset_t ssi_sigmask; // set in ssiLink.cc
    34 extern sigset_t ssi_oldmask; // set in ssiLink.cc
    3532#endif
  • Singular/links/silink.cc

    r142afd r1e5bbd7  
    136136    if (SI_LINK_OPEN_P(l))
    137137    {
    138       if (l->m->Kill != NULL) l->m->Kill(l);
    139       else if (l->m->Close != NULL) l->m->Close(l);
    140     }
     138      if (l->m->Close != NULL) l->m->Close(l);
     139    }
     140    if ((l->data != NULL) && (l->m->Kill != NULL)) l->m->Kill(l);
    141141    omFree((ADDRESS)l->name);
    142142    omFree((ADDRESS)l->mode);
  • factory/cf_factor.cc

    r6b7828 r1e5bbd7  
    455455          {
    456456            fac_NTL_char = getCharacteristic();
    457             #ifndef NTL_ZZ
    458             if (fac_NTL_char > NTL_SP_BOUND)
    459             {
    460               ZZ r;
    461               r=getCharacteristic();
    462               ZZ_pContext ccc(r);
    463               ccc.restore();
    464               ZZ_p::init(r);
    465             }
    466             else
    467             #endif
    468             {
    469               #ifdef NTL_ZZ
    470               ZZ r;
    471               r=getCharacteristic();
    472               ZZ_pContext ccc(r);
    473               #else
    474               zz_pContext ccc(getCharacteristic());
    475               #endif
    476               ccc.restore();
    477               #ifdef NTL_ZZ
    478               ZZ_p::init(r);
    479               #else
    480               zz_p::init(getCharacteristic());
    481               #endif
    482             }
     457            zz_p::init(getCharacteristic());
    483458          }
    484           #ifndef NTL_ZZ
    485           if (fac_NTL_char > NTL_SP_BOUND)
    486           {
    487             // convert to NTL
    488             ZZ_pX f1=convertFacCF2NTLZZpX(f);
    489             ZZ_p leadcoeff = LeadCoeff(f1);
    490             //make monic
    491             f1=f1 / LeadCoeff(f1);
    492             // factorize
    493             vec_pair_ZZ_pX_long factors;
    494             CanZass(factors,f1);
    495             // convert back to factory
    496             F=convertNTLvec_pair_ZZpX_long2FacCFFList(factors,leadcoeff,f.mvar());
    497           }
    498           else
    499           #endif
    500           {
    501             // convert to NTL
    502             #ifdef NTL_ZZ
    503             ZZ_pX f1=convertFacCF2NTLZZpX(f);
    504             ZZ_p leadcoeff = LeadCoeff(f1);
    505             #else
    506             zz_pX f1=convertFacCF2NTLzzpX(f);
    507             zz_p leadcoeff = LeadCoeff(f1);
    508             #endif
    509             //make monic
    510             f1=f1 / LeadCoeff(f1);
    511             // factorize
    512             #ifdef NTL_ZZ
    513             vec_pair_ZZ_pX_long factors;
    514             #else
    515             vec_pair_zz_pX_long factors;
    516             #endif
    517             CanZass(factors,f1);
    518             // convert back to factory
    519             #ifdef NTL_ZZ
    520             F=convertNTLvec_pair_ZZpX_long2FacCFFList(factors,leadcoeff,f.mvar());
    521             #else
    522             F=convertNTLvec_pair_zzpX_long2FacCFFList(factors,leadcoeff,f.mvar());
    523             #endif
    524           }
     459
     460          // convert to NTL
     461          zz_pX f1=convertFacCF2NTLzzpX(f);
     462          zz_p leadcoeff = LeadCoeff(f1);
     463
     464          //make monic
     465          f1=f1 / LeadCoeff(f1);
     466          // factorize
     467          vec_pair_zz_pX_long factors;
     468          CanZass(factors,f1);
     469
     470          F=convertNTLvec_pair_zzpX_long2FacCFFList(factors,leadcoeff,f.mvar());
    525471          //test_cff(F,f);
    526472        }
     
    716662        {
    717663          fac_NTL_char = getCharacteristic();
    718           #ifdef NTL_ZZ
    719           ZZ r;
    720           r=getCharacteristic();
    721           ZZ_pContext ccc(r);
    722           #else
    723           zz_pContext ccc(getCharacteristic());
    724           #endif
    725           ccc.restore();
    726           #ifdef NTL_ZZ
    727           ZZ_p::init(r);
    728           #else
    729664          zz_p::init(getCharacteristic());
    730           #endif
    731665        }
    732666
    733667        // set minimal polynomial in NTL
    734         #ifdef NTL_ZZ
    735         ZZ_pX minPo=convertFacCF2NTLZZpX(getMipo(alpha));
    736         ZZ_pEContext c(minPo);
    737         #else
    738668        zz_pX minPo=convertFacCF2NTLzzpX(getMipo(alpha));
    739         zz_pEContext c(minPo);
    740         #endif
    741 
    742         c.restore();
     669        zz_pE::init (minPo);
    743670
    744671        // convert to NTL
    745         #ifdef NTL_ZZ
    746         ZZ_pEX f1=convertFacCF2NTLZZ_pEX(f,minPo);
    747         ZZ_pE leadcoeff= LeadCoeff(f1);
    748         #else
    749672        zz_pEX f1=convertFacCF2NTLzz_pEX(f,minPo);
    750673        zz_pE leadcoeff= LeadCoeff(f1);
    751         #endif
    752674
    753675        //make monic
     
    755677
    756678        // factorize using NTL
    757         #ifdef NTL_ZZ
    758         vec_pair_ZZ_pEX_long factors;
    759         #else
    760679        vec_pair_zz_pEX_long factors;
    761         #endif
    762680        CanZass(factors,f1);
    763681
    764682        // return converted result
    765         #ifdef NTL_ZZ
    766         F=convertNTLvec_pair_ZZpEX_long2FacCFFList(factors,leadcoeff,f.mvar(),alpha);
    767         #else
    768683        F=convertNTLvec_pair_zzpEX_long2FacCFFList(factors,leadcoeff,f.mvar(),alpha);
    769         #endif
    770684      }
    771685      else if (/*getCharacteristic()*/ch==2)
     
    774688
    775689        // remainder is two ==> nothing to do
    776         // set remainder
    777         ZZ r;
    778         r=getCharacteristic();
    779         ZZ_pContext ccc(r);
    780         ccc.restore();
    781690
    782691        // set minimal polynomial in NTL using the optimized conversion routines for characteristic 2
    783692        GF2X minPo=convertFacCF2NTLGF2X(getMipo(alpha,f.mvar()));
    784         GF2EContext c(minPo);
    785         c.restore();
     693        GF2E::init (minPo);
    786694
    787695        // convert to NTL again using the faster conversion routines
  • factory/cf_gcd.cc

    r6b7828 r1e5bbd7  
    342342    {
    343343      fac_NTL_char=getCharacteristic();
    344       #ifdef NTL_ZZ
    345       ZZ r;
    346       r=getCharacteristic();
    347       ZZ_pContext ccc(r);
    348       #else
    349       zz_pContext ccc(getCharacteristic());
    350       #endif
    351       ccc.restore();
    352       #ifdef NTL_ZZ
    353       ZZ_p::init(r);
    354       #else
    355344      zz_p::init(getCharacteristic());
    356       #endif
    357     }
    358     #ifdef NTL_ZZ
    359     ZZ_pX F1=convertFacCF2NTLZZpX(f);
    360     ZZ_pX G1=convertFacCF2NTLZZpX(g);
    361     ZZ_pX R;
    362     ZZ_pX A,B;
    363     XGCD(R,A,B,F1,G1);
    364     a=convertNTLZZpX2CF(A,f.mvar());
    365     b=convertNTLZZpX2CF(B,f.mvar());
    366     return convertNTLZZpX2CF(R,f.mvar());
    367     #else
     345    }
    368346    zz_pX F1=convertFacCF2NTLzzpX(f);
    369347    zz_pX G1=convertFacCF2NTLzzpX(g);
     
    374352    b=convertNTLzzpX2CF(B,f.mvar());
    375353    return convertNTLzzpX2CF(R,f.mvar());
    376     #endif
    377354  }
    378355#endif
     
    11281105  {
    11291106    fac_NTL_char=getCharacteristic();
    1130     #ifdef NTL_ZZ
    1131     ZZ r;
    1132     r=getCharacteristic();
    1133     ZZ_pContext ccc(r);
    1134     #else
    1135     zz_pContext ccc(getCharacteristic());
    1136     #endif
    1137     ccc.restore();
    1138     #ifdef NTL_ZZ
    1139     ZZ_p::init(r);
    1140     #else
    11411107    zz_p::init(getCharacteristic());
    1142     #endif
    1143   }
    1144   #ifdef NTL_ZZ
    1145   ZZ_pX F1=convertFacCF2NTLZZpX(F);
    1146   ZZ_pX G1=convertFacCF2NTLZZpX(G);
    1147   ZZ_pX R=GCD(F1,G1);
    1148   return  convertNTLZZpX2CF(R,F.mvar());
    1149   #else
     1108  }
    11501109  zz_pX F1=convertFacCF2NTLzzpX(F);
    11511110  zz_pX G1=convertFacCF2NTLzzpX(G);
    11521111  zz_pX R=GCD(F1,G1);
    11531112  return  convertNTLzzpX2CF(R,F.mvar());
    1154   #endif
    11551113}
    11561114#endif
  • factory/cf_gcd_smallp.cc

    r6b7828 r1e5bbd7  
    17211721  long rk= nmod_mat_rref (FLINTN);
    17221722
     1723  delete N;
    17231724  N= convertNmod_mat_t2FacCFMatrix (FLINTN);
    1724   delete N;
    17251725  nmod_mat_clear (FLINTN);
    17261726#else
     
    17721772  long rk= gauss (*NTLN);
    17731773
     1774  delete N;
    17741775  N= convertNTLmat_zz_pE2FacCFMatrix (*NTLN, alpha);
     1776
     1777  delete NTLN;
    17751778
    17761779  M= (*N) (1, M.rows(), 1, M.columns());
     
    18171820#ifdef HAVE_FLINT
    18181821    nmod_mat_clear (FLINTN);
     1822#else
     1823    delete NTLN;
    18191824#endif
    18201825    return CFArray();
     
    18561861  mat_zz_pE *NTLN= convertFacCFMatrix2NTLmat_zz_pE(*N);
    18571862  long rk= gauss (*NTLN);
     1863
     1864  delete N;
    18581865  if (rk != M.columns())
    18591866  {
    1860     delete N;
     1867    delete NTLN;
    18611868    return CFArray();
    18621869  }
    18631870  N= convertNTLmat_zz_pE2FacCFMatrix (*NTLN, alpha);
     1871
     1872  delete NTLN;
    18641873
    18651874  CFArray A= readOffSolution (*N, rk);
  • kernel/mod2.h.cmake.in

    r142afd r1e5bbd7  
    261261 * Miscellanous Defines
    262262 ******************************************************************/
    263 /* Under HPUX 9, system(...) returns -1 if SIGCHLD does not equal
    264    SIG_DFL. However, if it stays at SIG_DFL we get zombie processes
    265    for terminated childs generated by fork. Therefors some special treatment
    266    is necessary */
    267 #ifdef HPUX_9
    268 #include <stdlib.h>
    269 #define system hpux9_system
    270 #ifdef __cplusplus
    271 extern "C" {
    272 #endif
    273 int hpux9_system(const char* system);
    274 #ifdef __cplusplus
    275 }
    276 #endif
    277 #endif
    278 
    279263#ifndef HAVE_LIBPARSER
    280264#  undef YYLPDEBUG
  • kernel/structs.h

    r142afd r1e5bbd7  
    8989extern "C" {
    9090#endif
    91 void  m2_end(int i) __attribute__((noreturn));
     91void  m2_end(int i);
    9292#ifdef __cplusplus
    9393}
Note: See TracChangeset for help on using the changeset viewer.