The R Project SVN R

Rev

Rev 68947 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 68947 Rev 69855
Line 51... Line 51...
51
    if (x < 0 || x > 1) return(R_D__0);
51
    if (x < 0 || x > 1) return(R_D__0);
52
 
52
 
53
    // limit cases for (a,b), leading to point masses
53
    // limit cases for (a,b), leading to point masses
54
    if(a == 0 || b == 0 || !R_FINITE(a) || !R_FINITE(b)) {
54
    if(a == 0 || b == 0 || !R_FINITE(a) || !R_FINITE(b)) {
55
	if(a == 0 && b == 0) { // point mass 1/2 at each of {0,1} :
55
	if(a == 0 && b == 0) { // point mass 1/2 at each of {0,1} :
56
	    if (x == 0 || x == 1) return(ML_POSINF); /* else */ return(R_D__0);
56
	    if (x == 0 || x == 1) return(ML_POSINF); else return(R_D__0);
57
	}
57
	}
58
	if (a == 0 || a/b == 0) { // point mass 1 at 0
58
	if (a == 0 || a/b == 0) { // point mass 1 at 0
59
	    if (x == 0) return(ML_POSINF); /* else */ return(R_D__0);
59
	    if (x == 0) return(ML_POSINF); else return(R_D__0);
60
	}
60
	}
61
	if (b == 0 || b/a == 0) { // point mass 1 at 1
61
	if (b == 0 || b/a == 0) { // point mass 1 at 1
62
	    if (x == 1) return(ML_POSINF); /* else */ return(R_D__0);
62
	    if (x == 1) return(ML_POSINF); else return(R_D__0);
63
	}
63
	}
64
	// else, remaining case:  a = b = Inf : point mass 1 at 1/2
64
	// else, remaining case:  a = b = Inf : point mass 1 at 1/2
65
	if (x == 0.5) return(ML_POSINF); /* else */ return(R_D__0);
65
	if (x == 0.5) return(ML_POSINF); else return(R_D__0);
66
    }
66
    }
67
 
67
 
68
    if (x == 0) {
68
    if (x == 0) {
69
	if(a > 1) return(R_D__0);
69
	if(a > 1) return(R_D__0);
70
	if(a < 1) return(ML_POSINF);
70
	if(a < 1) return(ML_POSINF);