Skip to content

Commit

Permalink
Changing | to ||
Browse files Browse the repository at this point in the history
  • Loading branch information
pbreheny committed Apr 7, 2018
1 parent f20824e commit eacabc1
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions src/gdfit_binomial.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ void gd_binomial(double *b, double *x, double *r, double *eta, int g, int *K1, i
if (strcmp(penalty, "grLasso")==0) len = S(v * z_norm, lam1) / (v * (1 + lam2));
if (strcmp(penalty, "grMCP")==0) len = F(v * z_norm, lam1, lam2, gamma) / v;
if (strcmp(penalty, "grSCAD")==0) len = Fs(v * z_norm, lam1, lam2, gamma) / v;
if (len != 0 | a[K1[g]] != 0) {
if (len != 0 || a[K1[g]] != 0) {
// If necessary, update b and r
for (int j=K1[g]; j<K1[g+1]; j++) {
b[l*p+j] = len * z[j-K1[g]] / z_norm;
Expand Down Expand Up @@ -133,7 +133,7 @@ SEXP gdfit_binomial(SEXP X_, SEXP y_, SEXP penalty_, SEXP K1_, SEXP K0_, SEXP la
nv = nv + (K1[g+1]-K1[g]);
}
}
if (ng > gmax | nv > dfmax | tot_iter == max_iter) {
if (ng > gmax || nv > dfmax || tot_iter == max_iter) {
for (int ll=l; ll<L; ll++) INTEGER(iter)[ll] = NA_INTEGER;
break;
}
Expand Down
4 changes: 2 additions & 2 deletions src/gdfit_cox.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ void gd_cox(double *b, double *x, double *r, double *eta, double v, int g,
if (strcmp(penalty, "grLasso")==0) len = S(v * z_norm, lam1) / (v * (1 + lam2));
if (strcmp(penalty, "grMCP")==0) len = F(v * z_norm, lam1, lam2, gamma) / v;
if (strcmp(penalty, "grSCAD")==0) len = Fs(v * z_norm, lam1, lam2, gamma) / v;
if (len != 0 | a[K1[g]] != 0) {
if (len != 0 || a[K1[g]] != 0) {
// If necessary, update b and r
for (int j=K1[g]; j<K1[g+1]; j++) {
b[l*p+j] = len * z[j-K1[g]] / z_norm;
Expand Down Expand Up @@ -128,7 +128,7 @@ SEXP gdfit_cox(SEXP X_, SEXP d_, SEXP penalty_, SEXP K1_, SEXP K0_, SEXP lambda,
nv = nv + (K1[g+1]-K1[g]);
}
}
if (ng > gmax | nv > dfmax | tot_iter == max_iter) {
if (ng > gmax || nv > dfmax || tot_iter == max_iter) {
for (int ll=l; ll<L; ll++) INTEGER(iter)[ll] = NA_INTEGER;
break;
}
Expand Down
4 changes: 2 additions & 2 deletions src/gdfit_gaussian.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ void gd_gaussian(double *b, double *x, double *r, int g, int *K1, int *K,
if (strcmp(penalty, "grLasso")==0) len = S(z_norm, lam1) / (1+lam2);
if (strcmp(penalty, "grMCP")==0) len = F(z_norm, lam1, lam2, gamma);
if (strcmp(penalty, "grSCAD")==0) len = Fs(z_norm, lam1, lam2, gamma);
if (len != 0 | a[K1[g]] != 0) {
if (len != 0 || a[K1[g]] != 0) {
// If necessary, update beta and r
for (int j=K1[g]; j<K1[g+1]; j++) {
b[l*p+j] = len * z[j-K1[g]] / z_norm;
Expand Down Expand Up @@ -343,7 +343,7 @@ SEXP gdfit_gaussian(SEXP X_, SEXP y_, SEXP penalty_, SEXP K1_, SEXP K0_,
nv = nv + (K1[g+1]-K1[g]);
}
}
if (ng > gmax | nv > dfmax | tot_iter == max_iter) {
if (ng > gmax || nv > dfmax || tot_iter == max_iter) {
for (int ll=l; ll<L; ll++) INTEGER(iter)[ll] = NA_INTEGER;
break;
}
Expand Down
4 changes: 2 additions & 2 deletions src/gdfit_poisson.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ void gd_poisson(double *b, double *x, double *r, double v, double *eta, int g, i
if (strcmp(penalty, "grLasso")==0) len = S(v * z_norm, lam1) / (v * (1 + lam2));
if (strcmp(penalty, "grMCP")==0) len = F(v * z_norm, lam1, lam2, gamma) / v;
if (strcmp(penalty, "grSCAD")==0) len = Fs(v * z_norm, lam1, lam2, gamma) / v;
if (len != 0 | a[K1[g]] != 0) {
if (len != 0 || a[K1[g]] != 0) {
// If necessary, update b and r
for (int j=K1[g]; j<K1[g+1]; j++) {
b[l*p+j] = len * z[j-K1[g]] / z_norm;
Expand Down Expand Up @@ -132,7 +132,7 @@ SEXP gdfit_poisson(SEXP X_, SEXP y_, SEXP penalty_, SEXP K1_, SEXP K0_, SEXP lam
nv = nv + (K1[g+1]-K1[g]);
}
}
if (ng > gmax | nv > dfmax | tot_iter == max_iter) {
if (ng > gmax || nv > dfmax || tot_iter == max_iter) {
for (int ll=l; ll<L; ll++) INTEGER(iter)[ll] = NA_INTEGER;
break;
}
Expand Down
2 changes: 1 addition & 1 deletion src/lcdfit_binomial.c
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ SEXP lcdfit_binomial(SEXP X_, SEXP y_, SEXP penalty_, SEXP K1_, SEXP K0_, SEXP l
}
if (nv != nv_old) ng++;
}
if (ng > gmax | nv > dfmax | tot_iter == max_iter) {
if (ng > gmax || nv > dfmax || tot_iter == max_iter) {
for (int ll=l; ll<L; ll++) INTEGER(iter)[ll] = NA_INTEGER;
break;
}
Expand Down
2 changes: 1 addition & 1 deletion src/lcdfit_cox.c
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ SEXP lcdfit_cox(SEXP X_, SEXP d_, SEXP penalty_, SEXP K1_, SEXP K0_,
}
if (nv != nv_old) ng++;
}
if (ng > gmax | nv > dfmax | tot_iter == max_iter) {
if (ng > gmax || nv > dfmax || tot_iter == max_iter) {
for (int ll=l; ll<L; ll++) INTEGER(iter)[ll] = NA_INTEGER;
break;
}
Expand Down
2 changes: 1 addition & 1 deletion src/lcdfit_gaussian.c
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ SEXP lcdfit_gaussian(SEXP X_, SEXP y_, SEXP penalty_, SEXP K1_, SEXP K0_, SEXP l
}
if (nv != nv_old) ng++;
}
if (ng > gmax | nv > dfmax | tot_iter == max_iter) {
if (ng > gmax || nv > dfmax || tot_iter == max_iter) {
for (int ll=l; ll<L; ll++) INTEGER(iter)[ll] = NA_INTEGER;
break;
}
Expand Down
2 changes: 1 addition & 1 deletion src/lcdfit_poisson.c
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ SEXP lcdfit_poisson(SEXP X_, SEXP y_, SEXP penalty_, SEXP K1_, SEXP K0_, SEXP la
}
if (nv != nv_old) ng++;
}
if (ng > gmax | nv > dfmax | tot_iter == max_iter) {
if (ng > gmax || nv > dfmax || tot_iter == max_iter) {
for (int ll=l; ll<L; ll++) INTEGER(iter)[ll] = NA_INTEGER;
break;
}
Expand Down

0 comments on commit eacabc1

Please sign in to comment.