[Debtags-commits] [svn] r1582 - in tagcoll/trunk: . tagcoll
Enrico Zini
enrico at costa.debian.org
Wed Feb 15 13:38:49 UTC 2006
Author: enrico
Date: Wed Feb 15 13:38:47 2006
New Revision: 1582
Modified:
tagcoll/trunk/ (props changed)
tagcoll/trunk/README
tagcoll/trunk/tagcoll/MMapIndex.cc
tagcoll/trunk/tagcoll/MMapIndex.h
Log:
r7324 at viaza: enrico | 2006-02-15 14:38:29 +0100
Made MMapIndex default constructible
Modified: tagcoll/trunk/README
==============================================================================
--- tagcoll/trunk/README (original)
+++ tagcoll/trunk/README Wed Feb 15 13:38:47 2006
@@ -177,6 +177,12 @@
+ mmap-based fast index
+ patch directory
+ - Change the 'related' function to return a vector of itemsets, one for every
+ distance
+ - Experiment with different 'related' algorithms: the current one is hamming
+ distance, but it could also me 'number of common tags', which would also be
+ more efficient to compute
+
- Create more IntIndex specific optimized methods instead of using the default
ones
Modified: tagcoll/trunk/tagcoll/MMapIndex.cc
==============================================================================
--- tagcoll/trunk/tagcoll/MMapIndex.cc (original)
+++ tagcoll/trunk/tagcoll/MMapIndex.cc Wed Feb 15 13:38:47 2006
@@ -64,9 +64,20 @@
close(m_fd);
}
+MMapIndex::MMapIndex()
+ : m_master(0), m_buf(0), m_size(0) {}
+
MMapIndex::MMapIndex(const MasterMMapIndex& master, size_t idx)
- : m_master(master), m_buf(m_master.m_buf), m_size(*(int*)m_buf)
{
+ init(master, idx);
+}
+
+void MMapIndex::init(const MasterMMapIndex& master, size_t idx)
+{
+ m_master = &master;
+ m_buf = master.m_buf;
+ m_size = *(int*)m_buf;
+
// Jump to the idx-th index
for (size_t i = 0; i < idx; i++)
{
Modified: tagcoll/trunk/tagcoll/MMapIndex.h
==============================================================================
--- tagcoll/trunk/tagcoll/MMapIndex.h (original)
+++ tagcoll/trunk/tagcoll/MMapIndex.h Wed Feb 15 13:38:47 2006
@@ -58,12 +58,15 @@
class MMapIndex
{
protected:
- const MasterMMapIndex& m_master;
+ const MasterMMapIndex* m_master;
const char* m_buf;
size_t m_size;
public:
+ MMapIndex();
MMapIndex(const MasterMMapIndex& master, size_t idx);
+
+ void init(const MasterMMapIndex& master, size_t idx);
};
/**
More information about the Debtags-commits
mailing list