Open denisrosset opened 7 years ago
Ok.... there are a few issues.
the dual numbers are a proper algebraic structure (see https://en.wikipedia.org/wiki/Dual_number ). Division is only defined when the real part of the denominator is nonzero. So they do not form a division ring. But they are a genuine ring, of course non ordered.
you can use dual numbers in code that expects a real scalar; you then pretend to operate as a real number, while applying the differentiation rules. In that case, you want to pretend that Jet[Real]
is ordered.
Jet also inherits the ScalaNumeric
stuff, with ugly hacks to perform arithmetic on Any
.
The implementation is however good and well-commented. It should be split into parts to correspond to the different functions described above.
The status of
Jet
is unclear. There are conflicting indications that:Jet
is intended to be a substitute of a real number in computations, so that derivatives can be automatically recovered at the end. ThusJet
hasField
,Order
instances ... even if those instances are not lawful. In that case, theOrder
comparisons should be done on the non-infinitesimal part only.Jet
is an implementation ofn
-dimensional dual numbers, and is thus an algebra over the real numbers. In that case, noOrder
instance should exist, because dual numbers, as ad > 1
vector space, do not have a total order.