aboutsummaryrefslogtreecommitdiff
path: root/src/c/quikr.c
diff options
context:
space:
mode:
authorCalvin Morrison <mutantturkey@gmail.com>2014-03-19 15:07:34 -0400
committerCalvin Morrison <mutantturkey@gmail.com>2014-03-19 15:07:34 -0400
commit177d21491585916ba8b1159bd127e9e668f7a92d (patch)
treee506d158e72f16097650e10ec76f91f0e75beb6e /src/c/quikr.c
parent9b07de942f9289dfb494ccff9b8e081090cd8ef1 (diff)
re-organize quikr.c to match multifasta a bit more
Diffstat (limited to 'src/c/quikr.c')
-rw-r--r--src/c/quikr.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/c/quikr.c b/src/c/quikr.c
index fd1fbe5..01c5f63 100644
--- a/src/c/quikr.c
+++ b/src/c/quikr.c
@@ -197,27 +197,25 @@ int main(int argc, char **argv) {
// normalize our kmer counts and our sensing_matrix
- normalize_matrix(count_matrix_rare, 1, rare_width);
normalize_matrix(sensing_matrix_rare, sensing_matrix->sequences, rare_width);
+ normalize_matrix(count_matrix_rare, 1, rare_width);
// multiply our kmer counts and sensing matrix by lambda
- for(x = 1; x < rare_width; x++)
- count_matrix_rare[x] *= lambda;
-
- //TODO use one loop
for(x = 0; x < sensing_matrix->sequences; x++) {
for(y = 1; y < rare_width; y++) {
sensing_matrix_rare[rare_width*x + y] *= lambda;
}
}
- // count_matrix's first element should be zero
- count_matrix_rare[0] = 0;
- // stack one's on our first row of our sensing matrix
for(x = 0; x < sensing_matrix->sequences; x++) {
sensing_matrix_rare[x*rare_width] = 1.0;
}
+ // count_matrix's first element should be zero
+ count_matrix_rare[0] = 0;
+ for(x = 1; x < rare_width; x++)
+ count_matrix_rare[x] *= lambda;
+
double *solution = nnls(sensing_matrix_rare, count_matrix_rare, sensing_matrix->sequences, rare_width);
// normalize our solution vector