| 98 | } |
| 99 | |
| 100 | void generateRandomData(int N, |
| 101 | std::vector<double> ×, |
| 102 | PointsMatrix3D &all_points, |
| 103 | Eigen::Matrix3Xd &inner_points_mat, |
| 104 | Eigen::MatrixXd &inner_points_ref_format) // 3x(N-1) |
| 105 | { |
| 106 | std::random_device rd; |
| 107 | std::mt19937 gen(rd()); |
| 108 | std::uniform_real_distribution<> dis_t(0.5, 2.0); |
| 109 | std::uniform_real_distribution<> dis_p(-10.0, 10.0); |
| 110 | |
| 111 | times.resize(N); |
| 112 | all_points.resize(N + 1, 3); |
| 113 | inner_points_mat.resize(3, N - 1); |
| 114 | |
| 115 | for (int i = 0; i < N; ++i) |
| 116 | times[i] = dis_t(gen); |
| 117 | |
| 118 | for (int i = 0; i <= N; ++i) |
| 119 | { |
| 120 | all_points.row(i) = Eigen::Vector3d(dis_p(gen), dis_p(gen), dis_p(gen)).transpose(); |
| 121 | if (i > 0 && i < N) |
| 122 | { |
| 123 | inner_points_mat.col(i - 1) = all_points.row(i).transpose(); |
| 124 | } |
| 125 | } |
| 126 | inner_points_ref_format = inner_points_mat; |
| 127 | } |
| 128 | |
| 129 | // --------------------------------------------------------- |
| 130 | // Test 1: Cubic Spline (Min Acc) vs MINCO S2 |
no test coverage detected