2015-10-18 03:02:38 +03:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <boost/unordered_set.hpp>
|
2015-10-20 15:04:35 +03:00
|
|
|
#include <boost/unordered_map.hpp>
|
|
|
|
#include <set>
|
2015-10-25 16:07:25 +03:00
|
|
|
#include "Bitmap.h"
|
2015-10-18 03:02:38 +03:00
|
|
|
#include "Util.h"
|
|
|
|
|
2015-10-18 03:19:35 +03:00
|
|
|
namespace Moses
|
|
|
|
{
|
|
|
|
|
2015-10-18 03:02:38 +03:00
|
|
|
class Bitmaps
|
|
|
|
{
|
2015-10-25 16:37:59 +03:00
|
|
|
typedef boost::unordered_map<Range, const Bitmap*> NextBitmaps;
|
2015-10-25 16:07:25 +03:00
|
|
|
typedef boost::unordered_map<const Bitmap*, NextBitmaps, UnorderedComparer<Bitmap>, UnorderedComparer<Bitmap> > Coll;
|
|
|
|
//typedef std::set<const Bitmap*, OrderedComparer<Bitmap> > Coll;
|
2015-10-18 15:30:02 +03:00
|
|
|
Coll m_coll;
|
2015-10-25 16:07:25 +03:00
|
|
|
const Bitmap *m_initBitmap;
|
2015-10-19 19:23:02 +03:00
|
|
|
|
2015-10-25 16:37:59 +03:00
|
|
|
const Bitmap &GetNextBitmap(const Bitmap &bm, const Range &range);
|
2015-10-18 03:02:38 +03:00
|
|
|
public:
|
2015-10-20 15:04:35 +03:00
|
|
|
Bitmaps(size_t inputSize, const std::vector<bool> &initSourceCompleted);
|
2015-10-18 15:30:02 +03:00
|
|
|
virtual ~Bitmaps();
|
2015-10-20 15:04:35 +03:00
|
|
|
|
2015-10-25 16:07:25 +03:00
|
|
|
const Bitmap &GetInitialBitmap() const {
|
2015-10-20 22:16:07 +03:00
|
|
|
return *m_initBitmap;
|
|
|
|
}
|
2015-10-25 16:37:59 +03:00
|
|
|
const Bitmap &GetBitmap(const Bitmap &bm, const Range &range);
|
2015-10-18 03:02:38 +03:00
|
|
|
|
|
|
|
};
|
2015-10-18 03:19:35 +03:00
|
|
|
|
|
|
|
}
|