[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Orekit Developers] DeepSDP4 Potentially unreachable code



Hi Hank,

Hank Grabowski <hank@applieddefense.com> a écrit :

I'm working on getting better code coverage on classes and have run into a
bit of a snag on the DeepSDP4 class.  There are two for loops of similiar
structure, on on line 636 and one on line 688.  Both of them essentially do:

for (int j = 0; j < SECULAR_INTEGRATION_ORDER; j += 2) {
...
   if ((j + 2) < SECULAR_INTEGRATION_ORDER)  {
      ...
   }
}


With the current constant SECULAR_INTEGRATION_ORDER  set to 2 we never get
within the if loop.  Is this there for the eventuality that the secular
integration order is increased or of variable size or is this exposing an
implementation problem?
I'm not sure. It really seems to have been done for extending to  
higher order, but looking back at the Vallado implementation, both in  
fortran and C++, I do not find the internal if, and I don't find it in  
Dundee SGP4 either. The comment in the Vallado code also states:
   the specific changes are unknown because the original code was so  
convoluted
This internal if seems to have been there right from the beginning in  
Orekit. I have tracked it at least back to commit c72f5793 in January  
2007.
I guess it was extracted from some of the reference versions we used  
at that time, but am unable to find it.
We should probably remove it, as we can't find were it come from since  
the vallado and Dundee references do not appear to have it and it is  
not reached.
Luc



----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.