From 38de84d5d6e72728c06a57f8eeea0bb975f7192e Mon Sep 17 00:00:00 2001
From: Peter Carbonetto
Date: Wed, 31 May 2017 10:02:50 -0500
Subject: Removing FORCE_FLOAT from some more C++ source files.
---
src/io.cpp | 94 +++++++++++++++-----------------------
src/io.h | 149 ++++++++++++++++++++++++++++++++++++++++++-------------------
2 files changed, 138 insertions(+), 105 deletions(-)
(limited to 'src')
diff --git a/src/io.cpp b/src/io.cpp
index ccaec30..1a4d466 100644
--- a/src/io.cpp
+++ b/src/io.cpp
@@ -1,6 +1,6 @@
/*
- Genome-wide Efficient Mixed Model Association (GEMMA)
- Copyright (C) 2011 Xiang Zhou
+ Genome-wide Efficient Mixed Model Association (GEMMA)
+ Copyright (C) 2011-2017 Xiang Zhou
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with this program. If not, see .
+ along with this program. If not, see .
*/
#include
@@ -40,19 +40,12 @@
#include "gzstream.h"
#include "mathfunc.h"
#include "eigenlib.h"
-
-#ifdef FORCE_FLOAT
-#include "io_float.h"
-#else
#include "io.h"
-#endif
-
using namespace std;
-//Print process bar
-void ProgressBar (string str, double p, double total)
-{
+// Print progress bar.
+void ProgressBar (string str, double p, double total) {
double progress = (100.0 * p / total);
int barsize = (int) (progress / 2.0);
char bar[51];
@@ -68,10 +61,8 @@ void ProgressBar (string str, double p, double total)
return;
}
-
-//Print process bar (with acceptance ratio)
-void ProgressBar (string str, double p, double total, double ratio)
-{
+// Print progress bar with acceptance ratio.
+void ProgressBar (string str, double p, double total, double ratio) {
double progress = (100.0 * p / total);
int barsize = (int) (progress / 2.0);
char bar[51];
@@ -83,37 +74,31 @@ void ProgressBar (string str, double p, double total, double ratio)
cout<sbumpc();
return is;
case EOF:
- // Also handle the case when the last line has no line ending
+
+ // Also handle the case when the last line has no line
+ // ending.
if(t.empty())
is.setstate(std::ios::eofbit);
return is;
@@ -137,16 +124,15 @@ std::istream& safeGetline(std::istream& is, std::string& t)
}
}
-//Read snp file
-bool ReadFile_snps (const string &file_snps, set &setSnps)
-{
+// Read SNP file.
+bool ReadFile_snps (const string &file_snps, set &setSnps) {
setSnps.clear();
- //ifstream infile (file_snps.c_str(), ifstream::in);
- //if (!infile) {cout<<"error! fail to open snps file: "< &setSnps)
return true;
}
-
-bool ReadFile_snps_header (const string &file_snps, set &setSnps)
-{
+bool ReadFile_snps_header (const string &file_snps, set &setSnps) {
setSnps.clear();
- //ifstream infile (file_snps.c_str(), ifstream::in);
- //if (!infile) {cout<<"error! fail to open snps file: "< &setSnps)
return true;
}
-
//Read log file
bool ReadFile_log (const string &file_log, double &pheno_mean)
{
@@ -4085,14 +4068,7 @@ void ReadFile_mref (const string &file_mref, gsl_matrix *S_mat, gsl_matrix *Svar
//free matrices
gsl_matrix_free(S_sub);
gsl_matrix_free(Svar_sub);
- //gsl_matrix_free(V_sub);
gsl_vector_free(s);
return;
}
-
-
-
-
-
-
diff --git a/src/io.h b/src/io.h
index 073812c..365127a 100644
--- a/src/io.h
+++ b/src/io.h
@@ -1,6 +1,6 @@
/*
- Genome-wide Efficient Mixed Model Association (GEMMA)
- Copyright (C) 2011 Xiang Zhou
+ Genome-wide Efficient Mixed Model Association (GEMMA)
+ Copyright (C) 2011-2017 Xiang Zhou
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -13,13 +13,12 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with this program. If not, see .
+ along with this program. If not, see .
*/
#ifndef __IO_H__
#define __IO_H__
-
#include
#include