Log In | Get Help   
Home My Page Projects Code Snippets Project Openings Mareframe
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files
[mareframe] Diff of /trunk/gadget/conversionindex.cc
[mareframe] / trunk / gadget / conversionindex.cc Repository:
ViewVC logotype

Diff of /trunk/gadget/conversionindex.cc

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 3, Thu Apr 30 12:52:16 2015 UTC revision 4, Thu Apr 30 17:32:47 2015 UTC
# Line 142  Line 142 
142    
143  //The function interpolates values calculated on a coarse length distribution  //The function interpolates values calculated on a coarse length distribution
144  //Vc to a finer length distribution Vf using the conversionindex CI  //Vc to a finer length distribution Vf using the conversionindex CI
 void ConversionIndex::interpolateLengths(DoubleVector& Vf, const DoubleVector& Vc) {  
   
   if (!interpolate)  
     handle.logMessage(LOGFAIL, "Error in conversionindex - cannot interpolate between lengthgroups");  
   
   int i;  
   if (samedl) {  
     if (minlength > 0)  
       for (i = 0; i < minlength; i++)  
         Vf[i] = Vc[0];  
   
     for (i = minlength; i < maxlength; i++)  
       Vf[i] = Vc[i + offset];  
   
     if (maxlength < Vf.Size())  
       for (i = maxlength; i < Vf.Size(); i++)  
         Vf[i] = Vc[Vc.Size() - 1];  
   
   } else {  
     for (i = 0; i < Vf.Size(); i++) {  
       if (isEqual(iratio[i], -1.0))  
         Vf[i] = Vc[ipos[i]];  
       else  
         Vf[i] = (Vc[ipos[i]] * (1.0 - iratio[i])) + (Vc[ipos[i] + 1] * iratio[i]);  
     }  
   }  
 }  
   
   
   
145  void ConversionIndex::interpolateLengths(DoubleVector& Vf, const double* Vc, int size) {  void ConversionIndex::interpolateLengths(DoubleVector& Vf, const double* Vc, int size) {
146    
147    if (!interpolate)    if (!interpolate)
# Line 186  Line 156 
156      for (i = minlength; i < maxlength; i++)      for (i = minlength; i < maxlength; i++)
157        Vf[i] = Vc[i + offset];        Vf[i] = Vc[i + offset];
158    
     //int size = sizeof(Vc)/sizeof(double*);  
   
159      if (maxlength < Vf.Size())      if (maxlength < Vf.Size())
160        for (i = maxlength; i < Vf.Size(); i++)        for (i = maxlength; i < Vf.Size(); i++)
161          Vf[i] = Vc[size - 1];          Vf[i] = Vc[size - 1];

Legend:
Removed from v.3  
changed lines
  Added in v.4

root@forge.cesga.es
ViewVC Help
Powered by ViewVC 1.0.0  

Powered By FusionForge