WikiDiff3 Class Reference
[DifferenceEngine]

This diff implementation is mainly lifted from the LCS algorithm of the Eclipse project which in turn is based on Myers' "An O(ND) difference algorithm and its variations" (http://citeseer.ist.psu.edu/myers86ond.html) with range compression (see Wu et al. More...

List of all members.

Public Member Functions

 __construct ($tooLong=2000000, $powLimit=1.45)
 diff ($from, $to)
 diff_range ($from_lines, $to_lines)
 getLcsLength ()

Public Attributes

 $length
 $removed
 $added
 $heuristicUsed

Private Member Functions

 lcs_rec ($bottoml1, $topl1, $bottoml2, $topl2, &$V, &$snake)
 find_middle_snake ($bottoml1, $topl1, $bottoml2, $topl2, &$V, &$snake)

Static Private Member Functions

static findMostProgress ($M, $N, $limit, $V)

Private Attributes

 $from
 $to
 $m
 $n
 $tooLong
 $powLimit
 $maxDifferences
 $lcsLengthCorrectedForHeuristic = false


Detailed Description

This diff implementation is mainly lifted from the LCS algorithm of the Eclipse project which in turn is based on Myers' "An O(ND) difference algorithm and its variations" (http://citeseer.ist.psu.edu/myers86ond.html) with range compression (see Wu et al.

's "An O(NP) Sequence Comparison Algorithm").

This implementation supports an upper bound on the excution time.

Complexity: O((M + N)D) worst case time, O(M + N + D^2) expected time, O(M + N) space

Author:
Guy Van den Broeck

Definition at line 33 of file Diff.php.


Constructor & Destructor Documentation

WikiDiff3::__construct ( tooLong = 2000000,
powLimit = 1.45 
)

Definition at line 54 of file Diff.php.

References $powLimit, and $tooLong.


Member Function Documentation

WikiDiff3::diff ( from,
to 
)

Definition at line 59 of file Diff.php.

References $added, $from, $i, $key, $m, $n, $removed, $shared, $to, lcs_rec(), n, and wfDebug().

Referenced by diff_range().

WikiDiff3::diff_range ( from_lines,
to_lines 
)

Definition at line 176 of file Diff.php.

References diff(), and n.

WikiDiff3::find_middle_snake ( bottoml1,
topl1,
bottoml2,
topl2,
&$  V,
&$  snake 
) [private]

Definition at line 252 of file Diff.php.

References $from, $to, findMostProgress(), and wfDebug().

Referenced by lcs_rec().

static WikiDiff3::findMostProgress ( M,
N,
limit,
V 
) [static, private]

Definition at line 466 of file Diff.php.

Referenced by find_middle_snake().

WikiDiff3::getLcsLength (  ) 

Definition at line 546 of file Diff.php.

WikiDiff3::lcs_rec ( bottoml1,
topl1,
bottoml2,
topl2,
&$  V,
&$  snake 
) [private]

Definition at line 210 of file Diff.php.

References $i, and find_middle_snake().

Referenced by diff().


Member Data Documentation

WikiDiff3::$added

Definition at line 51 of file Diff.php.

Referenced by diff().

WikiDiff3::$from [private]

Definition at line 36 of file Diff.php.

Referenced by diff(), and find_middle_snake().

WikiDiff3::$heuristicUsed

Definition at line 52 of file Diff.php.

WikiDiff3::$lcsLengthCorrectedForHeuristic = false [private]

Definition at line 46 of file Diff.php.

WikiDiff3::$length

Definition at line 49 of file Diff.php.

WikiDiff3::$m [private]

Definition at line 38 of file Diff.php.

Referenced by diff().

WikiDiff3::$maxDifferences [private]

Definition at line 45 of file Diff.php.

WikiDiff3::$n [private]

Definition at line 39 of file Diff.php.

Referenced by diff().

WikiDiff3::$powLimit [private]

Definition at line 42 of file Diff.php.

Referenced by __construct().

WikiDiff3::$removed

Definition at line 50 of file Diff.php.

Referenced by diff().

WikiDiff3::$to [private]

Definition at line 37 of file Diff.php.

Referenced by diff(), and find_middle_snake().

WikiDiff3::$tooLong [private]

Definition at line 41 of file Diff.php.

Referenced by __construct().


The documentation for this class was generated from the following file:

Generated on Sat Sep 5 02:08:50 2009 for MediaWiki by  doxygen 1.5.9