[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[List Home]
|
[platform-team-dev] Comparision limits
|
- From: Dmitry Smirnov <divis1969@xxxxxxxxx>
- Date: Wed, 29 Jul 2009 20:42:52 +0400
- Delivered-to: platform-team-dev@eclipse.org
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=nKrBXY2xOlhgAM7Wfvh817HTJJRJdUMq64YsNjpYl90=; b=bQpA0+j0ljaszWv4aP986aKW0PtrtpYnztC6IYxS86XR6/G9CrjSydLY5OFhTqwKQ8 5OGLeV5CB3BJAKCUP1RRwZCqOGX97x3/fdHrsyECcDdkCHYSrMEWX3o3cFoAL4Plfl3U t9Jt1dts6oYOfIGefoMuMNki3/sat+VxoUc5U=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=dxi6s1gwDrUvdBjGHXwcpwrWAM1TPUVLGSZItKAXaj2LS4P4vkml+/2jlOhWIVCfGw zarU0o0u6IZ/UmJO76ilwrZVCLegMUDh0tX63zCBPYyDv1ipsEKaEpGsas2FWd/rlyLE p0gjQD13mTbk4jMDR5wnZI0bwXBtY1h11Dyks=
Hi,
I've spent much time digging in LSC code trying to figure out the
problem when some files represented in wrong way (as compared to the
results produced by other compare tools, including diff).
Finally, I've found that the problem is caused by max_differences
assigned in LSC:longestCommonSubsequence()
max_differences = (length1 + length2 + 1) / 2; // ceil((N+M)/2)
if ((double) length1 * (double) length2 > TOO_LONG) {
// limit complexity to D^POW_LIMIT for long sequences
max_differences = (int)
Math.pow(max_differences, POW_LIMIT - 1.0);
}
In my case, lenght1 and length2 are more that 4000. The code above
assigns a value of about 70 (SQRT of max_differences which is above
4000).
At the same time, TOO_LONG seems to allow comparision of 3162x3162
lines since TOO_LONG is 10000000. In this case max_differences is
allowed to be 3162
So, I'm wondering, isn't it a bug in this code?
Shouldn't it be
max_differences = (int) Math.pow(TOO_LONG, POW_LIMIT - 1.0);
I'm using Eclipse 3.5
Dmitry