Revision 1108 trunk/src/nh99/t.cpp
t.cpp (revision 1108)  

2  2 
* $Id$ 
3  3 
* 
4  4 
* Author: David Fournier 
5 
* Copyright (c) 20082012 Regents of the University of California


5 
* Copyright (c) 20082012 Regents of the University of California 

6  6 
* 
7 
* Derived from algoriths described in "On the limited memory BFGS method


7 
* Derived from algoriths described in "On the limited memory BFGS method 

8  8 
* for large scale optimization", by D. Liu and J. Nocedal, 
9  9 
* Mathematical Programming B 45 (1989) 503528. 
10  10 
*/ 
...  ...  
17  17  
18  18 
// dvariable *dgold=NULL; 
19  19 
// dvariable *fold=NULL; 
20 
// dvar_vector *xlineold=NULL;


20 
// dvar_vector *xlineold=NULL; 

21  21 
// dvariable *dgbest=NULL; 
22  22 
// dvariable *fbest=NULL; 
23 
// dvar_vector *xlinebest=NULL;


23 
// dvar_vector *xlinebest=NULL; 

24  24  
25  25 
void xgoofr(void){;} 
26  26 
//dvariable sqrt(const prevariable&); 
...  ...  
28  28 
dvariable fmax(prevariable& x,double y){ if (value(x)>=y) return x; else return y;} 
29  29 
dvariable fmin(prevariable& x,double y){ if (value(x)<=y) return x; else return y;} 
30  30 
dvariable fmax(double x,double * y) 
31 
{


32 
//if (x>=y)


33 
if (1)


34 
return 1;


35 
else


31 
{ 

32 
//if (x>=y) 

33 
if (1) 

34 
return 1; 

35 
else 

36  36 
return 2; 
37  37 
} 
38  38 
dvariable fmax(double x,double & y){ if (x>=y) return x; else return y;} 
...  ...  
62  62 
dvariable tmp2=tmp*tmp; 
63  63 
dvariable tmp3=tmp*tmp*tmp; 
64  64 
return (1.24*tmp3+64*tmp3*tmp48*tmp3*tmp2); 
65 
}


65 
} 

66  66 
} 
67  67  
68  68 
#ifdef __cplusplus 
...  ...  
187  187 
} inlist; 
188  188  
189  189 
#define VOID void 
190 
//


190 
// 

191  191 
// union Multitype { /* for multiple entry points */ 
192  192 
// integer1 g; 
193  193 
// shortint h; 
...  ...  
198  198 
// complex c; 
199  199 
// //doublecomplex z; 
200  200 
// }; 
201 
//


201 
// 

202  202 
// typedef union Multitype Multitype; 
203 
//


203 
// 

204  204 
/*typedef long int Long;*/ /* No longer used; formerly in Namelist */ 
205  205  
206  206 
struct Vardesc { /* for Namelist */ 
...  ...  
431  431  
432  432 
/* Builtin functions */ 
433  433 
//integer //s_wsfe(cilist *), e_wsfe(); 
434 


434  
435  435 
//integer // do_fio(integer *, char *, ftnlen); 
436  436  
437  437 
/* Local variables */ 
...  ...  
442  442 
static double ftol; 
443  443 
static integer nfun, ispt, iypt, i, bound; 
444  444 
static dvariable gnorm; 
445 
//extern /* Subroutine */


445 
//extern /* Subroutine */ 

446  446 
// int xdaxpy_(integer *n, dvariable* da,const dvar_vector & dx, integer *incx, const dvar_vector & dy, integer *incy); 
447  447 
static integer point; 
448  448 
//static dvariable xnorm; 
...  ...  
452  452 
static logical finish; 
453  453 
static dvariable yy; 
454  454 
static integer maxfev; 
455 
extern /* Subroutine */ int xlb1_(integer *, integer *, integer *, 

456 
dvar_vector & , integer *, integer *, dvar_vector & , dvar_vector & , 

455 
extern /* Subroutine */ int xlb1_(integer *, integer *, integer *, 
Also available in: Unified diff