| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | #pragma once | ||
| 2 | |||
| 3 | #include <cstdint> | ||
| 4 | #include <ostream> | ||
| 5 | #include <string> | ||
| 6 | #include <tuple> | ||
| 7 | #include <vector> | ||
| 8 | |||
| 9 | #include "task/include/task.hpp" | ||
| 10 | |||
| 11 | namespace sabirov_s_monte_carlo { | ||
| 12 | |||
| 13 | enum class FuncType : uint8_t { | ||
| 14 | kLinear = 0, | ||
| 15 | kSumCubes = 1, | ||
| 16 | kCosProduct = 2, | ||
| 17 | kExpNeg = 3, | ||
| 18 | kMixedPoly = 4, | ||
| 19 | kSinSum = 5, | ||
| 20 | kSqrtSum = 6, | ||
| 21 | kQuarticSum = 7, | ||
| 22 | }; | ||
| 23 | |||
| 24 | 3276 | struct MCInput { | |
| 25 | std::vector<double> lower; | ||
| 26 | std::vector<double> upper; | ||
| 27 | int num_samples; | ||
| 28 | FuncType func_type; | ||
| 29 | }; | ||
| 30 | |||
| 31 | using InType = MCInput; | ||
| 32 | using OutType = double; | ||
| 33 | using TestType = std::tuple<InType, std::string>; | ||
| 34 | using BaseTask = ppc::task::Task<InType, OutType>; | ||
| 35 | |||
| 36 | 728 | inline std::ostream &operator<<(std::ostream &os, const MCInput &in) { | |
| 37 | 1456 | os << "MCInput{func=" << static_cast<int>(in.func_type) << ",n=" << in.num_samples << ",dims=" << in.lower.size() | |
| 38 | 728 | << "}"; | |
| 39 | 728 | return os; | |
| 40 | } | ||
| 41 | |||
| 42 | } // namespace sabirov_s_monte_carlo | ||
| 43 |