The R Project SVN R

Rev

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

Rev 62578 Rev 62704
Line 629... Line 629...
629
    }
629
    }
630
    *fncount = funcount;
630
    *fncount = funcount;
631
    *grcount = gradcount;
631
    *grcount = gradcount;
632
}
632
}
633
 
633
 
-
 
634
/* include setulb() */
634
#include "lbfgsb.c"
635
#include "lbfgsb.c"
635
 
636
 
636
void lbfgsb(int n, int m, double *x, double *l, double *u, int *nbd,
637
void lbfgsb(int n, int m, double *x, double *l, double *u, int *nbd,
637
	    double *Fmin, optimfn fminfn, optimgr fmingr, int *fail,
638
	    double *Fmin, optimfn fminfn, optimgr fmingr, int *fail,
638
	    void *ex, double factr, double pgtol,
639
	    void *ex, double factr, double pgtol,
Line 671... Line 672...
671
    /* this needs to be zeroed for snd in mainlb to be zeroed */
672
    /* this needs to be zeroed for snd in mainlb to be zeroed */
672
    wa = (double *) S_alloc(2*m*n+4*n+11*m*m+8*m, sizeof(double));
673
    wa = (double *) S_alloc(2*m*n+4*n+11*m*m+8*m, sizeof(double));
673
    iwa = (int *) R_alloc(3*n, sizeof(int));
674
    iwa = (int *) R_alloc(3*n, sizeof(int));
674
    strcpy(task, "START");
675
    strcpy(task, "START");
675
    while(1) {
676
    while(1) {
676
	/* Main workhorse setulb() from ../appl/lbfgsb.c : */
-
 
677
	setulb(n, m, x, l, u, nbd, &f, g, factr, &pgtol, wa, iwa, task,
677
	setulb(n, m, x, l, u, nbd, &f, g, factr, &pgtol, wa, iwa, task,
678
	       tr, lsave, isave, dsave);
678
	       tr, lsave, isave, dsave);
679
/*	Rprintf("in lbfgsb - %s\n", task);*/
679
/*	Rprintf("in lbfgsb - %s\n", task);*/
680
	if (strncmp(task, "FG", 2) == 0) {
680
	if (strncmp(task, "FG", 2) == 0) {
681
	    f = fminfn(n, x, ex);
681
	    f = fminfn(n, x, ex);