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/lengthgroup.cc
[mareframe] / trunk / gadget / lengthgroup.cc Repository:
ViewVC logotype

Diff of /trunk/gadget/lengthgroup.cc

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

revision 1, Mon Feb 10 17:09:07 2014 UTC revision 2, Wed Apr 29 12:55:30 2015 UTC
# Line 2  Line 2 
2  #include "errorhandler.h"  #include "errorhandler.h"
3  #include "gadget.h"  #include "gadget.h"
4  #include "global.h"  #include "global.h"
5    #include "mathfunc.h"
6  //Constructor for length division with even increments  //Constructor for length division with even increments
7  LengthGroupDivision::LengthGroupDivision(double MinL, double MaxL, double DL) : error(0), Dl(DL) {  LengthGroupDivision::LengthGroupDivision(double MinL, double MaxL, double DL) : error(0), Dl(DL) {
8    if ((MaxL < MinL) || (MinL < 0.0) || (Dl < verysmall)) {    if ((MaxL < MinL) || (MinL < 0.0) || (Dl < verysmall)) {
# Line 90  Line 91 
91    return -1;    return -1;
92  }  }
93    
 double LengthGroupDivision::meanLength(int i) const {  
   if (i >= size)  
     return meanlength[size - 1];  
   return meanlength[i];  
 }  
   
94  double LengthGroupDivision::minLength(int i) const {  double LengthGroupDivision::minLength(int i) const {
95    if (i >= size)    if (i >= size)
96      return minlength[size - 1];      return minlength[size - 1];
# Line 243  Line 238 
238    }    }
239    return 1;    return 1;
240  }  }
241    
242    
243    double* const LengthGroupDivision::meanlengthvecPow_initilize(
244                    int maxlengthgroupgrowth, double tmpPower) const
245    {
246    
247            double * meanlength_vectorPow = new double[size + maxlengthgroupgrowth];
248            double aux;
249            int lgroup;
250            for (lgroup = 0; lgroup < size; lgroup++)
251                    meanlength_vectorPow[lgroup] = pow(meanLength(lgroup), tmpPower);
252            aux = meanlength_vectorPow[size-1];
253            for (lgroup = size; lgroup < size+maxlengthgroupgrowth; lgroup++)
254                    meanlength_vectorPow[lgroup] = aux;
255    
256            return meanlength_vectorPow;
257    }

Legend:
Removed from v.1  
changed lines
  Added in v.2

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

Powered By FusionForge