Changeset ffd883 in git


Ignore:
Timestamp:
Sep 11, 2013, 4:25:46 PM (10 years ago)
Author:
Martin Lee <martinlee84@…>
Branches:
(u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'f875bbaccd0831e36aaed09ff6adeb3eb45aeb94')
Children:
63c9a7737466fd0b090092ded4895b1b0ce064fb
Parents:
19efd96f592d18d6236472804d562b3ed5432bcd
git-author:
Martin Lee <martinlee84@web.de>2013-09-11 16:25:46+02:00
git-committer:
Martin Lee <martinlee84@web.de>2013-09-11 21:48:24+02:00
Message:
fix: memory leaks in factorization
Location:
factory
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • factory/facAbsBiFact.cc

    r19efd96 rffd883  
    483483
    484484    On (SW_SYMMETRIC_FF);
    485     CFMatrix M= CFMatrix (s, s);
    486     M(s,s)= power (CanonicalForm (p), k);
     485    CFMatrix *M= new CFMatrix (s, s);
     486    (*M)(s,s)= power (CanonicalForm (p), k);
    487487    for (int j= 1; j < s; j++)
    488488    {
    489       M (j,j)= 1;
    490       M (j+1,j)= -liftedSmallestFactor;
    491     }
    492 
    493     mat_ZZ NTLM= *convertFacCFMatrix2NTLmat_ZZ (M);
     489      (*M) (j,j)= 1;
     490      (*M) (j+1,j)= -liftedSmallestFactor;
     491    }
     492
     493    mat_ZZ * NTLM= convertFacCFMatrix2NTLmat_ZZ (*M);
    494494
    495495    ZZ det;
    496496
    497     transpose (NTLM, NTLM);
    498     (void) LLL (det, NTLM, 1L, 1L); //use floating point LLL ?
    499     transpose (NTLM, NTLM);
    500     M= *convertNTLmat_ZZ2FacCFMatrix (NTLM);
     497    transpose (*NTLM, *NTLM);
     498    (void) LLL (det, *NTLM, 1L, 1L); //use floating point LLL ?
     499    transpose (*NTLM, *NTLM);
     500    delete M;
     501    M= convertNTLmat_ZZ2FacCFMatrix (*NTLM);
     502    delete NTLM;
    501503
    502504    mipo= 0;
    503505    for (int j= 1; j <= s; j++)
    504       mipo += M (j,1)*power (x,s-j);
    505 
     506      mipo += (*M) (j,1)*power (x,s-j);
     507
     508    delete M;
    506509    mipoFactors= factorize (mipo);
    507510    if (mipoFactors.getFirst().factor().inCoeffDomain())
  • factory/facFqBivar.cc

    r19efd96 rffd883  
    24272427        transpose (NTLK, NTLK);
    24282428        NTLN *= NTLK;
     2429        delete NTLC;
    24292430
    24302431        if (NTLN.NumCols() == 1)
     
    27512752        transpose (NTLK, NTLK);
    27522753        NTLN *= NTLK;
     2754        delete NTLC;
    27532755
    27542756        if (GF)
     
    27672769      }
    27682770    }
     2771
     2772    delete NTLMat;
    27692773
    27702774    if (NTLN.NumCols() == 1)
     
    30943098        transpose (NTLK, NTLK);
    30953099        NTLN *= NTLK;
     3100        delete NTLC;
    30963101
    30973102        if (NTLN.NumCols() == 1)
     
    32623267        transpose (NTLK, NTLK);
    32633268        NTLN *= NTLK;
     3269        delete NTLC;
    32643270#endif
    32653271
     
    34293435        transpose (NTLK, NTLK);
    34303436        NTLN *= NTLK;
     3437        delete NTLC;
    34313438#endif
    34323439#ifdef HAVE_FLINT
     
    36023609        transpose (NTLK, NTLK);
    36033610        NTLN *= NTLK;
     3611        delete NTLC;
    36043612        if (NTLN.NumCols() == 1)
    36053613        {
     
    38023810        transpose (NTLK, NTLK);
    38033811        NTLN *= NTLK;
     3812        delete NTLC;
    38043813
    38053814        if (GF)
     
    38123821          CFList source, dest;
    38133822          tmp= mapDown (tmp, info, source, dest);
     3823          delete NTLMat;
    38143824          delete [] A;
    38153825          delete [] bounds;
     
    38193829      }
    38203830    }
     3831
     3832    delete NTLMat;
    38213833
    38223834    if (NTLN.NumCols() < oldNumCols - factorsFound)
     
    39513963        transpose (NTLK, NTLK);
    39523964        NTLN *= NTLK;
     3965        delete NTLC;
     3966
    39533967        if (NTLN.NumCols() == 1)
    39543968        {
     
    41124126        transpose (NTLK, NTLK);
    41134127        NTLN *= NTLK;
     4128        delete NTLC;
    41144129#endif
    41154130#ifdef HAVE_FLINT
     
    43174332        transpose (NTLK, NTLK);
    43184333        NTLN *= NTLK;
     4334        delete NTLC;
    43194335#endif
    43204336#ifdef HAVE_FLINT
     
    44364452        transpose (NTLK, NTLK);
    44374453        NTLN *= NTLK;
     4454        delete NTLC;
     4455
    44384456        if (NTLN.NumCols() == 1)
    44394457        {
     
    45944612        transpose (NTLK, NTLK);
    45954613        NTLN *= NTLK;
     4614        delete NTLC;
    45964615
    45974616        if (GF)
     
    46054624          tmp= mapDown (tmp, info, source, dest);
    46064625          delete [] A;
     4626          delete NTLMat;
    46074627          return CFList (tmp);
    46084628        }
    46094629      }
    46104630    }
     4631
     4632    delete NTLMat;
     4633
    46114634    if (NTLN.NumCols() == 1)
    46124635    {
     
    47554778        transpose (NTLK, NTLK);
    47564779        NTLN *= NTLK;
     4780        delete NTLC;
    47574781#endif
    47584782#ifdef HAVE_FLINT
     
    49204944        transpose (NTLK, NTLK);
    49214945        NTLN *= NTLK;
     4946        delete NTLC;
    49224947#endif
    49234948#ifdef HAVE_FLINT
     
    50995124        transpose (NTLK, NTLK);
    51005125        NTLN *= NTLK;
     5126        delete NTLC;
    51015127        if (NTLN.NumCols() == 1)
    51025128        {
     
    52935319        transpose (NTLK, NTLK);
    52945320        NTLN *= NTLK;
     5321        delete NTLC;
    52955322        if (GF)
    52965323          setCharacteristic (getCharacteristic(), degMipo, info.getGFName());
     
    53035330      }
    53045331    }
     5332    delete NTLMat;
    53055333    if (NTLN.NumCols() == 1)
    53065334    {
     
    54885516        transpose (NTLK, NTLK);
    54895517        NTLN *= NTLK;
     5518        delete NTLC;
    54905519#endif
    54915520#ifdef HAVE_FLINT
Note: See TracChangeset for help on using the changeset viewer.