Bullet & ODE LCP Solver

Post Reply
jiangwei
Posts: 23
Joined: Wed Nov 30, 2005 11:07 am
Location: China

Bullet & ODE LCP Solver

Post by jiangwei »

Hi All

Code: Select all

if ((iteration & 7) == 0) {
			for (i=1; i<m; ++i) {
				IndexError tmp = order[i];
				int swapi = dRandInt2(i+1);
				order[i] = order[swapi];
				order[swapi] = tmp;
			}
                }
I attentioned this section code which in the "SorLcp.cpp" can improve the stable,but i don't know why.
There no papers to discussed this.
I am in a puzzle about this section of code.
What is the purpose of the method?Does anyone can answer this question?Thanks!
Last edited by jiangwei on Fri Sep 29, 2006 5:50 am, edited 2 times in total.
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA
Contact:

Re: Bullet & ODE LCP Solver

Post by Erwin Coumans »

jiangwei wrote:Hi All

Code: Select all

if ((iteration & 7) == 0) {
			for (i=1; i<m; ++i) {
				IndexError tmp = order[i];
				int swapi = dRandInt2(i+1);
				order[i] = order[swapi];
				order[swapi] = tmp;
			}
                }
I found this section code which in the "SorLcp.cpp" can improve the stable,but i don't know why.
There no thesis to discussed this.
What is the purpose of the method?
I am in a puzzle about this section of code.
Good point. We recently discussed this reordering of constraints. Doing a randomize can work in some situations, but opinions vary. Other approaches are sweeping back-and-forwards or sorting them in order of deepest penetration. See the discussion here:

http://www.continuousphysics.com/Bullet ... 4&start=15

Erwin
jiangwei
Posts: 23
Joined: Wed Nov 30, 2005 11:07 am
Location: China

Re: Bullet & ODE LCP Solver

Post by jiangwei »

Erwin Coumans wrote:
Good point. We recently discussed this reordering of constraints. Doing a randomize can work in some situations, but opinions vary. Other approaches are sweeping back-and-forwards or sorting them in order of deepest penetration. See the discussion here:

http://www.continuousphysics.com/Bullet ... 4&start=15

Erwin
Thanks Erwin for your quickly reply,but after tested ,i attention simply swap first and last constranit approach isn't as well as randomizing.
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA
Contact:

Re: Bullet & ODE LCP Solver

Post by Erwin Coumans »

jiangwei wrote:
Erwin Coumans wrote:
Good point. We recently discussed this reordering of constraints. Doing a randomize can work in some situations, but opinions vary. Other approaches are sweeping back-and-forwards or sorting them in order of deepest penetration. See the discussion here:

http://www.continuousphysics.com/Bullet ... 4&start=15

Erwin
Thanks Erwin for your quickly reply,but after tested ,i attention simply swap first and last constranit approach isn't as well as randomizing.
Which proves that opinions vary, as I mentioned.
Post Reply