| 42 | namespace ceres::internal { |
| 43 | |
| 44 | bool IsArrayValid(const int64_t size, const double* x) { |
| 45 | if (x != nullptr) { |
| 46 | for (int64_t i = 0; i < size; ++i) { |
| 47 | if (!std::isfinite(x[i]) || (x[i] == kImpossibleValue)) { |
| 48 | return false; |
| 49 | } |
| 50 | } |
| 51 | } |
| 52 | return true; |
| 53 | } |
| 54 | |
| 55 | int64_t FindInvalidValue(const int64_t size, const double* x) { |
| 56 | if (x == nullptr) { |