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 |
|
} |
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 |
|
|
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 |
|
} |