mirror of
https://github.com/ceres-solver/ceres-solver.git
synced 2026-08-30 00:50:37 +08:00
f11c256265
- Prior to48cb54d1, Ceres' fmin/fmax() for Jets followed the convention of std::min/max(), and always returned the first argument on equality, irrespective of whether this argument was natively a scalar or a Jet. - After48cb54d1, Ceres' fmin/fmax() instead returned the second argument on equality, again irrespective of whether this argument was natively a scalar or a Jet. - Now on equality we average the arguments as Jets, which ensures that a consistent answer is produced irrespective of the ordering or type (Jet or scalar) of the input arguments. This also ensures that we preserve a non-zero derivative where it exists, excluding the edge case of two Jet inputs with equal but oppositely signed infinitesimal components. - We retain the behaviour introduced in48cb54d1whereby NaNs are treated as missing values, following the convention of std::fmin/fmax(). - Raised as issue #816. Change-Id: I01217c0e32c1be83be440e4515b57c79dd290923