commit
be766ae80f
2 changed files with 12 additions and 8 deletions
|
|
@ -27,7 +27,7 @@ jobs:
|
||||||
script: .travis/script_test.sh
|
script: .travis/script_test.sh
|
||||||
|
|
||||||
- name: "Linux arm64 tests"
|
- name: "Linux arm64 tests"
|
||||||
arch: amd64
|
arch: arm64
|
||||||
addons:
|
addons:
|
||||||
apt:
|
apt:
|
||||||
packages:
|
packages:
|
||||||
|
|
|
||||||
|
|
@ -79,20 +79,24 @@ Curve Curve::buildPredefinedCurve(int index)
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
for (unsigned i = 0; i < NumValues; ++i) {
|
for (unsigned i = 0; i < NumValues; ++i) {
|
||||||
double x = i * (1.0 / (NumValues - 1));
|
double x = i / static_cast<double>(NumValues - 1);
|
||||||
curve._points[i] = x * x;
|
curve._points[i] = x * x;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 5:
|
case 5:
|
||||||
for (unsigned i = 0; i < NumValues; ++i) {
|
curve._points[0] = 0.0;
|
||||||
double x = i * (1.0 / (NumValues - 1));
|
curve._points[NumValues - 1] = 1.0;
|
||||||
curve._points[i] = std::pow(x, 0.5);
|
for (unsigned i = 1; i < NumValues - 1; ++i) {
|
||||||
|
double x = i / static_cast<double>(NumValues - 1);
|
||||||
|
curve._points[i] = std::sqrt(x);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 6:
|
case 6:
|
||||||
for (unsigned i = 0; i < NumValues; ++i) {
|
curve._points[0] = 1.0;
|
||||||
double x = i * (1.0 / (NumValues - 1));
|
curve._points[NumValues - 1] = 0.0;
|
||||||
curve._points[i] = std::pow(1.0 - x, 0.5);
|
for (unsigned i = 1; i < NumValues - 1; ++i) {
|
||||||
|
double x = i / static_cast<double>(NumValues - 1);
|
||||||
|
curve._points[i] = std::sqrt(1.0 - x);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue