diff options
author | Chris Dyer <cdyer@cs.cmu.edu> | 2011-04-21 18:06:31 -0400 |
---|---|---|
committer | Chris Dyer <cdyer@cs.cmu.edu> | 2011-04-21 18:06:31 -0400 |
commit | 5061409a26050b9a4724b50b30d66d3c3a583951 (patch) | |
tree | be91d2c2f5c99814643befb2890f71551ba10fc5 /utils/sparse_vector.h | |
parent | c224922dc04a2fa8467e2a8b20f42e3f0006e676 (diff) |
adding functionality to fast_sparse_vector, getting ready for transition to it
Diffstat (limited to 'utils/sparse_vector.h')
-rw-r--r-- | utils/sparse_vector.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/utils/sparse_vector.h b/utils/sparse_vector.h index 1bcb9502..de8c0291 100644 --- a/utils/sparse_vector.h +++ b/utils/sparse_vector.h @@ -1,6 +1,8 @@ #ifndef _SPARSE_VECTOR_H_ #define _SPARSE_VECTOR_H_ +#undef USE_FAST_SPARSE_VECTOR +#ifndef USE_FAST_SPARSE_VECTOR /* TODO: specialize for int value types, where it probably makes sense to check if adding/subtracting brings a value to 0, and remove it from the map (e.g. in a gibbs sampler). or add a separate policy argument for that. */ @@ -667,6 +669,13 @@ std::ostream &operator<<(std::ostream &out, const SparseVector<T> &vec) return vec.operator<<(out); } +#else + +#include "fast_sparse_vector.h" +#define SparseVector FastSparseVector + +#endif + namespace B64 { void Encode(double objective, const SparseVector<double>& v, std::ostream* out); // returns false if failed to decode |