The R Project SVN R

Rev

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

Rev 10960 Rev 11347
Line 610... Line 610...
610
    }
610
    }
611
    SETCADR(state->R_fcall, v);
611
    SETCADR(state->R_fcall, v);
612
    value = eval(state->R_fcall, state->R_env);
612
    value = eval(state->R_fcall, state->R_env);
613
 
613
 
614
    v = getAttrib(value, R_gradientSymbol);
614
    v = getAttrib(value, R_gradientSymbol);
-
 
615
    if (v != R_NilValue) {
615
    if (v != R_NilValue && LENGTH(v) == n && (isReal(v) || isInteger(v))) {
616
	if (LENGTH(v) == n && (isReal(v) || isInteger(v))) {
616
      iagflg = 1;
617
	    iagflg = 1;
617
      state->have_gradient = 1;
618
	    state->have_gradient = 1;
618
       v = getAttrib(value, R_hessianSymbol);
619
	    v = getAttrib(value, R_hessianSymbol);
-
 
620
	    
619
       if (v != R_NilValue && LENGTH(v) == (n * n) &&
621
	    if (v != R_NilValue) {
620
 	  (isReal(v) || isInteger(v))) {
622
		if (LENGTH(v) == (n * n) && (isReal(v) || isInteger(v))) {
621
 	iahflg = 1;
623
		    iahflg = 1;
622
 	state->have_hessian = 1;
624
		    state->have_hessian = 1;
-
 
625
		} else {
-
 
626
		    warning("hessian supplied is of the wrong length or mode, so ignored");
-
 
627
		}
623
       }
628
	    }
-
 
629
	} else {
-
 
630
	    warning("gradient supplied is of the wrong length or mode, so ignored");
-
 
631
	}
624
    }
632
    }
625
    if (((msg/4) % 2) && !iahflg) { /* skip check of analytic Hessian */
633
    if (((msg/4) % 2) && !iahflg) { /* skip check of analytic Hessian */
626
      msg -= 4;
634
      msg -= 4;
627
    }
635
    }
628
    if (((msg/2) % 2) && !iagflg) { /* skip check of analytic gradient */
636
    if (((msg/2) % 2) && !iagflg) { /* skip check of analytic gradient */