[Genabel-commits] r1062 - pkg/ProbABEL/src
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Sun Dec 23 22:04:43 CET 2012
Author: lckarssen
Date: 2012-12-23 22:04:43 +0100 (Sun, 23 Dec 2012)
New Revision: 1062
Modified:
pkg/ProbABEL/src/data.h
pkg/ProbABEL/src/eigen_mematrix.h
pkg/ProbABEL/src/gendata.cpp
pkg/ProbABEL/src/mematri1.h
Log:
Some code layout changes in ProbABEL.
- src/data.h: Added 'int' to the declaration of the npeople array; changed layout of two comments.
- src/eigen_mematrix.h: removed debug statement
- src/mematri1.h: Minor code layout changes and one change from printf() to std::cout
- src/gendata.cpp: Inserted some curly braces in for-loops.
Modified: pkg/ProbABEL/src/data.h
===================================================================
--- pkg/ProbABEL/src/data.h 2012-12-22 13:35:49 UTC (rev 1061)
+++ pkg/ProbABEL/src/data.h 2012-12-23 21:04:43 UTC (rev 1062)
@@ -45,9 +45,9 @@
class InvSigma {
private:
static const unsigned MAXIMUM_PEOPLE_AMOUNT = 1000000;
- unsigned npeople; //amount of people
+ unsigned int npeople; /* number of people */
std::string filename;
- mematrix<double> matrix; //file is stored here
+ mematrix<double> matrix; /* file is stored here */
public:
InvSigma(const char * filename_, phedata * phe);
Modified: pkg/ProbABEL/src/eigen_mematrix.h
===================================================================
--- pkg/ProbABEL/src/eigen_mematrix.h 2012-12-22 13:35:49 UTC (rev 1061)
+++ pkg/ProbABEL/src/eigen_mematrix.h 2012-12-23 21:04:43 UTC (rev 1062)
@@ -17,8 +17,6 @@
mematrix()
{
nrow = ncol = nelements = 0;
-// std::cout << "[DEBUG] creating object" << std::endl;
-
data.resize(1, 1);
}
mematrix(int nr, int nc);
Modified: pkg/ProbABEL/src/gendata.cpp
===================================================================
--- pkg/ProbABEL/src/gendata.cpp 2012-12-22 13:35:49 UTC (rev 1061)
+++ pkg/ProbABEL/src/gendata.cpp 2012-12-23 21:04:43 UTC (rev 1062)
@@ -19,16 +19,24 @@
void gendata::get_var(int var, float * data)
{
if (DAG == NULL)
+ {
for (int i = 0; i < G.nrow; i++)
+ {
data[i] = G.get(i, var);
+ }
+ }
else if (DAG != NULL)
{
float tmpdata[DAG->getNumObservations()];
DAG->readVariableAs((unsigned long int) var, tmpdata);
unsigned int j = 0;
for (unsigned int i = 0; i < DAG->getNumObservations(); i++)
+ {
if (!DAGmask[i])
+ {
data[j++] = tmpdata[i];
+ }
+ }
// std::cout << j << " " << DAG->get_nobservations() << " "
// << nids << "\n";
}
Modified: pkg/ProbABEL/src/mematri1.h
===================================================================
--- pkg/ProbABEL/src/mematri1.h 2012-12-22 13:35:49 UTC (rev 1061)
+++ pkg/ProbABEL/src/mematri1.h 2012-12-23 21:04:43 UTC (rev 1062)
@@ -244,7 +244,7 @@
if (nr < 0 || nr > nrow -1)
{
std::cerr << "mematrix::get: row out of range: " << nr + 1
- <<" not between (1," << nrow << ")\n" << std::flush;
+ << " not between (1," << nrow << ")\n" << std::flush;
exit(1);
}
DT temp = data[nr * ncol + nc];
@@ -263,7 +263,7 @@
if (nr < 0 || nr > nrow -1)
{
std::cerr << "mematrix::put: row out of range: " << nr + 1
- <<" not between (1," << nrow << ")\n" << std::flush;
+ << " not between (1," << nrow << ")\n" << std::flush;
exit(1);
}
data[nr * ncol + nc] = value;
@@ -411,7 +411,7 @@
{
if (M.nrow != order.nrow)
{
- fprintf(stderr, "reorder: M & order have differet # of rows\n");
+ std::cerr << "reorder: M & order have different # of rows\n";
exit(1);
}
mematrix<DT> temp(M.nrow, M.ncol);
More information about the Genabel-commits
mailing list