summaryrefslogtreecommitdiff
path: root/vest/error_surface.cc
diff options
context:
space:
mode:
authorChris Dyer <cdyer@cs.cmu.edu>2012-01-27 14:49:08 -0500
committerChris Dyer <cdyer@cs.cmu.edu>2012-01-27 14:49:08 -0500
commit47aa8d94d3ddff39295966cee67ce884c98be8da (patch)
tree2ff3eab22e44b2d02537a5b59460945f4aa98d9a /vest/error_surface.cc
parent203c3c3357b9ed8cfe44932c2bf5ea19eba6238c (diff)
rename vest to dpmert (dynamic programming mert), rename variables and types to correspond to standard geometric concepts
Diffstat (limited to 'vest/error_surface.cc')
-rw-r--r--vest/error_surface.cc42
1 files changed, 0 insertions, 42 deletions
diff --git a/vest/error_surface.cc b/vest/error_surface.cc
deleted file mode 100644
index 515b67f8..00000000
--- a/vest/error_surface.cc
+++ /dev/null
@@ -1,42 +0,0 @@
-#include "error_surface.h"
-
-#include <cassert>
-#include <sstream>
-
-using namespace std;
-
-ErrorSurface::~ErrorSurface() {}
-
-void ErrorSurface::Serialize(std::string* out) const {
- const int segments = this->size();
- ostringstream os(ios::binary);
- os.write((const char*)&segments,sizeof(segments));
- for (int i = 0; i < segments; ++i) {
- const ErrorSegment& cur = (*this)[i];
- string senc;
- cur.delta.Encode(&senc);
- assert(senc.size() < 1024);
- unsigned char len = senc.size();
- os.write((const char*)&cur.x, sizeof(cur.x));
- os.write((const char*)&len, sizeof(len));
- os.write((const char*)&senc[0], len);
- }
- *out = os.str();
-}
-
-void ErrorSurface::Deserialize(const std::string& in) {
- istringstream is(in, ios::binary);
- int segments;
- is.read((char*)&segments, sizeof(segments));
- this->resize(segments);
- for (int i = 0; i < segments; ++i) {
- ErrorSegment& cur = (*this)[i];
- unsigned char len;
- is.read((char*)&cur.x, sizeof(cur.x));
- is.read((char*)&len, sizeof(len));
- string senc(len, '\0'); assert(senc.size() == len);
- is.read((char*)&senc[0], len);
- cur.delta = SufficientStats(senc);
- }
-}
-