Skip to content

Commit 9872b45

Browse files
removing debug statements
1 parent 15762af commit 9872b45

File tree

1 file changed

+3
-19
lines changed

1 file changed

+3
-19
lines changed

selectiveInference/src/debias.c

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#include <stdio.h>
21
#include <math.h> // for fabs
32

43
// Find an approximate row of \hat{Sigma}^{-1}
@@ -109,41 +108,28 @@ int check_KKT(double *theta, /* current theta */
109108

110109
gradient = *gradient_ptr_tmp;
111110

112-
fprintf(stderr, "how does it look %d %f %f\n", irow, *theta_ptr, gradient);
113-
114111
// Compute this coordinate of the gradient
115112

116113
if (fabs(*theta_ptr) > tol) { // these coordinates of gradients should be equal to \pm bound
117-
fprintf(stderr, "active %f %f\n", fabs(fabs(gradient) - bound), bound);
118114
if (fabs(fabs(gradient) - bound) > tol * bound) {
119-
fprintf(stderr, "here1 %d %f %f\n", irow, *theta_ptr, gradient);
120115
return(0);
121-
// fail += 1;
122116
}
123117
else if ((*theta_ptr > 0) && (gradient > 0)) {
124-
fprintf(stderr, "here2 %d %f %f\n", irow, *theta_ptr, gradient);
125118
return(0);
126-
// fail += 1;
127119
}
128120
else if ((*theta_ptr < 0) && (gradient < 0)) {
129-
fprintf(stderr, "here3 %d %f %f\n", irow, *theta_ptr, gradient);
130121
return(0);
131-
// fail += 1;
132122
}
133123
}
134124
else {
135-
fprintf(stderr, "before4 %d %f %f\n", irow, *theta_ptr, gradient);
136125
if (fabs(gradient) > (1. + tol) * bound) {
137-
fprintf(stderr, "here4 %d %f %f\n", irow, *theta_ptr, gradient);
138126
return(0);
139-
// fail += 1;
140127
}
141128
}
142129
theta_ptr++;
143130
gradient_ptr_tmp++;
144131
}
145132

146-
fprintf(stderr, "OK now\n");
147133
return(fail == 0);
148134

149135
}
@@ -283,7 +269,6 @@ int find_one_row_(double *Sigma_ptr, /* A covariance matrix: X^TX/n */
283269
gradient_ptr,
284270
nrow,
285271
bound) == 1) {
286-
fprintf(stderr, "here5 \n");
287272
break;
288273
}
289274

@@ -310,7 +295,6 @@ int find_one_row_(double *Sigma_ptr, /* A covariance matrix: X^TX/n */
310295
gradient_ptr,
311296
nrow,
312297
bound) == 1) {
313-
fprintf(stderr, "here6 \n");
314298
break;
315299
}
316300

@@ -322,9 +306,9 @@ int find_one_row_(double *Sigma_ptr, /* A covariance matrix: X^TX/n */
322306
bound,
323307
theta);
324308

325-
/* if (((old_value - new_value) < tol * fabs(new_value)) && (iter > 0)) { */
326-
/* break; */
327-
/* } */
309+
if (((old_value - new_value) < tol * fabs(new_value)) && (iter > 0)) {
310+
break;
311+
}
328312

329313
old_value = new_value;
330314
}

0 commit comments

Comments
 (0)