From 47707d117b1fe767d916217042bf22c006e4ea5e Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Tue, 23 Oct 2012 16:15:23 +0200 Subject: [PATCH] Fix the C++ database insertion. --- bayeswf.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/bayeswf.cpp b/bayeswf.cpp index 205aaab..c7aad7d 100644 --- a/bayeswf.cpp +++ b/bayeswf.cpp @@ -264,9 +264,9 @@ void compute_mu_uncertainty(const float *mu, const vector &players) #else for (unsigned i = 0; i < players.size(); ++i) { for (unsigned j = 0; j < players.size(); ++j) { - printf("covariance %s %s %f\n", - players[i].c_str(), - players[j].c_str(), + printf("covariance %d %d %f\n", + players[i], + players[j], ih(i, j)); } } @@ -406,7 +406,7 @@ void process_file(const char *filename) int main(int argc, char **argv) { #if USE_DB - pqxx::connection conn("dbname=wloh_dev host=127.0.0.1 user=wloh password=oto4iCh5"); + pqxx::connection conn("dbname=wloh host=127.0.0.1 user=wloh password=oto4iCh5"); #endif for (int i = 1; i < argc; ++i) { @@ -484,7 +484,9 @@ int main(int argc, char **argv) #else //fprintf(stderr, "Optimal sigma: %f (two-player: %f)\n", sigma[0], sigma[0] * sqrt(2.0f)); for (map, float>::const_iterator it = aux_params.begin(); it != aux_params.end(); ++it) { - printf("%s: aux_param %s %f\n", it->first->first, it->first->second, it->second); + printf("%s: aux_param %s %f\n", it->first.first.c_str(), it->first.second.c_str(), it->second); } #endif + + txn.commit(); } -- 2.39.2