LibreOffice Module sw (master)  1
Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
LgstCommonSubseq Class Reference

Use Hirschberg's algorithm to find LCS in linear space. More...

Inheritance diagram for LgstCommonSubseq:
[legend]
Collaboration diagram for LgstCommonSubseq:
[legend]

Public Member Functions

 LgstCommonSubseq (ArrayComparator &rComparator)
 
int Find (int *pSubseq1, int *pSubseq2)
 

Private Member Functions

void FindL (int *pL, int nStt1, int nEnd1, int nStt2, int nEnd2)
 
int HirschbergLCS (int *pLcs1, int *pLcs2, int nStt1, int nEnd1, int nStt2, int nEnd2)
 

Private Attributes

std::unique_ptr< int[]> pL1
 
std::unique_ptr< int[]> pL2
 
std::unique_ptr< int[]> pBuff1
 
std::unique_ptr< int[]> pBuff2
 

Static Private Attributes

static const int CUTOFF = 1<<20
 

Additional Inherited Members

- Static Public Member Functions inherited from CommonSubseq
static int IgnoreIsolatedPieces (int *pLcs1, int *pLcs2, int nLen1, int nLen2, int nLcsLen, int nPieceLen)
 
- Protected Member Functions inherited from CommonSubseq
 CommonSubseq (ArrayComparator &rComparator, int nMaxSize)
 
int FindLCS (int *pLcs1, int *pLcs2, int nStt1, int nEnd1, int nStt2, int nEnd2)
 
- Protected Attributes inherited from CommonSubseq
ArrayComparatorrCmp
 

Detailed Description

Use Hirschberg's algorithm to find LCS in linear space.

Definition at line 342 of file doccomp.cxx.

Constructor & Destructor Documentation

LgstCommonSubseq::LgstCommonSubseq ( ArrayComparator rComparator)
explicit

Definition at line 2428 of file doccomp.cxx.

References ArrayComparator::GetLen2(), pBuff1, pBuff2, pL1, and pL2.

Member Function Documentation

int LgstCommonSubseq::Find ( int pSubseq1,
int pSubseq2 
)
void LgstCommonSubseq::FindL ( int pL,
int  nStt1,
int  nEnd1,
int  nStt2,
int  nEnd2 
)
private
int LgstCommonSubseq::HirschbergLCS ( int pLcs1,
int pLcs2,
int  nStt1,
int  nEnd1,
int  nStt2,
int  nEnd2 
)
private

Definition at line 2474 of file doccomp.cxx.

References CUTOFF, FindL(), CommonSubseq::FindLCS(), pL1, and pL2.

Referenced by Find().

Member Data Documentation

const int LgstCommonSubseq::CUTOFF = 1<<20
staticprivate

Definition at line 345 of file doccomp.cxx.

Referenced by HirschbergLCS().

std::unique_ptr<int[]> LgstCommonSubseq::pBuff1
private

Definition at line 348 of file doccomp.cxx.

Referenced by FindL(), and LgstCommonSubseq().

std::unique_ptr<int[]> LgstCommonSubseq::pBuff2
private

Definition at line 348 of file doccomp.cxx.

Referenced by FindL(), and LgstCommonSubseq().

std::unique_ptr<int[]> LgstCommonSubseq::pL1
private

Definition at line 347 of file doccomp.cxx.

Referenced by HirschbergLCS(), and LgstCommonSubseq().

std::unique_ptr<int[]> LgstCommonSubseq::pL2
private

Definition at line 347 of file doccomp.cxx.

Referenced by HirschbergLCS(), and LgstCommonSubseq().


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