ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/OpenMD/trunk/src/math/CubicSpline.cpp
(Generate patch)

Comparing trunk/src/math/CubicSpline.cpp (file contents):
Revision 2057 by gezelter, Tue Mar 3 15:22:26 2015 UTC vs.
Revision 2071 by gezelter, Sat Mar 7 21:41:51 2015 UTC

# Line 50 | Line 50 | using namespace std;
50   using namespace OpenMD;
51   using namespace std;
52  
53 < CubicSpline::CubicSpline() : generated(false), isUniform(true) {
53 > CubicSpline::CubicSpline() : isUniform(true), generated(false) {
54    x_.clear();
55    y_.clear();
56   }
# Line 83 | Line 83 | void CubicSpline::generate() {
83    //   d   = vector of S'''(x_[i]+)/6 values (i < n).
84    // Local variables:  
85  
86 <  RealType fp1, fpn, h, p;
86 >  RealType fp1, fpn, p;
87 >  RealType h(0.0);
88    
89    // make sure the sizes match
90    
# Line 319 | Line 320 | std::vector<int> CubicSpline::sort_permutation(std::ve
320  
321   std::vector<int> CubicSpline::sort_permutation(std::vector<RealType>& v) {
322    std::vector<int> p(v.size());
323 <  std::iota(p.begin(), p.end(), 0);
323 >
324 >  // 6 lines to replace std::iota(p.begin(), p.end(), 0);
325 >  int value = 0;
326 >  std::vector<int>::iterator i;
327 >  for (i = p.begin(); i != p.end(); ++i) {
328 >    (*i) = value;
329 >    ++value;
330 >  }
331 >  
332    std::sort(p.begin(), p.end(), OpenMD::Comparator(v) );
333    return p;
334   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines