summaryrefslogtreecommitdiff
path: root/dpmert/mr_dpmert_generate_mapper_input.cc
diff options
context:
space:
mode:
authorPatrick Simianer <simianer@cl.uni-heidelberg.de>2012-05-31 13:57:24 +0200
committerPatrick Simianer <simianer@cl.uni-heidelberg.de>2012-05-31 13:57:24 +0200
commit6f6601111710aa67eee5169e5b7d89102cc33bb8 (patch)
tree0872544abd6bc76162f3f80eb3920999afbf2c34 /dpmert/mr_dpmert_generate_mapper_input.cc
parent8cee8b565a9c56a7732365e9563f52ff3c4ff7fd (diff)
parent090a64e73f94a6a35e5364a9d416dcf75c0a2938 (diff)
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'dpmert/mr_dpmert_generate_mapper_input.cc')
-rw-r--r--dpmert/mr_dpmert_generate_mapper_input.cc7
1 files changed, 5 insertions, 2 deletions
diff --git a/dpmert/mr_dpmert_generate_mapper_input.cc b/dpmert/mr_dpmert_generate_mapper_input.cc
index 59d4f24f..199cd23a 100644
--- a/dpmert/mr_dpmert_generate_mapper_input.cc
+++ b/dpmert/mr_dpmert_generate_mapper_input.cc
@@ -52,12 +52,15 @@ int main(int argc, char** argv) {
Weights::InitFromFile(conf["weights"].as<string>(), &w, &features);
Weights::InitSparseVector(w, &origin);
const string forest_repository = conf["forest_repository"].as<string>();
- assert(DirectoryExists(forest_repository));
+ if (!DirectoryExists(forest_repository)) {
+ cerr << "Forest repository directory " << forest_repository << " not found!\n";
+ return 1;
+ }
if (conf.count("optimize_feature") > 0)
features=conf["optimize_feature"].as<vector<string> >();
vector<SparseVector<weight_t> > directions;
vector<int> fids(features.size());
- for (int i = 0; i < features.size(); ++i)
+ for (unsigned i = 0; i < features.size(); ++i)
fids[i] = FD::Convert(features[i]);
LineOptimizer::CreateOptimizationDirections(
fids,