File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -95,7 +95,7 @@ int check_KKT(double *theta, /* current theta */
95
95
96
96
int irow ;
97
97
int fail = 0 ;
98
- double tol = 1.e-4 ;
98
+ double tol = 1.e-6 ;
99
99
double * theta_ptr , * gradient_ptr_tmp ;
100
100
double gradient ;
101
101
@@ -111,10 +111,10 @@ int check_KKT(double *theta, /* current theta */
111
111
}
112
112
113
113
if (* theta_ptr != 0 ) { // these coordinates of gradients should be equal to -bound
114
- if ((* theta_ptr > 0 ) && (fabs (gradient + bound ) > ( 1. + tol ) * bound )) {
114
+ if ((* theta_ptr > 0 ) && (fabs (gradient + bound ) > tol * bound )) {
115
115
fail += 1 ;
116
116
}
117
- else if ((* theta_ptr < 0 ) && (fabs (gradient - bound ) > ( 1. + tol ) * bound )) {
117
+ else if ((* theta_ptr < 0 ) && (fabs (gradient - bound ) > tol * bound )) {
118
118
fail += 1 ;
119
119
}
120
120
}
You can’t perform that action at this time.
0 commit comments