diff options
author | Chris Dyer <cdyer@allegro.clab.cs.cmu.edu> | 2013-11-10 01:46:28 -0500 |
---|---|---|
committer | Chris Dyer <cdyer@allegro.clab.cs.cmu.edu> | 2013-11-10 01:46:28 -0500 |
commit | f204210aee0748f5183c6f0c853be89266f4a651 (patch) | |
tree | 6c44a0fb330344b8b140fd3652c4902e24fde715 | |
parent | e974e1dd835bd7995dca720bba1ce0ab09f6fe54 (diff) |
fix for c++11
-rw-r--r-- | .gitignore | 2 | ||||
-rw-r--r-- | decoder/apply_models.cc | 2 | ||||
-rw-r--r-- | decoder/decoder.cc | 2 | ||||
-rw-r--r-- | decoder/earley_composer.cc | 2 | ||||
-rw-r--r-- | decoder/ff_source_syntax.cc | 2 | ||||
-rw-r--r-- | decoder/ff_source_syntax2_p.cc | 2 | ||||
-rw-r--r-- | decoder/ff_source_syntax_p.cc | 2 | ||||
-rw-r--r-- | decoder/ff_wordalign.cc | 2 | ||||
-rw-r--r-- | decoder/ff_wordalign.h | 2 | ||||
-rw-r--r-- | decoder/ff_wordset.h | 2 | ||||
-rw-r--r-- | decoder/grammar.cc | 2 | ||||
-rw-r--r-- | decoder/hg_intersect.cc | 2 | ||||
-rw-r--r-- | decoder/kbest.h | 2 | ||||
-rw-r--r-- | decoder/maxtrans_blunsom.cc | 2 | ||||
-rw-r--r-- | decoder/phrasebased_translator.cc | 2 | ||||
-rw-r--r-- | python/cdec/sa/strmap.cc | 2 | ||||
-rw-r--r-- | python/setup.py.in | 3 | ||||
-rw-r--r-- | training/latent_svm/latent_svm.cc | 13 | ||||
-rw-r--r-- | training/mira/kbest_cut_mira.cc | 7 | ||||
-rw-r--r-- | training/utils/candidate_set.cc | 2 | ||||
-rw-r--r-- | word-aligner/fast_align.cc | 2 | ||||
-rw-r--r-- | word-aligner/ttables.h | 2 |
22 files changed, 27 insertions, 34 deletions
@@ -103,7 +103,7 @@ jam-files/bjam jam-files/engine/bin.* jam-files/engine/bootstrap/ klm/lm/bin/ -klm/lm/builder/builder +klm/lm/builder/lmplz klm/lm/build_binary klm/lm/ngram_query klm/lm/query diff --git a/decoder/apply_models.cc b/decoder/apply_models.cc index 2e093d6a..4cd8b36f 100644 --- a/decoder/apply_models.cc +++ b/decoder/apply_models.cc @@ -8,7 +8,7 @@ #include <vector> #include <algorithm> -#ifdef HAVE_CXX11 +#ifndef HAVE_OLD_CPP # include <unordered_map> # include <unordered_set> #else diff --git a/decoder/decoder.cc b/decoder/decoder.cc index 2c0e07b7..da65713a 100644 --- a/decoder/decoder.cc +++ b/decoder/decoder.cc @@ -1,6 +1,6 @@ #include "decoder.h" -#ifdef HAVE_CXX11 +#ifndef HAVE_OLD_CPP # include <unordered_map> #else # include <tr1/unordered_map> diff --git a/decoder/earley_composer.cc b/decoder/earley_composer.cc index 32c387d3..d47a6969 100644 --- a/decoder/earley_composer.cc +++ b/decoder/earley_composer.cc @@ -4,7 +4,7 @@ #include <fstream> #include <map> #include <queue> -#ifdef HAVE_CXX11 +#ifndef HAVE_OLD_CPP # include <unordered_map> # include <unordered_set> #else diff --git a/decoder/ff_source_syntax.cc b/decoder/ff_source_syntax.cc index 95709076..88f6714c 100644 --- a/decoder/ff_source_syntax.cc +++ b/decoder/ff_source_syntax.cc @@ -2,7 +2,7 @@ #include <sstream> #include <stack> -#ifdef HAVE_CXX11 +#ifndef HAVE_OLD_CPP # include <unordered_set> #else # include <tr1/unordered_set> diff --git a/decoder/ff_source_syntax2_p.cc b/decoder/ff_source_syntax2_p.cc index 130144fa..6a2ae742 100644 --- a/decoder/ff_source_syntax2_p.cc +++ b/decoder/ff_source_syntax2_p.cc @@ -3,7 +3,7 @@ #include <sstream> #include <stack> #include <string> -#ifdef HAVE_CXX11 +#ifndef HAVE_OLD_CPP # include <unordered_set> #else # include <tr1/unordered_set> diff --git a/decoder/ff_source_syntax_p.cc b/decoder/ff_source_syntax_p.cc index 1d3dc497..c094de59 100644 --- a/decoder/ff_source_syntax_p.cc +++ b/decoder/ff_source_syntax_p.cc @@ -2,7 +2,7 @@ #include <sstream> #include <stack> -#ifdef HAVE_CXX11 +#ifndef HAVE_OLD_CPP # include <unordered_set> #else # include <tr1/unordered_set> diff --git a/decoder/ff_wordalign.cc b/decoder/ff_wordalign.cc index 8ed053c2..dcb80110 100644 --- a/decoder/ff_wordalign.cc +++ b/decoder/ff_wordalign.cc @@ -7,7 +7,7 @@ #include <string> #include <cmath> #include <bitset> -#ifdef HAVE_CXX11 +#ifndef HAVE_OLD_CPP # include <unordered_map> #else # include <tr1/unordered_map> diff --git a/decoder/ff_wordalign.h b/decoder/ff_wordalign.h index 50f0dafa..0161f603 100644 --- a/decoder/ff_wordalign.h +++ b/decoder/ff_wordalign.h @@ -9,7 +9,7 @@ #include <cassert> #include <boost/scoped_ptr.hpp> #include <boost/multi_array.hpp> -#ifdef HAVE_CXX11 +#ifndef HAVE_OLD_CPP # include <unordered_map> #else # include <tr1/unordered_map> diff --git a/decoder/ff_wordset.h b/decoder/ff_wordset.h index affee2f4..e78cd2fb 100644 --- a/decoder/ff_wordset.h +++ b/decoder/ff_wordset.h @@ -9,7 +9,7 @@ #include <iostream> #include <fstream> -#ifdef HAVE_CXX11 +#ifndef HAVE_OLD_CPP # include <unordered_set> #else # include <tr1/unordered_set> diff --git a/decoder/grammar.cc b/decoder/grammar.cc index f2530d35..160d00e6 100644 --- a/decoder/grammar.cc +++ b/decoder/grammar.cc @@ -3,7 +3,7 @@ #include <algorithm> #include <utility> #include <map> -#ifdef HAVE_CXX11 +#ifndef HAVE_OLD_CPP # include <unordered_map> # include <unordered_set> #else diff --git a/decoder/hg_intersect.cc b/decoder/hg_intersect.cc index c5f1cc91..31a9a1ce 100644 --- a/decoder/hg_intersect.cc +++ b/decoder/hg_intersect.cc @@ -1,7 +1,7 @@ #include "hg_intersect.h" #include <vector> -#ifdef HAVE_CXX11 +#ifndef HAVE_OLD_CPP # include <unordered_map> #else # include <tr1/unordered_map> diff --git a/decoder/kbest.h b/decoder/kbest.h index cd386aef..c7194c7e 100644 --- a/decoder/kbest.h +++ b/decoder/kbest.h @@ -3,7 +3,7 @@ #include <vector> #include <utility> -#ifdef HAVE_CXX11 +#ifndef HAVE_OLD_CPP # include <unordered_set> #else # include <tr1/unordered_set> diff --git a/decoder/maxtrans_blunsom.cc b/decoder/maxtrans_blunsom.cc index 8d1d471c..a9f65fab 100644 --- a/decoder/maxtrans_blunsom.cc +++ b/decoder/maxtrans_blunsom.cc @@ -2,7 +2,7 @@ #include <vector> #include <algorithm> -#ifdef HAVE_CXX11 +#ifndef HAVE_OLD_CPP # include <unordered_map> # include <unordered_set> #else diff --git a/decoder/phrasebased_translator.cc b/decoder/phrasebased_translator.cc index 321fb286..04b3e5d2 100644 --- a/decoder/phrasebased_translator.cc +++ b/decoder/phrasebased_translator.cc @@ -2,7 +2,7 @@ #include <queue> #include <iostream> -#ifdef HAVE_CXX11 +#ifndef HAVE_OLD_CPP # include <unordered_map> # include <unordered_set> #else diff --git a/python/cdec/sa/strmap.cc b/python/cdec/sa/strmap.cc index d7c4f2a3..b6debfb0 100644 --- a/python/cdec/sa/strmap.cc +++ b/python/cdec/sa/strmap.cc @@ -4,7 +4,7 @@ #include <string> #include <cstdint> -#ifdef HAVE_CXX11 +#ifndef HAVE_OLD_CPP # include <unordered_map> #else # include <tr1/unordered_map> diff --git a/python/setup.py.in b/python/setup.py.in index ce1eb2ed..8ed0b100 100644 --- a/python/setup.py.in +++ b/python/setup.py.in @@ -21,7 +21,8 @@ ext_modules = [ extra_compile_args=CPPFLAGS, extra_link_args=LDFLAGS), Extension(name='cdec.sa._sa', - sources=['cdec/sa/_sa.c', 'cdec/sa/strmap.cc']) + sources=['cdec/sa/_sa.c', 'cdec/sa/strmap.cc'], + extra_compile_args=CPPFLAGS) ] setup( diff --git a/training/latent_svm/latent_svm.cc b/training/latent_svm/latent_svm.cc index ab9c1d5d..60e52550 100644 --- a/training/latent_svm/latent_svm.cc +++ b/training/latent_svm/latent_svm.cc @@ -32,7 +32,6 @@ total_loss and prev_loss actually refer not to loss, but the metric (usually BLE #include "sampler.h" using namespace std; -using boost::shared_ptr; namespace po = boost::program_options; bool invert_score; @@ -128,7 +127,7 @@ struct HypothesisInfo { }; struct GoodOracle { - shared_ptr<HypothesisInfo> good; + boost::shared_ptr<HypothesisInfo> good; }; struct TrainingObserver : public DecoderObserver { @@ -143,9 +142,9 @@ struct TrainingObserver : public DecoderObserver { const DocScorer& ds; const vector<weight_t>& feature_weights; vector<GoodOracle>& oracles; - shared_ptr<HypothesisInfo> cur_best; - shared_ptr<HypothesisInfo> cur_costaug_best; - shared_ptr<HypothesisInfo> cur_ref; + boost::shared_ptr<HypothesisInfo> cur_best; + boost::shared_ptr<HypothesisInfo> cur_costaug_best; + boost::shared_ptr<HypothesisInfo> cur_ref; const int kbest_size; const double mt_metric_scale; const double mu; @@ -168,8 +167,8 @@ struct TrainingObserver : public DecoderObserver { UpdateOracles(smeta.GetSentenceID(), *hg); } - shared_ptr<HypothesisInfo> MakeHypothesisInfo(const SparseVector<double>& feats, const double metric) { - shared_ptr<HypothesisInfo> h(new HypothesisInfo); + boost::shared_ptr<HypothesisInfo> MakeHypothesisInfo(const SparseVector<double>& feats, const double metric) { + boost::shared_ptr<HypothesisInfo> h(new HypothesisInfo); h->features = feats; h->mt_metric_score = metric; return h; diff --git a/training/mira/kbest_cut_mira.cc b/training/mira/kbest_cut_mira.cc index 3b1108e0..990609d7 100644 --- a/training/mira/kbest_cut_mira.cc +++ b/training/mira/kbest_cut_mira.cc @@ -49,13 +49,6 @@ bool sent_approx; bool checkloss; bool stream; -void SanityCheck(const vector<double>& w) { - for (int i = 0; i < w.size(); ++i) { - assert(!isnan(w[i])); - assert(!isinf(w[i])); - } -} - struct FComp { const vector<double>& w_; FComp(const vector<double>& w) : w_(w) {} diff --git a/training/utils/candidate_set.cc b/training/utils/candidate_set.cc index 1dec9609..33dae9a3 100644 --- a/training/utils/candidate_set.cc +++ b/training/utils/candidate_set.cc @@ -1,6 +1,6 @@ #include "candidate_set.h" -#ifdef HAVE_CXX11 +#ifndef HAVE_OLD_CPP # include <unordered_set> #else # include <tr1/unordered_set> diff --git a/word-aligner/fast_align.cc b/word-aligner/fast_align.cc index 589ca62d..f54233eb 100644 --- a/word-aligner/fast_align.cc +++ b/word-aligner/fast_align.cc @@ -1,7 +1,7 @@ #include <iostream> #include <cmath> #include <utility> -#ifdef HAVE_CXX11 +#ifndef HAVE_OLD_CPP # include <unordered_map> #else # include <tr1/unordered_map> diff --git a/word-aligner/ttables.h b/word-aligner/ttables.h index 1785e064..d82aff72 100644 --- a/word-aligner/ttables.h +++ b/word-aligner/ttables.h @@ -2,7 +2,7 @@ #define _TTABLES_H_ #include <iostream> -#ifdef HAVE_CXX11 +#ifndef HAVE_OLD_CPP # include <unordered_map> #else # include <tr1/unordered_map> |