summaryrefslogtreecommitdiff
path: root/utils/sparse_vector.cc
diff options
context:
space:
mode:
authorChris Dyer <cdyer@cs.cmu.edu>2011-04-21 18:06:31 -0400
committerChris Dyer <cdyer@cs.cmu.edu>2011-04-21 18:06:31 -0400
commitb6634dff2cd515d9e6f95416512db893a08bde29 (patch)
tree02730df750245ef3d101deb469d0e10109b7d6f5 /utils/sparse_vector.cc
parent282bc08647eb6856f798da0c64dd67530e02842a (diff)
adding functionality to fast_sparse_vector, getting ready for transition to it
Diffstat (limited to 'utils/sparse_vector.cc')
-rw-r--r--utils/sparse_vector.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/utils/sparse_vector.cc b/utils/sparse_vector.cc
index 6e42a216..24da5f39 100644
--- a/utils/sparse_vector.cc
+++ b/utils/sparse_vector.cc
@@ -3,6 +3,7 @@
#include <iostream>
#include <cstring>
+#include "fdict.h"
#include "b64tools.h"
using namespace std;
@@ -10,7 +11,7 @@ using namespace std;
namespace B64 {
void Encode(double objective, const SparseVector<double>& v, ostream* out) {
- const int num_feats = v.num_active();
+ const int num_feats = v.size();
size_t tot_size = 0;
const size_t off_objective = tot_size;
tot_size += sizeof(double); // objective