![]() |
Leptonica
1.77.0
Image processing and image analysis suite
|
#include "allheaders.h"Go to the source code of this file.
Functions | |
| l_ok | l_dnaJoin (L_DNA *dad, L_DNA *das, l_int32 istart, l_int32 iend) |
| L_DNA * | l_dnaaFlattenToDna (L_DNAA *daa) |
| NUMA * | l_dnaConvertToNuma (L_DNA *da) |
| L_DNA * | numaConvertToDna (NUMA *na) |
| L_DNA * | l_dnaUnionByAset (L_DNA *da1, L_DNA *da2) |
| L_DNA * | l_dnaRemoveDupsByAset (L_DNA *das) |
| L_DNA * | l_dnaIntersectionByAset (L_DNA *da1, L_DNA *da2) |
| L_ASET * | l_asetCreateFromDna (L_DNA *da) |
| L_DNA * | l_dnaDiffAdjValues (L_DNA *das) |
Rearrangements
l_int32 *l_dnaJoin()
l_int32 *l_dnaaFlattenToDna()
Conversion between numa and dna
NUMA *l_dnaConvertToNuma()
L_DNA *numaConvertToDna()
Set operations using aset (rbtree)
L_DNA *l_dnaUnionByAset()
L_DNA *l_dnaRemoveDupsByAset()
L_DNA *l_dnaIntersectionByAset()
L_ASET *l_asetCreateFromDna()
Miscellaneous operations
L_DNA *l_dnaDiffAdjValues()
This file contains an implementation on sets of doubles (or integers) that uses an underlying tree (rbtree). The keys stored in the tree are simply the double array values in the dna. Use of a DnaHash is typically more efficient, with O(1) in lookup and insertion.
Definition in file dnafunc1.c.
| [in] | da | source dna |
Definition at line 350 of file dnafunc1.c.
Referenced by l_dnaIntersectionByAset().
| [in] | daa |
Notes:
(1) This 'flattens' the dnaa to a dna, by joining successively
each dna in the dnaa.
(2) It leaves the input dnaa unchanged.
Definition at line 125 of file dnafunc1.c.
References L_Dnaa::dna, l_dnaCreate(), l_dnaJoin(), and L_Dnaa::nalloc.
| [in] | da |
Definition at line 159 of file dnafunc1.c.
References l_dnaGetCount(), l_dnaGetDValue(), numaAddNumber(), and numaCreate().
| [in] | das | input l_dna |
Definition at line 385 of file dnafunc1.c.
References l_dnaAddNumber(), l_dnaCreate(), l_dnaGetCount(), and l_dnaGetIValue().
| [in] | da1,da2 |
Notes:
(1) See sarrayIntersection() for the approach.
(2) Here, the key in building the sorted tree is the number itself.
(3) Operations using an underlying tree are O(nlogn), which is
typically less efficient than hashing, which is O(n).
Definition at line 301 of file dnafunc1.c.
References l_asetCreateFromDna(), l_dnaCreate(), and l_dnaGetCount().
| [in] | dad | dest dna; add to this one |
| [in] | das | [optional] source dna; add from this one |
| [in] | istart | starting index in das |
| [in] | iend | ending index in das; use -1 to cat all |
Notes:
(1) istart < 0 is taken to mean 'read from the start' (istart = 0)
(2) iend < 0 means 'read to the end'
(3) if das == NULL, this is a no-op
Definition at line 79 of file dnafunc1.c.
References l_dnaAddNumber(), l_dnaGetCount(), and l_dnaGetDValue().
Referenced by l_dnaaFlattenToDna(), and l_dnaUnionByAset().
| [in] | das |
Definition at line 256 of file dnafunc1.c.
Referenced by l_dnaUnionByAset().
| [in] | da1,da2 |
Notes:
(1) See sarrayUnionByAset() for the approach.
(2) Here, the key in building the sorted tree is the number itself.
(3) Operations using an underlying tree are O(nlogn), which is
typically less efficient than hashing, which is O(n).
Definition at line 226 of file dnafunc1.c.
References l_dnaCopy(), l_dnaDestroy(), l_dnaJoin(), and l_dnaRemoveDupsByAset().
numaConvertToDna
| [in] | na |
Definition at line 187 of file dnafunc1.c.
References l_dnaAddNumber(), l_dnaCreate(), numaGetCount(), and numaGetFValue().