summaryrefslogtreecommitdiff
path: root/utils/phmt.cc
diff options
context:
space:
mode:
authorChris Dyer <cdyer@cs.cmu.edu>2011-09-13 17:36:23 +0100
committerChris Dyer <cdyer@cs.cmu.edu>2011-09-13 17:36:23 +0100
commit251da4347ea356f799e6c227ac8cf541c0cef2f2 (patch)
tree407e647e34aa89049754d83e9e1eb2cddff05de8 /utils/phmt.cc
parent75bff8e374f3cdcf3dc141f8b7b37858d0611234 (diff)
get rid of bad Weights class so it no longer keeps a copy of a vector inside it
Diffstat (limited to 'utils/phmt.cc')
-rw-r--r--utils/phmt.cc8
1 files changed, 2 insertions, 6 deletions
diff --git a/utils/phmt.cc b/utils/phmt.cc
index 1f59afaf..48d9f093 100644
--- a/utils/phmt.cc
+++ b/utils/phmt.cc
@@ -19,22 +19,18 @@ int main(int argc, char** argv) {
cerr << "LexFE = " << FD::Convert("LexFE") << endl;
cerr << "LexEF = " << FD::Convert("LexEF") << endl;
{
- Weights w;
vector<weight_t> v(FD::NumFeats());
v[FD::Convert("LexFE")] = 1.0;
v[FD::Convert("LexEF")] = 0.5;
- w.InitFromVector(v);
cerr << "Writing...\n";
- w.WriteToFile("weights.bin");
+ Weights::WriteToFile("weights.bin", v);
cerr << "Done.\n";
}
{
- Weights w;
vector<weight_t> v(FD::NumFeats());
cerr << "Reading...\n";
- w.InitFromFile("weights.bin");
+ Weights::InitFromFile("weights.bin", &v);
cerr << "Done.\n";
- w.InitVector(&v);
assert(v[FD::Convert("LexFE")] == 1.0);
assert(v[FD::Convert("LexEF")] == 0.5);
}