Branch Coverage

levmar-2.5/lm_core.c
Criterion Covered Total %
branch 359 440 81.5


line true false branch
96 250 119 for(j=0; j < m; ++j) {
12 6 for(j=0; j < m; ++j) {
100 194818 119 for(j=0; j
112 6 for(j=0; j
129 0 119 if(n
0 6 if(n
134 0 119 if(!jacf){
0 6 if(!jacf){
140 119 0 if(opts){
6 0 if(opts){
155 0 119 if(!work){
0 6 if(!work){
158 0 0 if(!work){
0 0 if(!work){
187 0 119 if(!LM_FINITE(p_eL2)) stop=7;
0 6 if(!LM_FINITE(p_eL2)) stop=7;
189 15974 4 for(k=0; k
15958 16 for(k=0; k
15031 3 for(k=0; k
15029 2 for(k=0; k
192 99 15859 if(p_eL2<=eps3){ /* error is small */
1 15028 if(p_eL2<=eps3){ /* error is small */
229 60960 15240 for(i=m*m; i-->0; )
60112 15028 for(i=m*m; i-->0; )
231 30480 15240 for(i=m; i-->0; )
30056 15028 for(i=m; i-->0; )
234 48568 15240 for(l=n; l-->0; ){
30666 15028 for(l=n; l-->0; ){
236 97136 48568 for(i=m; i-->0; ){
61332 30666 for(i=m; i-->0; ){
239 145704 97136 for(j=i+1; j-->0; ) /* j<=i computes lower triangular part only */
91998 61332 for(j=i+1; j-->0; ) /* j<=i computes lower triangular part only */
247 30480 15240 for(i=m; i-->0; ) /* copy to upper part */
30056 15028 for(i=m; i-->0; ) /* copy to upper part */
248 15240 30480 for(j=i+1; j
15028 30056 for(j=i+1; j
258 1298 619 for(i=0; i
0 0 for(i=0; i
261 1573000 619 for(i=0; i
0 0 for(i=0; i
264 3206000 1573000 for(l=0, jacrow=jac+i*m, tmp=e[i]; l
0 0 for(l=0, jacrow=jac+i*m, tmp=e[i]; l
270 31778 15859 for(i=0, p_L2=jacTe_inf=0.0; i
30056 15028 for(i=0, p_L2=jacTe_inf=0.0; i
271 25337 6441 if(jacTe_inf < (tmp=FABS(jacTe[i]))) jacTe_inf=tmp;
25460 6318 if(jacTe_inf < (tmp=FABS(jacTe[i]))) jacTe_inf=tmp;
24425 5631 if(jacTe_inf < (tmp=FABS(jacTe[i]))) jacTe_inf=tmp;
24335 5721 if(jacTe_inf < (tmp=FABS(jacTe[i]))) jacTe_inf=tmp;
288 0 15859 if((jacTe_inf <= eps1)){
0 15028 if((jacTe_inf <= eps1)){
295 119 15740 if(k==0){
6 15022 if(k==0){
296 250 119 for(i=0, tmp=LM_REAL_MIN; i
12 6 for(i=0, tmp=LM_REAL_MIN; i
297 153 97 if(diag_jacTjac[i]>tmp) tmp=diag_jacTjac[i]; /* find max diagonal element */
6 6 if(diag_jacTjac[i]>tmp) tmp=diag_jacTjac[i]; /* find max diagonal element */
304 41664 20802 for(i=0; i
39212 19606 for(i=0; i
328 41664 20802 for(i=0, Dp_L2=0.0; i
39212 19606 for(i=0, Dp_L2=0.0; i
334 4 20798 if(Dp_L2<=eps2_sq*p_L2){ /* relative change in p is small, stop */
2 19604 if(Dp_L2<=eps2_sq*p_L2){ /* relative change in p is small, stop */
340 0 20798 if(Dp_L2>=(p_L2+eps2)/(LM_CNST(EPSILON)*LM_CNST(EPSILON))){ /* almost singular */
0 19604 if(Dp_L2>=(p_L2+eps2)/(LM_CNST(EPSILON)*LM_CNST(EPSILON))){ /* almost singular */
365 41632 20786 for(i=0, dL=0.0; i
39208 19604 for(i=0, dL=0.0; i
370 20786 0 if(dL>0.0 && dF>0.0){ /* reduction in error, increment is accepted */
15843 4943 if(dL>0.0 && dF>0.0){ /* reduction in error, increment is accepted */
19604 0 if(dL>0.0 && dF>0.0){ /* reduction in error, increment is accepted */
15026 4578 if(dL>0.0 && dF>0.0){ /* reduction in error, increment is accepted */
373 11880 3963 mu=mu*( (tmp>=LM_CNST(ONE_THIRD))? tmp : LM_CNST(ONE_THIRD) );
11834 3192 mu=mu*( (tmp>=LM_CNST(ONE_THIRD))? tmp : LM_CNST(ONE_THIRD) );
376 31746 15843 for(i=0 ; i
30052 15026 for(i=0 ; i
379 1609556 15843 for(i=0; i
30660 15026 for(i=0; i
392 0 4943 if(nu2<=nu){ /* nu has wrapped around (overflown). Thanks to Frank Jordan for spotting this case */
0 4578 if(nu2<=nu){ /* nu has wrapped around (overflown). Thanks to Frank Jordan for spotting this case */
398 9886 4943 for(i=0; i
9156 4578 for(i=0; i
403 4 115 if(k>=itmax) stop=3;
3 3 if(k>=itmax) stop=3;
405 250 119 for(i=0; i
12 6 for(i=0; i
408 119 0 if(info){
6 0 if(info){
413 250 119 for(i=0, tmp=LM_REAL_MIN; i
12 6 for(i=0, tmp=LM_REAL_MIN; i
414 194 56 if(tmp
9 3 if(tmp
424 250 119 for(i=0; i
12 6 for(i=0; i
429 119 0 if(covar){
6 0 if(covar){
433 0 119 if(freework) free(work);
0 6 if(freework) free(work);
436 119 0 if(linsolver) (*linsolver)(NULL, NULL, NULL, 0);
6 0 if(linsolver) (*linsolver)(NULL, NULL, NULL, 0);
439 119 0 return (stop!=4 && stop!=7)? k : LM_ERROR;
107 12 return (stop!=4 && stop!=7)? k : LM_ERROR;
6 0 return (stop!=4 && stop!=7)? k : LM_ERROR;
6 0 return (stop!=4 && stop!=7)? k : LM_ERROR;
510 0 13 if(n
0 5 if(n
515 13 0 if(opts){
5 0 if(opts){
522 0 13 if(delta<0.0){
0 5 if(delta<0.0){
536 0 13 if(!work){
0 5 if(!work){
539 0 0 if(!work){
0 0 if(!work){
570 0 13 if(!LM_FINITE(p_eL2)) stop=7;
0 5 if(!LM_FINITE(p_eL2)) stop=7;
574 726 0 for(k=0; k
726 0 for(k=0; k
610 0 for(k=0; k
610 0 for(k=0; k
577 10 716 if(p_eL2<=eps3){ /* error is small */
3 607 if(p_eL2<=eps3){ /* error is small */
586 682 34 if((updp && nu>16) || updjac==K){ /* compute difference approximation to J */
665 17 if((updp && nu>16) || updjac==K){ /* compute difference approximation to J */
59 640 if((updp && nu>16) || updjac==K){ /* compute difference approximation to J */
587 20 if((updp && nu>16) || updjac==K){ /* compute difference approximation to J */
580 7 if((updp && nu>16) || updjac==K){ /* compute difference approximation to J */
55 545 if((updp && nu>16) || updjac==K){ /* compute difference approximation to J */
587 76 0 if(using_ffdif){ /* use forward differences */
62 0 if(using_ffdif){ /* use forward differences */
598 682 34 if(newjac){ /* Jacobian has changed, recompute J^T J, J^t e, etc */
587 20 if(newjac){ /* Jacobian has changed, recompute J^T J, J^t e, etc */
602 575 107 if(nm<=__BLOCKSZ__SQ){ // this is a small problem
574 13 if(nm<=__BLOCKSZ__SQ){ // this is a small problem
625 2300 575 for(i=m*m; i-->0; )
2296 574 for(i=m*m; i-->0; )
627 1150 575 for(i=m; i-->0; )
1148 574 for(i=m; i-->0; )
630 1231 575 for(l=n; l-->0; ){
1188 574 for(l=n; l-->0; ){
632 2462 1231 for(i=m; i-->0; ){
2376 1188 for(i=m; i-->0; ){
635 3693 2462 for(j=i+1; j-->0; ) /* j<=i computes lower triangular part only */
3564 2376 for(j=i+1; j-->0; ) /* j<=i computes lower triangular part only */
643 1150 575 for(i=m; i-->0; ) /* copy to upper part */
1148 574 for(i=m; i-->0; ) /* copy to upper part */
644 575 1150 for(j=i+1; j
574 1148 for(j=i+1; j
653 251 107 for(i=0; i
39 13 for(i=0; i
656 856613 107 for(i=0; i
132613 13 for(i=0; i
659 1869839 856613 for(l=0, jacrow=jac+i*m, tmp=e[i]; l
397839 132613 for(l=0, jacrow=jac+i*m, tmp=e[i]; l
665 1401 682 for(i=0, p_L2=jacTe_inf=0.0; i
1187 587 for(i=0, p_L2=jacTe_inf=0.0; i
666 738 663 if(jacTe_inf < (tmp=FABS(jacTe[i]))) jacTe_inf=tmp;
781 620 if(jacTe_inf < (tmp=FABS(jacTe[i]))) jacTe_inf=tmp;
615 572 if(jacTe_inf < (tmp=FABS(jacTe[i]))) jacTe_inf=tmp;
621 566 if(jacTe_inf < (tmp=FABS(jacTe[i]))) jacTe_inf=tmp;
684 0 716 if((jacTe_inf <= eps1)){
0 607 if((jacTe_inf <= eps1)){
691 13 703 if(k==0){
5 602 if(k==0){
692 30 13 for(i=0, tmp=LM_REAL_MIN; i
11 5 for(i=0, tmp=LM_REAL_MIN; i
693 22 8 if(diag_jacTjac[i]>tmp) tmp=diag_jacTjac[i]; /* find max diagonal element */
7 4 if(diag_jacTjac[i]>tmp) tmp=diag_jacTjac[i]; /* find max diagonal element */
700 1469 716 for(i=0; i
1227 607 for(i=0; i
723 1469 716 for(i=0, Dp_L2=0.0; i
1227 607 for(i=0, Dp_L2=0.0; i
729 3 713 if(Dp_L2<=eps2_sq*p_L2){ /* relative change in p is small, stop */
2 605 if(Dp_L2<=eps2_sq*p_L2){ /* relative change in p is small, stop */
735 0 713 if(Dp_L2>=(p_L2+eps2)/(LM_CNST(EPSILON)*LM_CNST(EPSILON))){ /* almost singular */
0 605 if(Dp_L2>=(p_L2+eps2)/(LM_CNST(EPSILON)*LM_CNST(EPSILON))){ /* almost singular */
762 107 606 if(updp || dF>0){ /* update jac */
73 34 if(updp || dF>0){ /* update jac */
80 525 if(updp || dF>0){ /* update jac */
60 20 if(updp || dF>0){ /* update jac */
763 857835 679 for(i=0; i
133795 585 for(i=0; i
764 1872283 857835 for(l=0, tmp=0.0; l
400203 133795 for(l=0, tmp=0.0; l
767 1872283 857835 for(j=0; j
400203 133795 for(j=0; j
774 1463 713 for(i=0, dL=0.0; i
1223 605 for(i=0, dL=0.0; i
777 713 0 if(dL>0.0 && dF>0.0){ /* reduction in error, increment is accepted */
499 214 if(dL>0.0 && dF>0.0){ /* reduction in error, increment is accepted */
605 0 if(dL>0.0 && dF>0.0){ /* reduction in error, increment is accepted */
387 218 if(dL>0.0 && dF>0.0){ /* reduction in error, increment is accepted */
780 364 135 mu=mu*( (tmp>=LM_CNST(ONE_THIRD))? tmp : LM_CNST(ONE_THIRD) );
320 67 mu=mu*( (tmp>=LM_CNST(ONE_THIRD))? tmp : LM_CNST(ONE_THIRD) );
783 1035 499 for(i=0 ; i
787 387 for(i=0 ; i
786 727480 499 for(i=0; i
133385 387 for(i=0; i
802 0 214 if(nu2<=nu){ /* nu has wrapped around (overflown). Thanks to Frank Jordan for spotting this case */
0 218 if(nu2<=nu){ /* nu has wrapped around (overflown). Thanks to Frank Jordan for spotting this case */
808 428 214 for(i=0; i
436 218 for(i=0; i
812 0 13 if(k>=itmax) stop=3;
0 5 if(k>=itmax) stop=3;
814 30 13 for(i=0; i
11 5 for(i=0; i
817 13 0 if(info){
5 0 if(info){
822 30 13 for(i=0, tmp=LM_REAL_MIN; i
11 5 for(i=0, tmp=LM_REAL_MIN; i
823 20 10 if(tmp
5 6 if(tmp
833 13 0 if(covar){
5 0 if(covar){
838 0 13 if(freework) free(work);
0 5 if(freework) free(work);
841 13 0 if(linsolver) (*linsolver)(NULL, NULL, NULL, 0);
5 0 if(linsolver) (*linsolver)(NULL, NULL, NULL, 0);
844 13 0 return (stop!=4 && stop!=7)? k : LM_ERROR;
13 0 return (stop!=4 && stop!=7)? k : LM_ERROR;
5 0 return (stop!=4 && stop!=7)? k : LM_ERROR;
5 0 return (stop!=4 && stop!=7)? k : LM_ERROR;