Skip to content
Snippets Groups Projects
Commit 6eae285b authored by Mark Jenkinson's avatar Mark Jenkinson
Browse files

Put in a function num() to allow numbers to be printed correctly,

regardless of volume type.  [previous problem with chars]
parent 38a73346
No related branches found
No related tags found
No related merge requests found
...@@ -90,6 +90,13 @@ Option<string> talvolname(string("--talvol"), string(""), ...@@ -90,6 +90,13 @@ Option<string> talvolname(string("--talvol"), string(""),
int num(const char x) { return (int) x; }
short int num(const short int x) { return x; }
int num(const int x) { return x; }
float num(const float x) { return x; }
double num(const double x) { return x; }
template <class T> template <class T>
struct triple { T x; T y; T z; }; struct triple { T x; T y; T z; };
...@@ -342,17 +349,17 @@ void print_results(const vector<int>& idx, ...@@ -342,17 +349,17 @@ void print_results(const vector<int>& idx,
if (pthreshindex[index]>0) { if (pthreshindex[index]>0) {
float mlog10p; float mlog10p;
mlog10p = -logpvals[index]; mlog10p = -logpvals[index];
cout << setprecision(3) << pthreshindex[index] << "\t" << k << "\t"; cout << setprecision(3) << num(pthreshindex[index]) << "\t" << k << "\t";
if (!pthresh.unset()) { cout << p << "\t" << mlog10p << "\t"; } if (!pthresh.unset()) { cout << num(p) << "\t" << num(mlog10p) << "\t"; }
cout << maxvals[index] << "\t" cout << num(maxvals[index]) << "\t"
<< fmaxpos[index].x << "\t" << fmaxpos[index].y << "\t" << num(fmaxpos[index].x) << "\t" << num(fmaxpos[index].y) << "\t"
<< fmaxpos[index].z << "\t" << num(fmaxpos[index].z) << "\t"
<< fcog[index].x << "\t" << fcog[index].y << "\t" << num(fcog[index].x) << "\t" << num(fcog[index].y) << "\t"
<< fcog[index].z; << num(fcog[index].z);
if (!copename.unset()) { if (!copename.unset()) {
cout << "\t" << copemaxval[index] << "\t" cout << "\t" << num(copemaxval[index]) << "\t"
<< fcopemaxpos[index].x << "\t" << fcopemaxpos[index].y << "\t" << num(fcopemaxpos[index].x) << "\t" << num(fcopemaxpos[index].y) << "\t"
<< fcopemaxpos[index].z << "\t" << copemean[index]; << num(fcopemaxpos[index].z) << "\t" << num(copemean[index]);
} }
cout << endl; cout << endl;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment