Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/moses-smt/mosesdecoder.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--moses/TranslationModel/UG/mm/tpt_pickler.h2
-rw-r--r--moses/TranslationModel/UG/mm/tpt_tightindex.h11
-rw-r--r--moses/TranslationModel/UG/mm/ug_bitext.cc2
-rw-r--r--moses/TranslationModel/UG/mm/ug_bitext.h64
-rw-r--r--moses/TranslationModel/UG/mm/ug_im_tsa.h8
-rw-r--r--moses/TranslationModel/UG/mm/ug_mm_tsa.h10
-rw-r--r--moses/TranslationModel/UG/mm/ug_tsa_base.h32
-rw-r--r--moses/TranslationModel/UG/mm/ug_tsa_bitset_cache.h2
-rw-r--r--moses/TranslationModel/UG/mm/ug_tsa_tree_iterator.h30
-rw-r--r--moses/TranslationModel/UG/mmsapt.cpp4
-rw-r--r--moses/TranslationModel/UG/mmsapt.h16
-rw-r--r--moses/TranslationModel/UG/sapt_pscore_unaligned.h2
-rw-r--r--util/usage.hh4
13 files changed, 94 insertions, 93 deletions
diff --git a/moses/TranslationModel/UG/mm/tpt_pickler.h b/moses/TranslationModel/UG/mm/tpt_pickler.h
index e98ba88fe..7305a858e 100644
--- a/moses/TranslationModel/UG/mm/tpt_pickler.h
+++ b/moses/TranslationModel/UG/mm/tpt_pickler.h
@@ -15,7 +15,7 @@ namespace ugdiss
{
/// Utility method placed here for lack of a better place
/// @return the size of file fname.
- uint64_t getFileSize(const std::string& fname);
+ ::uint64_t getFileSize(const std::string& fname);
/**
* The following functions write and read data in a compact binary
diff --git a/moses/TranslationModel/UG/mm/tpt_tightindex.h b/moses/TranslationModel/UG/mm/tpt_tightindex.h
index 27d2ba059..66594bc0a 100644
--- a/moses/TranslationModel/UG/mm/tpt_tightindex.h
+++ b/moses/TranslationModel/UG/mm/tpt_tightindex.h
@@ -10,8 +10,9 @@
#include <iostream>
#include <sstream>
#include "tpt_typedefs.h"
+// #include <stdint.h>
#include <cassert>
-// using namespace std;
+using namespace std;
#ifndef uchar
#endif
@@ -28,7 +29,7 @@ namespace ugdiss
{
// void tightwritex(iostream& out, size_t data, bool flag);
void
- tightwrite(std::ostream& out, uint64_t data, bool flag);
+ tightwrite(std::ostream& out, ::uint64_t data, bool flag);
filepos_type
tightread(std::istream& in, std::ios::pos_type stop);
@@ -90,7 +91,7 @@ namespace ugdiss
tightread4(char const* start, char const* stop, uint32_t& dest);
char const*
- tightread8(char const* start, char const* stop, uint64_t& dest);
+ tightread8(char const* start, char const* stop, ::uint64_t& dest);
template<typename numType>
char const*
@@ -101,13 +102,13 @@ namespace ugdiss
if (sizeof(numType)==4)
return tightread4(start,stop,reinterpret_cast<uint32_t&>(dest));
else if (sizeof(numType)==8)
- return tightread8(start,stop,reinterpret_cast<uint64_t&>(dest));
+ return tightread8(start,stop,reinterpret_cast<typename ::uint64_t&>(dest));
assert(0);
return NULL;
}
// char const*
-// tightread(char const* start, char const* stop, uint64_t& dest);
+// tightread(char const* start, char const* stop, ::uint64_t& dest);
// char const*
// tightread(char const* start, char const* stop, filepos_type& dest);
diff --git a/moses/TranslationModel/UG/mm/ug_bitext.cc b/moses/TranslationModel/UG/mm/ug_bitext.cc
index 45c2b6a9b..944b327df 100644
--- a/moses/TranslationModel/UG/mm/ug_bitext.cc
+++ b/moses/TranslationModel/UG/mm/ug_bitext.cc
@@ -57,7 +57,7 @@ namespace Moses
bool
pstats::
- add(uint64_t pid, float const w,
+ add(::uint64_t pid, float const w,
vector<uchar> const& a,
uint32_t const cnt2,
uint32_t fwd_o,
diff --git a/moses/TranslationModel/UG/mm/ug_bitext.h b/moses/TranslationModel/UG/mm/ug_bitext.h
index c3d6228c9..bc7c75c07 100644
--- a/moses/TranslationModel/UG/mm/ug_bitext.h
+++ b/moses/TranslationModel/UG/mm/ug_bitext.h
@@ -93,11 +93,11 @@ namespace Moses {
template<typename sid_t, typename off_t, typename len_t>
void
- parse_pid(uint64_t const pid, sid_t & sid,
+ parse_pid(::uint64_t const pid, sid_t & sid,
off_t & off, len_t& len)
{
- static uint64_t two32 = uint64_t(1)<<32;
- static uint64_t two16 = uint64_t(1)<<16;
+ static ::uint64_t two32 = ::uint64_t(1)<<32;
+ static ::uint64_t two16 = ::uint64_t(1)<<16;
len = pid%two16;
off = (pid%two32)>>16;
sid = pid>>32;
@@ -152,8 +152,8 @@ namespace Moses {
uint32_t ofwd[po_other+1], obwd[po_other+1];
- // typedef typename boost::unordered_map<uint64_t, jstats> trg_map_t;
- typedef std::map<uint64_t, jstats> trg_map_t;
+ // typedef typename boost::unordered_map<typename ::uint64_t, jstats> trg_map_t;
+ typedef std::map<typename ::uint64_t, jstats> trg_map_t;
trg_map_t trg;
pstats();
~pstats();
@@ -162,7 +162,7 @@ namespace Moses {
size_t count_workers() { return in_progress; }
bool
- add(uint64_t const pid,
+ add(::uint64_t const pid,
float const w,
vector<uchar> const& a,
uint32_t const cnt2,
@@ -195,7 +195,7 @@ namespace Moses {
Token const* start2;
uint32_t len1;
uint32_t len2;
- uint64_t p1, p2;
+ ::uint64_t p1, p2;
uint32_t raw1,raw2,sample1,sample2,good1,good2,joint;
vector<float> fvals;
float dfwd[po_other+1]; // distortion counts // counts or probs?
@@ -214,26 +214,26 @@ namespace Moses {
bool operator>=(PhrasePair const& other) const;
void init();
- void init(uint64_t const pid1, bool is_inverse,
+ void init(::uint64_t const pid1, bool is_inverse,
Token const* x, uint32_t const len,
pstats const* ps = NULL, size_t const numfeats=0);
- // void init(uint64_t const pid1, pstats const& ps, size_t const numfeats);
- // void init(uint64_t const pid1, pstats const& ps1, pstats const& ps2,
+ // void init(::uint64_t const pid1, pstats const& ps, size_t const numfeats);
+ // void init(::uint64_t const pid1, pstats const& ps1, pstats const& ps2,
// size_t const numfeats);
// PhrasePair const&
- // update(uint64_t const pid2, size_t r2 = 0);
+ // update(::uint64_t const pid2, size_t r2 = 0);
PhrasePair const&
- update(uint64_t const pid2, Token const* x,
+ update(::uint64_t const pid2, Token const* x,
uint32_t const len, jstats const& js);
// PhrasePair const&
- // update(uint64_t const pid2, jstats const& js1, jstats const& js2);
+ // update(::uint64_t const pid2, jstats const& js1, jstats const& js2);
// PhrasePair const&
- // update(uint64_t const pid2, size_t const raw2extra, jstats const& js);
+ // update(::uint64_t const pid2, size_t const raw2extra, jstats const& js);
// float
// eval(vector<float> const& w);
@@ -249,7 +249,7 @@ namespace Moses {
template<typename Token>
void
PhrasePair<Token>::
- init(uint64_t const pid1, bool is_inverse, Token const* x, uint32_t const len,
+ init(::uint64_t const pid1, bool is_inverse, Token const* x, uint32_t const len,
pstats const* ps, size_t const numfeats)
{
inverse = is_inverse;
@@ -273,7 +273,7 @@ namespace Moses {
template<typename Token>
PhrasePair<Token> const&
PhrasePair<Token>::
- update(uint64_t const pid2,
+ update(::uint64_t const pid2,
Token const* x, uint32_t const len, jstats const& js)
{
p2 = pid2;
@@ -454,14 +454,14 @@ namespace Moses {
bool const flip) const;
#if 1
- typedef boost::unordered_map<uint64_t,sptr<pstats> > pcache_t;
+ typedef boost::unordered_map<typename ::uint64_t,sptr<pstats> > pcache_t;
#else
- typedef map<uint64_t,sptr<pstats> > pcache_t;
+ typedef map<typename ::uint64_t,sptr<pstats> > pcache_t;
#endif
mutable pcache_t cache1,cache2;
protected:
typedef typename
- lru_cache::LRU_Cache<uint64_t, vector<PhrasePair<Token> > >
+ lru_cache::LRU_Cache<typename ::uint64_t, vector<PhrasePair<Token> > >
pplist_cache_t;
size_t default_sample_size;
@@ -496,7 +496,7 @@ namespace Moses {
void
lookup(vector<Token> const& snt, TSA<Token>& idx,
vector<vector<sptr<vector<PhrasePair<Token> > > > >& dest,
- vector<vector<uint64_t> >* pidmap = NULL,
+ vector<vector<typename ::uint64_t> >* pidmap = NULL,
typename PhrasePair<Token>::Scorer* scorer=NULL,
vector<float> const* const bias=NULL,
bool multithread=true) const;
@@ -506,7 +506,7 @@ namespace Moses {
void setDefaultSampleSize(size_t const max_samples);
size_t getDefaultSampleSize() const;
- string toString(uint64_t pid, int isL2) const;
+ string toString(::uint64_t pid, int isL2) const;
virtual size_t revision() const { return 0; }
};
@@ -514,7 +514,7 @@ namespace Moses {
template<typename Token>
string
Bitext<Token>::
- toString(uint64_t pid, int isL2) const
+ toString(::uint64_t pid, int isL2) const
{
ostringstream buf;
uint32_t sid,off,len; parse_pid(pid,sid,off,len);
@@ -608,7 +608,7 @@ namespace Moses {
sptr<pstats> stats; // stores statistics collected during sampling
vector<float> const* bias; // sentence-level bias for sampling
float bias_total;
- bool step(uint64_t & sid, uint64_t & offset); // select another occurrence
+ bool step(::uint64_t & sid, ::uint64_t & offset); // select another occurrence
bool done() const;
job(typename TSA<Token>::tree_iterator const& m,
sptr<TSA<Token> > const& r, size_t maxsmpl, bool isfwd,
@@ -648,7 +648,7 @@ namespace Moses {
Bitext<Token>::
agenda::
job::
- step(uint64_t & sid, uint64_t & offset)
+ step(::uint64_t & sid, ::uint64_t & offset)
{
boost::lock_guard<boost::mutex> jguard(lock);
bool ret = (max_samples == 0) && (next < stop);
@@ -751,7 +751,7 @@ namespace Moses {
// This way, we can reduce the number of lock / unlock operations we need to do during
// sampling.
size_t s1=0, s2=0, e1=0, e2=0;
- uint64_t sid=0, offset=0; // of the source phrase
+ ::uint64_t sid=0, offset=0; // of the source phrase
while(sptr<job> j = ag.get_job())
{
j->stats->register_worker();
@@ -784,7 +784,7 @@ namespace Moses {
Token const* o = (j->fwd ? ag.bt.T2 : ag.bt.T1)->sntStart(sid);
float sample_weight = 1./((s2-s1+1)*(e2-e1+1));
- vector<uint64_t> seen;
+ vector<typename ::uint64_t> seen;
seen.reserve(100);
// It is possible that the phrase extraction extracts the same
// phrase twice, e.g., when word a co-occurs with sequence b b b
@@ -801,7 +801,7 @@ namespace Moses {
// assert(b);
for (size_t i = e1; i <= e2; ++i)
{
- uint64_t tpid = b->getPid();
+ ::uint64_t tpid = b->getPid();
size_t s = 0;
while (s < seen.size() && seen[s] != tpid) ++s;
if (s < seen.size())
@@ -1394,7 +1394,7 @@ namespace Moses {
// is caching here the cause of the apparent memory leak in
// confusion network decoding ???? No, it isn't.
// That was because of naive, brute-force input path generation.
- uint64_t pid = phrase.getPid();
+ ::uint64_t pid = phrase.getPid();
pcache_t & cache(phrase.root == &(*this->I1) ? cache1 : cache2);
pcache_t::value_type entry(pid,sptr<pstats>());
pair<pcache_t::iterator,bool> foo;
@@ -1429,7 +1429,7 @@ namespace Moses {
PhrasePair<Token> m_pp;
Token const* m_token;
size_t m_len;
- uint64_t m_pid1;
+ ::uint64_t m_pid1;
bool m_is_inverse;
public:
@@ -1486,11 +1486,11 @@ namespace Moses {
Bitext<Token>::
lookup(vector<Token> const& snt, TSA<Token>& idx,
vector<vector<sptr<vector<PhrasePair<Token> > > > >& dest,
- vector<vector<uint64_t> >* pidmap,
+ vector<vector<typename ::uint64_t> >* pidmap,
typename PhrasePair<Token>::Scorer* scorer,
vector<float> const* const bias, bool multithread) const
{
- typedef vector<vector<sptr<vector<PhrasePair<Token> > > > > ret_t;
+ // typedef vector<vector<sptr<vector<PhrasePair<Token> > > > > ret_t;
dest.clear();
dest.resize(snt.size());
@@ -1508,7 +1508,7 @@ namespace Moses {
typename TSA<Token>::tree_iterator m(&idx);
for (size_t k = i; k < snt.size() && m.extend(snt[k].id()); ++k)
{
- uint64_t key = m.getPid();
+ ::uint64_t key = m.getPid();
if (pidmap) (*pidmap)[i].push_back(key);
sptr<vector<PhrasePair<Token> > > pp = C.get(key);
if (pp)
diff --git a/moses/TranslationModel/UG/mm/ug_im_tsa.h b/moses/TranslationModel/UG/mm/ug_im_tsa.h
index 6b4a83f72..f7256ba2d 100644
--- a/moses/TranslationModel/UG/mm/ug_im_tsa.h
+++ b/moses/TranslationModel/UG/mm/ug_im_tsa.h
@@ -74,13 +74,13 @@ namespace ugdiss
readSid(char const* p, char const* q, id_type& sid) const;
char const*
- readSid(char const* p, char const* q, uint64_t& sid) const;
+ readSid(char const* p, char const* q, ::uint64_t& sid) const;
char const*
readOffset(char const* p, char const* q, uint16_t& offset) const;
char const*
- readOffset(char const* p, char const* q, uint64_t& offset) const;
+ readOffset(char const* p, char const* q, ::uint64_t& offset) const;
void
sanityCheck() const;
@@ -267,7 +267,7 @@ namespace ugdiss
template<typename TOKEN>
char const*
imTSA<TOKEN>::
- readSid(char const* p, char const* q, uint64_t& sid) const
+ readSid(char const* p, char const* q, ::uint64_t& sid) const
{
assert(reinterpret_cast<cpos const*>(p) >= &(this->sufa.front()));
assert(reinterpret_cast<cpos const*>(p) <= &(this->sufa.back()));
@@ -289,7 +289,7 @@ namespace ugdiss
template<typename TOKEN>
char const*
imTSA<TOKEN>::
- readOffset(char const* p, char const* q, uint64_t& offset) const
+ readOffset(char const* p, char const* q, ::uint64_t& offset) const
{
assert(reinterpret_cast<cpos const*>(p) >= &(this->sufa.front()));
assert(reinterpret_cast<cpos const*>(p) <= &(this->sufa.back()));
diff --git a/moses/TranslationModel/UG/mm/ug_mm_tsa.h b/moses/TranslationModel/UG/mm/ug_mm_tsa.h
index da6637a0a..9d5038e26 100644
--- a/moses/TranslationModel/UG/mm/ug_mm_tsa.h
+++ b/moses/TranslationModel/UG/mm/ug_mm_tsa.h
@@ -60,13 +60,13 @@ namespace ugdiss
readSid(char const* p, char const* q, id_type& sid) const;
char const*
- readSid(char const* p, char const* q, uint64_t& sid) const;
+ readSid(char const* p, char const* q, ::uint64_t& sid) const;
char const*
readOffset(char const* p, char const* q, uint16_t& offset) const;
char const*
- readOffset(char const* p, char const* q, uint64_t& offset) const;
+ readOffset(char const* p, char const* q, ::uint64_t& offset) const;
void sanityCheck() const;
@@ -188,7 +188,7 @@ namespace ugdiss
template<typename TOKEN>
char const*
mmTSA<TOKEN>::
- readSid(char const* p, char const* q, uint64_t& sid) const
+ readSid(char const* p, char const* q, ::uint64_t& sid) const
{
return tightread(p,q,sid);
}
@@ -210,7 +210,7 @@ namespace ugdiss
inline
char const*
mmTSA<TOKEN>::
- readOffset(char const* p, char const* q, uint64_t& offset) const
+ readOffset(char const* p, char const* q, ::uint64_t& offset) const
{
return tightread(p,q,offset);
}
@@ -243,7 +243,7 @@ namespace ugdiss
{
raw = 0;
id_type sid; uint16_t off;
- boost::dynamic_bitset<uint64_t> check(this->corpus->size());
+ boost::dynamic_bitset<typename ::uint64_t> check(this->corpus->size());
while (p < q)
{
p = tightread(p,q,sid);
diff --git a/moses/TranslationModel/UG/mm/ug_tsa_base.h b/moses/TranslationModel/UG/mm/ug_tsa_base.h
index dc5e270c2..83593c79c 100644
--- a/moses/TranslationModel/UG/mm/ug_tsa_base.h
+++ b/moses/TranslationModel/UG/mm/ug_tsa_base.h
@@ -182,7 +182,7 @@ namespace ugdiss
count_type
setBits(char const* startRange, char const* endRange,
- boost::dynamic_bitset<uint64_t>& bs) const;
+ boost::dynamic_bitset<typename ::uint64_t>& bs) const;
void
setTokenBits(char const* startRange, char const* endRange, size_t len,
@@ -201,7 +201,7 @@ namespace ugdiss
virtual
char const*
- readSid(char const* p, char const* q, uint64_t& sid) const = 0;
+ readSid(char const* p, char const* q, ::uint64_t& sid) const = 0;
/** read the offset part of the index entry into /offset/
* @return position of the next entry in the index.
@@ -216,7 +216,7 @@ namespace ugdiss
virtual
char const*
- readOffset(char const* p, char const* q, uint64_t& offset) const = 0;
+ readOffset(char const* p, char const* q, ::uint64_t& offset) const = 0;
/** @return sentence count
*/
@@ -268,26 +268,26 @@ namespace ugdiss
next 16 bits: offset from the start of the sentence
next 16 bits: length of the phrase
*/
- uint64_t
+ ::uint64_t
getSequenceId(typename vector<TKN>::const_iterator const& pstart,
typename vector<TKN>::const_iterator const& pstop) const;
- uint64_t
+ ::uint64_t
getSequenceId(TKN const* t, ushort plen) const;
/** Return the phrase represented by phrase ID pid_ */
string
- getSequence(uint64_t pid, TokenIndex const& V) const;
+ getSequence(::uint64_t pid, TokenIndex const& V) const;
/** Return the phrase represented by phrase ID pid_ */
vector<TKN>
- getSequence(uint64_t pid) const;
+ getSequence(::uint64_t pid) const;
TKN const*
- getSequenceStart(uint64_t) const;
+ getSequenceStart(::uint64_t) const;
ushort
- getSequenceLength(uint64_t) const;
+ getSequenceLength(::uint64_t) const;
size_t
getCorpusSize() const;
@@ -638,7 +638,7 @@ namespace ugdiss
//---------------------------------------------------------------------------
template<typename TKN>
- uint64_t
+ ::uint64_t
TSA<TKN>::
getSequenceId(typename vector<TKN>::const_iterator const& pstart,
typename vector<TKN>::const_iterator const& pstop) const
@@ -649,7 +649,7 @@ namespace ugdiss
//---------------------------------------------------------------------------
template<typename TKN>
- uint64_t
+ ::uint64_t
TSA<TKN>::
getSequenceId(TKN const* pstart, ushort plen) const
{
@@ -657,7 +657,7 @@ namespace ugdiss
if (!p) return 0; // not found!
ArrayEntry I;
readEntry(p,I);
- uint64_t ret = I.sid;
+ ::uint64_t ret = I.sid;
ret <<= 16;
ret += I.offset;
ret <<= 16;
@@ -670,7 +670,7 @@ namespace ugdiss
template<typename TKN>
vector<TKN>
TSA<TKN>::
- getSequence(uint64_t pid) const
+ getSequence(::uint64_t pid) const
{
size_t plen = pid % 65536;
size_t offset = (pid >> 16) % 65536;
@@ -687,7 +687,7 @@ namespace ugdiss
template<typename TKN>
string
TSA<TKN>::
- getSequence(uint64_t pid, TokenIndex const& V) const
+ getSequence(::uint64_t pid, TokenIndex const& V) const
{
ostringstream buf;
TKN const* a = getSequenceStart(pid);
@@ -704,7 +704,7 @@ namespace ugdiss
template<typename TKN>
TKN const*
TSA<TKN>::
- getSequenceStart(uint64_t pid) const
+ getSequenceStart(::uint64_t pid) const
{
size_t offset = (pid >> 16) % 65536;
return corpus->sntStart(pid >> 32)+offset;
@@ -715,7 +715,7 @@ namespace ugdiss
template<typename TKN>
ushort
TSA<TKN>::
- getSequenceLength(uint64_t pid) const
+ getSequenceLength(::uint64_t pid) const
{
return (pid % 65536);
}
diff --git a/moses/TranslationModel/UG/mm/ug_tsa_bitset_cache.h b/moses/TranslationModel/UG/mm/ug_tsa_bitset_cache.h
index 46ce2f703..3111f1c1d 100644
--- a/moses/TranslationModel/UG/mm/ug_tsa_bitset_cache.h
+++ b/moses/TranslationModel/UG/mm/ug_tsa_bitset_cache.h
@@ -24,7 +24,7 @@ namespace ugdiss
BitSetCache
{
public:
- typedef boost::dynamic_bitset<uint64_t> BitSet;
+ typedef boost::dynamic_bitset<typename ::uint64_t> BitSet;
typedef boost::shared_ptr<BitSet> bsptr;
typedef map<pair<char const*,ushort>,bsptr> myMap;
typedef myMap::iterator myMapIter;
diff --git a/moses/TranslationModel/UG/mm/ug_tsa_tree_iterator.h b/moses/TranslationModel/UG/mm/ug_tsa_tree_iterator.h
index ab7f96bf0..ac8cbe24e 100644
--- a/moses/TranslationModel/UG/mm/ug_tsa_tree_iterator.h
+++ b/moses/TranslationModel/UG/mm/ug_tsa_tree_iterator.h
@@ -87,7 +87,7 @@ namespace ugdiss
ushort getOffset(int p) const;
size_t sntCnt(int p=-1) const;
size_t rawCnt(int p=-1) const;
- uint64_t getPid(int p=-1) const; // get phrase id
+ ::uint64_t getPid(int p=-1) const; // get phrase id
virtual bool extend(Token const& id);
virtual bool extend(id_type id);
@@ -104,25 +104,25 @@ namespace ugdiss
// fillBitSet: deprecated; use markSentences() instead
count_type
- fillBitSet(boost::dynamic_bitset<uint64_t>& bitset) const;
+ fillBitSet(boost::dynamic_bitset<typename ::uint64_t>& bitset) const;
count_type
markEndOfSequence(Token const* start, Token const* stop,
- boost::dynamic_bitset<uint64_t>& dest) const;
+ boost::dynamic_bitset<typename ::uint64_t>& dest) const;
count_type
markSequence(Token const* start, Token const* stop, bitvector& dest) const;
count_type
- markSentences(boost::dynamic_bitset<uint64_t>& bitset) const;
+ markSentences(boost::dynamic_bitset<typename ::uint64_t>& bitset) const;
count_type
- markOccurrences(boost::dynamic_bitset<uint64_t>& bitset,
+ markOccurrences(boost::dynamic_bitset<typename ::uint64_t>& bitset,
bool markOnlyStartPosition=false) const;
count_type
markOccurrences(vector<ushort>& dest) const;
- uint64_t
+ ::uint64_t
getSequenceId() const;
// equivalent but more efficient than
@@ -515,7 +515,7 @@ namespace ugdiss
// ---------------------------------------------------------------------------
template<typename Token>
- uint64_t
+ ::uint64_t
TSA_tree_iterator<Token>::
getPid(int p) const
{
@@ -523,9 +523,9 @@ namespace ugdiss
if (p < 0) p += upper.size();
char const* lb = lower_bound(p);
char const* ub = upper_bound(p);
- uint64_t sid,off;
+ ::uint64_t sid,off;
root->readOffset(root->readSid(lb,ub,sid),ub,off);
- uint64_t ret = (sid<<32) + (off<<16) + uint64_t(p+1);
+ ::uint64_t ret = (sid<<32) + (off<<16) + ::uint64_t(p+1);
return ret;
}
@@ -613,7 +613,7 @@ namespace ugdiss
template<typename Token>
count_type
TSA_tree_iterator<Token>::
- fillBitSet(boost::dynamic_bitset<uint64_t>& bitset) const
+ fillBitSet(boost::dynamic_bitset<typename ::uint64_t>& bitset) const
{
return markSentences(bitset);
}
@@ -623,7 +623,7 @@ namespace ugdiss
template<typename Token>
count_type
TSA_tree_iterator<Token>::
- markSentences(boost::dynamic_bitset<uint64_t>& bitset) const
+ markSentences(boost::dynamic_bitset<typename ::uint64_t>& bitset) const
{
assert(root && root->corpus);
bitset.resize(root->corpus->size());
@@ -650,7 +650,7 @@ namespace ugdiss
template<typename Token>
count_type
TSA_tree_iterator<Token>::
- markOccurrences(boost::dynamic_bitset<uint64_t>& bitset, bool markOnlyStartPosition) const
+ markOccurrences(boost::dynamic_bitset<typename ::uint64_t>& bitset, bool markOnlyStartPosition) const
{
assert(root && root->corpus);
if (bitset.size() != root->corpus->numTokens())
@@ -697,7 +697,7 @@ namespace ugdiss
count_type
TSA_tree_iterator<Token>::
markEndOfSequence(Token const* start, Token const* stop,
- boost::dynamic_bitset<uint64_t>& dest) const
+ boost::dynamic_bitset<typename ::uint64_t>& dest) const
{
count_type matchCount=0;
Token const* a = getToken(0);
@@ -754,7 +754,7 @@ namespace ugdiss
//---------------------------------------------------------------------------
template<typename Token>
- uint64_t
+ ::uint64_t
TSA_tree_iterator<Token>::
getSequenceId() const
{
@@ -762,7 +762,7 @@ namespace ugdiss
char const* p = this->lower_bound(-1);
typename Token::ArrayEntry I;
root->readEntry(p,I);
- return (uint64_t(I.sid)<<32)+(I.offset<<16)+this->size();
+ return (::uint64_t(I.sid)<<32)+(I.offset<<16)+this->size();
}
template<typename Token>
diff --git a/moses/TranslationModel/UG/mmsapt.cpp b/moses/TranslationModel/UG/mmsapt.cpp
index b928d0f88..ad8c7cd7d 100644
--- a/moses/TranslationModel/UG/mmsapt.cpp
+++ b/moses/TranslationModel/UG/mmsapt.cpp
@@ -503,7 +503,7 @@ namespace Moses
Mmsapt::
TargetPhraseCollectionWrapper::
- TargetPhraseCollectionWrapper(size_t r, uint64_t k)
+ TargetPhraseCollectionWrapper(size_t r, ::uint64_t k)
: revision(r), key(k), refCount(0), idx(-1)
{ }
@@ -551,7 +551,7 @@ namespace Moses
return NULL; // phrase not found in either bitext
// cache lookup:
- uint64_t phrasekey = (mfix.size() == sphrase.size() ? (mfix.getPid()<<1)
+ ::uint64_t phrasekey = (mfix.size() == sphrase.size() ? (mfix.getPid()<<1)
: (mdyn.getPid()<<1)+1);
size_t revision = dyn->revision();
{
diff --git a/moses/TranslationModel/UG/mmsapt.h b/moses/TranslationModel/UG/mmsapt.h
index 303da141d..b63dd6ad1 100644
--- a/moses/TranslationModel/UG/mmsapt.h
+++ b/moses/TranslationModel/UG/mmsapt.h
@@ -134,7 +134,7 @@ namespace Moses
{
public:
size_t const revision; // time stamp from dynamic bitext
- uint64_t const key; // phrase key
+ ::uint64_t const key; // phrase key
uint32_t refCount; // reference count
#if defined(timespec)
timespec tstamp; // last use
@@ -142,7 +142,7 @@ namespace Moses
timeval tstamp; // last use
#endif
int idx; // position in history heap
- TargetPhraseCollectionWrapper(size_t r, uint64_t const k);
+ TargetPhraseCollectionWrapper(size_t r, ::uint64_t const k);
~TargetPhraseCollectionWrapper();
};
@@ -156,7 +156,7 @@ namespace Moses
void
decache(TargetPhraseCollectionWrapper* ptr) const;
- typedef map<uint64_t, TargetPhraseCollectionWrapper*> tpc_cache_t;
+ typedef map<typename ::uint64_t, TargetPhraseCollectionWrapper*> tpc_cache_t;
mutable tpc_cache_t m_cache;
mutable vector<TargetPhraseCollectionWrapper*> m_history;
// phrase table feature weights for alignment:
@@ -189,7 +189,7 @@ namespace Moses
void
process_pstats
(Phrase const& src,
- uint64_t const pid1,
+ ::uint64_t const pid1,
pstats const& stats,
Bitext<Token> const & bt,
TargetPhraseCollection* tpcoll
@@ -198,10 +198,10 @@ namespace Moses
bool
pool_pstats
(Phrase const& src,
- uint64_t const pid1a,
+ ::uint64_t const pid1a,
pstats * statsa,
Bitext<Token> const & bta,
- uint64_t const pid1b,
+ ::uint64_t const pid1b,
pstats const* statsb,
Bitext<Token> const & btb,
TargetPhraseCollection* tpcoll
@@ -210,10 +210,10 @@ namespace Moses
bool
combine_pstats
(Phrase const& src,
- uint64_t const pid1a,
+ ::uint64_t const pid1a,
pstats * statsa,
Bitext<Token> const & bta,
- uint64_t const pid1b,
+ ::uint64_t const pid1b,
pstats const* statsb,
Bitext<Token> const & btb,
TargetPhraseCollection* tpcoll
diff --git a/moses/TranslationModel/UG/sapt_pscore_unaligned.h b/moses/TranslationModel/UG/sapt_pscore_unaligned.h
index bdd2919b4..dafc1e129 100644
--- a/moses/TranslationModel/UG/sapt_pscore_unaligned.h
+++ b/moses/TranslationModel/UG/sapt_pscore_unaligned.h
@@ -12,7 +12,7 @@ namespace Moses {
class
PScoreUnaligned : public PhraseScorer<Token>
{
- typedef boost::dynamic_bitset<uint64_t> bitvector;
+ typedef boost::dynamic_bitset<typename ::uint64_t> bitvector;
public:
PScoreUnaligned(string const spec)
{
diff --git a/util/usage.hh b/util/usage.hh
index e578b0a65..5407f5a54 100644
--- a/util/usage.hh
+++ b/util/usage.hh
@@ -13,9 +13,9 @@ double WallTime();
void PrintUsage(std::ostream &to);
// Determine how much physical memory there is. Return 0 on failure.
-uint64_t GuessPhysicalMemory();
+::uint64_t GuessPhysicalMemory();
// Parse a size like unix sort. Sadly, this means the default multiplier is K.
-uint64_t ParseSize(const std::string &arg);
+::uint64_t ParseSize(const std::string &arg);
} // namespace util
#endif // UTIL_USAGE_H