Revert C++17 usage of std::exclusive_scan * Unfortunately on some systems such as the Nvidia Jetson, while the compiler supports C++17, the STL implementations are incomplete. One such missing implementation is std::exclusive_scan, so this patch reverts to the old way of manually computing prefix sums. Change-Id: I4192257519b0083560a4b44e2659ee44d7421105
diff --git a/include/ceres/product_manifold.h b/include/ceres/product_manifold.h index 856c453..1666fac 100644 --- a/include/ceres/product_manifold.h +++ b/include/ceres/product_manifold.h
@@ -257,7 +257,13 @@ template <typename T, std::size_t N> static std::array<T, N> ExclusiveScan(const std::array<T, N>& values) { std::array<T, N> result; - std::exclusive_scan(values.begin(), values.end(), result.begin(), 0); + // TODO Replace with std::exclusive_scan once all platforms have full C++17 + // STL support. + T init = 0; + for (std::size_t i = 0; i != N; ++i) { + result[i] = init; + init += values[i]; + } return result; }