[ODE] Improved QuickStep stability...?
Adam D. Moss
adam at gimp.org
Wed May 19 10:55:19 MST 2004
This updated patch does the same thing, just a bit
quicker.
--Adam
-------------- next part --------------
Index: quickstep.cpp
===================================================================
RCS file: /cvsroot/opende/ode/ode/src/quickstep.cpp,v
retrieving revision 1.1
diff -u -u -r1.1 quickstep.cpp
--- quickstep.cpp 18 May 2004 18:12:30 -0000 1.1
+++ quickstep.cpp 19 May 2004 09:52:27 -0000
@@ -30,6 +30,7 @@
#include <ode/timer.h>
#include <ode/error.h>
#include <ode/matrix.h>
+#include <ode/misc.h>
#include "lcp.h"
#include "util.h"
@@ -211,6 +212,16 @@
}
qsort (order,m,sizeof(IndexError),&compare_index_error);
#endif
+
+#if 1
+ // adam
+ for (i=1; i<m; ++i) {
+ IndexError tmp = order[i];
+ int swapi = dRandInt(i+1);
+ order[i] = order[swapi];
+ order[swapi] = tmp;
+ }
+#endif
//@@@ potential optimization: swap lambda and last_lambda pointers rather
// than copying the data. we must make sure lambda is properly
More information about the ODE
mailing list