Changeset 09c91c1 in tol


Ignore:
Timestamp:
Feb 18, 2013, 2:41:27 PM (14 years ago)
Author:
Víctor de Buen <vdebuen@…>
Branches:
1941-docker-image-to-test, devel, master
Children:
7387675
Parents:
72f8151
Message:

Allowing multiple copies in DeepCopy

git-svn-id: ​https://www.tol-project.org/svn/tolp/trunk@5624 be4846ae-f051-483a-831f-b64e7d08527f

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tol/btol/bgrammar/spfuninst.cpp

    r72f8151 r09c91c1  
    14661466          if(uM && (uM->Grammar()==GraMatrix()))
    14671467          {
    1468             p   = uM->Contens().Data();
    1469             SAFE_DESTROY(uM,result);
     1468            BMat& M = uM->Contens();
     1469            int r = M.Rows();
     1470            int c = M.Columns();
     1471            p   = M.Data();
    14701472            pos = 0;
     1473            if(r==1)
     1474            {
     1475              DeepCopy(uS->Contens(),res->Contens(),p,pos);
     1476            }
     1477            else
     1478            {
     1479              int i;
     1480              res->Contens().PrepareStore(r);
     1481              for(i=0; i<r; i++)
     1482              {
     1483                BContensSet* res_i = new BContensSet;
     1484                DeepCopy(uS->Contens(),res_i->Contens(),p,pos);
     1485                res->Contens().AddElement(res_i);
     1486              }
     1487            }
    14711488          }
    1472         }
    1473         DeepCopy(uS->Contens(),res->Contens(),p,pos);
     1489          SAFE_DESTROY(uM,result);
     1490        }
     1491        if(pos==-1) { DeepCopy(uS->Contens(),res->Contens(),p,pos); }
    14741492        SAFE_DESTROY(toCopy,result);
    14751493      }
Note: See TracChangeset for help on using the changeset viewer.