Hipparchus-Math / hipparchus

An efficient, general-purpose mathematics components library in the Java programming language
Apache License 2.0
142 stars 41 forks source link

Add a method to check if derivatives are null in interface `Derivative` #267

Closed MaximeJo closed 1 year ago

MaximeJo commented 1 year ago

For performance reasons (see for example Orekit issue 1151) it could be nice to be able to check if a Derivative has zero values in all its derivative field.

MaximeJo commented 1 year ago

Actually, there's an elegant method suggested by @Serrof to achieve this goal.

Using this.subtract(this.getReal()).isZero(); returns true if derivatives are null and is more generic (can apply to Complex).

So I'm closing this issue.