chiark
/
gitweb
/
~ianmdlvl
/
nlopt.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
25a8e57
)
some rearrangement to allow us to swap in a different local optimizer
author
stevenj
<stevenj@alum.mit.edu>
Sat, 25 Aug 2007 17:34:33 +0000
(13:34 -0400)
committer
stevenj
<stevenj@alum.mit.edu>
Sat, 25 Aug 2007 17:34:33 +0000
(13:34 -0400)
darcs-hash:
20070825173433
-c8de0-
f7b21720bd8156639b7bae66482d73cff6e57bee
.gz
stogo/local.cc
patch
|
blob
|
history
diff --git
a/stogo/local.cc
b/stogo/local.cc
index 4868f2dd3e5954b2d64a28e0c813b28446cc37cc..c32d01027d514575b54bb60b34464f8d9bb7db99 100644
(file)
--- a/
stogo/local.cc
+++ b/
stogo/local.cc
@@
-26,18
+26,10
@@
int local(Trial &T, TBox &box, TBox &domain, double eps_cl, double *mgr,
#endif
) {
#endif
) {
- int k_max, info, outside ;
- int k, i, good_enough, iTmp ;
int n=box.GetDim();
int n=box.GetDim();
+ RVector x(n);
+ double tmp;
- double maxgrad, delta, f, f_new, tmp ;
- double alpha, gamma, beta, d2, s2, nom, den, ro ;
- double nrm_sd, nrm_hn, snrm_hn, nrm_dl ;
- RVector x(n), g(n), h_sd(n), h_dl(n), h_n(n), x_new(n), g_new(n) ;
- RVector s(n),y(n),z(n),w(n) ; // Temporary vectors
- RMatrix B(n), H(n) ; // Hessian and it's inverse
-
- k_max = max_iter*n ;
x=T.xvals ;
#ifdef LS_DEBUG
x=T.xvals ;
#ifdef LS_DEBUG
@@
-59,6
+51,18
@@
int local(Trial &T, TBox &box, TBox &domain, double eps_cl, double *mgr,
return LS_Old ;
}
return LS_Old ;
}
+ int k_max, info, outside ;
+ int k, i, good_enough, iTmp ;
+
+ double maxgrad, delta, f, f_new;
+ double alpha, gamma, beta, d2, s2, nom, den, ro ;
+ double nrm_sd, nrm_hn, snrm_hn, nrm_dl ;
+ RVector g(n), h_sd(n), h_dl(n), h_n(n), x_new(n), g_new(n) ;
+ RVector s(n),y(n),z(n),w(n) ; // Temporary vectors
+ RMatrix B(n), H(n) ; // Hessian and it's inverse
+
+ k_max = max_iter*n ;
+
// Initially B and H are equal to the identity matrix
B=0 ; H=0 ;
for (i=0 ; i<n ; i++) {
// Initially B and H are equal to the identity matrix
B=0 ; H=0 ;
for (i=0 ; i<n ; i++) {