| 100 | std::vector<double> iota(double d1, double d2) { return iota(d1, 1., d2); } |
| 101 | |
| 102 | std::vector<double> transform(const std::vector<double> &x, |
| 103 | std::function<double(double)> fn) { |
| 104 | std::vector<double> y(x.size()); |
| 105 | for (size_t i = 0; i < y.size(); ++i) { |
| 106 | y[i] = fn(x[i]); |
| 107 | } |
| 108 | return y; |
| 109 | } |
| 110 | |
| 111 | double truncate(double x, double lower_bound, double upper_bound) { |
| 112 | if (x <= lower_bound) { |
no test coverage detected