Fix 32-bit overflow in Jacobian size checks BlockJacobianWriter and CompressedRowJacobianWriter both computed num_residuals * TangentSize() in 32-bit int and accumulated entry counts in 32-bit unsigned int before checking against INT_MAX. In BlockJacobianWriter::BuildJacobianLayout, count both E-block and total entries in int64_t during the first pass and reject Jacobians over INT_MAX before allocating layout storage. Once the first pass succeeds, the second pass stays entirely in int. In CompressedRowJacobianWriter::CreateJacobian, accumulate num_jacobian_nonzeros in int64_t. Update evaluator_test to: - Exceed INT_MAX total entries using 10,000 blocks of size 500x500 (avoiding a 32-bit overflow in Program::MaxDerivativesPerResidualBlock) and cover all-F, split E+F, and all-E overflow in BlockJacobianWriter. - Test a single 46341x46345 block directly on both Jacobian writers so the 64-bit per-block product check stays covered under UBSan. Change-Id: I4fbb774d6605c315abc79b351a5c1fee61ddcd63
Ceres Solver is an open source C++ library for modeling and solving large, complicated optimization problems. It is a feature rich, mature and performant library which has been used in production at Google since 2010. Ceres Solver can solve two kinds of problems.
Please see the Ceres Solver website for more information.