<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">Hi Lennart,<br>
<br>
Thanks: there is also a std:count function which count the amount
of a certain value in a array.<br>
<br>
This bug is created when I removed multiple calling of
get_masked_data for each snp.<br>
<br>
KInd regards,<br>
<br>
Maarten<br>
<br>
On 05-02-14 22:13, L.C. Karssen wrote:<br>
</div>
<blockquote cite="mid:52F2A970.4030101@karssen.org" type="cite">
<pre wrap="">Hi Maarten,
Interesting commit! I didn't know about std::copy().
To help me understand: is this a bug in the current version ProbABEL as
well, or one that was introduced by one of your previous commits?
Thanks for the good work,
Lennart.
On 04-02-14 22:00, <a class="moz-txt-link-abbreviated" href="mailto:noreply@r-forge.r-project.org">noreply@r-forge.r-project.org</a> wrote:
</pre>
<blockquote type="cite">
<pre wrap="">Author: maartenk
Date: 2014-02-04 22:00:43 +0100 (Tue, 04 Feb 2014)
New Revision: 1594
Modified:
branches/ProbABEL-0.50/src/maskedmatrix.cpp
branches/ProbABEL-0.50/src/reg1.cpp
branches/ProbABEL-0.50/src/regdata.cpp
Log:
-fixed incorrect multiplication with mmscore: other object was returned then expected.
Modified: branches/ProbABEL-0.50/src/maskedmatrix.cpp
===================================================================
--- branches/ProbABEL-0.50/src/maskedmatrix.cpp 2014-02-04 11:27:35 UTC (rev 1593)
+++ branches/ProbABEL-0.50/src/maskedmatrix.cpp 2014-02-04 21:00:43 UTC (rev 1594)
@@ -67,7 +67,6 @@
nmeasured++;
}
}
-
//Check update mask is the same as original matrix
if (nmeasured == length_of_mask)
{
Modified: branches/ProbABEL-0.50/src/reg1.cpp
===================================================================
--- branches/ProbABEL-0.50/src/reg1.cpp 2014-02-04 11:27:35 UTC (rev 1593)
+++ branches/ProbABEL-0.50/src/reg1.cpp 2014-02-04 21:00:43 UTC (rev 1594)
@@ -164,9 +164,11 @@
// column with Prob(A1A1). Note the order is swapped cf the file!
int c2 = X.ncol - 1;
- for (int i = 0; i < X.nrow; i++)
- for (int j = 0; j < (X.ncol - 2); j++)
+ for (int i = 0; i < X.nrow; i++){
+ for (int j = 0; j < (X.ncol - 2); j++){
nX[i * nX.ncol + j] = X[i * X.ncol + j];
+ }
+ }
for (int i = 0; i < nX.nrow; i++)
{
Modified: branches/ProbABEL-0.50/src/regdata.cpp
===================================================================
--- branches/ProbABEL-0.50/src/regdata.cpp 2014-02-04 11:27:35 UTC (rev 1593)
+++ branches/ProbABEL-0.50/src/regdata.cpp 2014-02-04 21:00:43 UTC (rev 1594)
@@ -14,7 +14,7 @@
#include "fvlib/frversion.h"
#include "fvlib/Logger.h"
#include "fvlib/Transposer.h"
-
+#include <algorithm> // STL algoritms
#include "regdata.h"
regdata::regdata()
@@ -203,7 +203,6 @@
int dim2X = X.ncol;
(to.X).reinit(to.nids, dim2X);
(to.Y).reinit(to.nids, dim2Y);
-
int j = 0;
for (int i = 0; i < nids; i++)
{
@@ -223,13 +222,10 @@
}
// delete [] to.masked_data;
- to.masked_data = new unsigned short int[to.nids];
- for (int i = 0; i < to.nids; i++)
- {
- to.masked_data[i] = 0;
- }
- // std::cout << "get_unmasked: " << to.nids << " "
- // << dim2X << " " << dim2Y << "\n";
+ const int arr_size = nids;
+ to.masked_data = new unsigned short int[arr_size];
+ std::copy(masked_data, masked_data+arr_size,to.masked_data);
+
return (to);
}
_______________________________________________
Genabel-commits mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Genabel-commits@lists.r-forge.r-project.org">Genabel-commits@lists.r-forge.r-project.org</a>
<a class="moz-txt-link-freetext" href="https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/genabel-commits">https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/genabel-commits</a>
</pre>
</blockquote>
<pre wrap="">
</pre>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
genabel-devel mailing list
<a class="moz-txt-link-abbreviated" href="mailto:genabel-devel@lists.r-forge.r-project.org">genabel-devel@lists.r-forge.r-project.org</a>
<a class="moz-txt-link-freetext" href="https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/genabel-devel">https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/genabel-devel</a></pre>
</blockquote>
<br>
</body>
</html>