ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/cv/bsdftrans.cpp
(Generate patch)

Comparing ray/src/cv/bsdftrans.cpp (file contents):
Revision 2.3 by greg, Sat Mar 29 21:51:59 2014 UTC vs.
Revision 2.4 by schorsch, Sat Mar 5 19:21:12 2016 UTC

# Line 18 | Line 18 | using namespace std;
18   extern "C" void
19   plan_transport(MIGRATION *mig)
20   {
21 <        double                  src[mtx_nrows(mig)];
22 <        double                  dst[mtx_ncols(mig)];
21 >        double                  *src;
22 >        double                  *dst;
23 >        TsFlow                  *flow;
24 >
25 >        src = new double[mtx_nrows(mig)];
26 >        dst = new double[mtx_ncols(mig)];
27 >
28          TsSignature<RBFVAL>     srcSig(mtx_nrows(mig), mig->rbfv[0]->rbfa, src);
29          TsSignature<RBFVAL>     dstSig(mtx_ncols(mig), mig->rbfv[1]->rbfa, dst);
30 <        TsFlow                  flow[mtx_nrows(mig)+mtx_ncols(mig)-1];
30 >        flow = new TsFlow[mtx_nrows(mig)+mtx_ncols(mig)-1];
31          int                     n;
32                                                  /* clear flow matrix */
33          memset(mig->mtx, 0, sizeof(float)*mtx_nrows(mig)*mtx_ncols(mig));
# Line 49 | Line 54 | plan_transport(MIGRATION *mig)
54          }
55          while (n-- > 0)                         /* assign sparse matrix */
56                  mtx_coef(mig, flow[n].from, flow[n].to) = flow[n].amount;
57 +
58 +        delete[] src;
59 +        delete[] dst;
60 +        delete[] flow;
61   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines