Merged the patch submitted by Tamas Nepusz to fix some problems on Mac OS X.

This commit is contained in:
Naoaki Okazaki 2010-12-07 23:30:04 +09:00
parent 94854170e7
commit 327d0a5f80
3 changed files with 7 additions and 4 deletions

View File

@ -2,6 +2,7 @@
* libLBFGS 1.10: * libLBFGS 1.10:
- Fixed compiling errors on Mac OS X; this patch was kindly submitted by Nic Schraudolph. - Fixed compiling errors on Mac OS X; this patch was kindly submitted by Nic Schraudolph.
- Reduced compiling warnings on Mac OS X; this patch was kindly submitted by Tamas Nepusz.
2010-01-29 Naoaki Okazaki <okazaki at chokkan org> 2010-01-29 Naoaki Okazaki <okazaki at chokkan org>

View File

@ -601,6 +601,8 @@ libLBFGS is distributed under the term of the
- Version 1.10 (2010-xx-xx): - Version 1.10 (2010-xx-xx):
- Fixed compiling errors on Mac OS X; this patch was kindly submitted by - Fixed compiling errors on Mac OS X; this patch was kindly submitted by
Nic Schraudolph. Nic Schraudolph.
- Reduced compiling warnings on Mac OS X; this patch was kindly submitted
by Tamas Nepusz.
- Version 1.9 (2010-01-29): - Version 1.9 (2010-01-29):
- Fixed a mistake in checking the validity of the parameters "ftol" and - Fixed a mistake in checking the validity of the parameters "ftol" and
"wolfe"; this was discovered by Kevin S. Van Horn. "wolfe"; this was discovered by Kevin S. Van Horn.
@ -721,7 +723,7 @@ Special thanks go to:
- Yoshimasa Tsuruoka and Daisuke Okanohara for technical information about - Yoshimasa Tsuruoka and Daisuke Okanohara for technical information about
OWL-QN OWL-QN
- Takashi Imamichi for the useful enhancements of the backtracking method - Takashi Imamichi for the useful enhancements of the backtracking method
- Kevin S. Van Horn and Nic Schraudolph for bug fixes - Kevin S. Van Horn, Nic Schraudolph, and Tamas Nepusz for bug fixes
Finally I would like to thank the original author, Jorge Nocedal, who has been Finally I would like to thank the original author, Jorge Nocedal, who has been
distributing the effieicnt and explanatory implementation in an open source distributing the effieicnt and explanatory implementation in an open source

View File

@ -65,6 +65,7 @@ licence.
#include <config.h> #include <config.h>
#endif/*HAVE_CONFIG_H*/ #endif/*HAVE_CONFIG_H*/
#include <stdint.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <math.h> #include <math.h>
@ -73,7 +74,6 @@ licence.
#ifdef _MSC_VER #ifdef _MSC_VER
#define inline __inline #define inline __inline
typedef unsigned int uint32_t;
#endif/*_MSC_VER*/ #endif/*_MSC_VER*/
#if defined(USE_SSE) && defined(__SSE2__) && LBFGS_FLOAT == 64 #if defined(USE_SSE) && defined(__SSE2__) && LBFGS_FLOAT == 64
@ -290,7 +290,7 @@ int lbfgs(
if (n % 8 != 0) { if (n % 8 != 0) {
return LBFGSERR_INVALID_N_SSE; return LBFGSERR_INVALID_N_SSE;
} }
if (((unsigned short)x & 0x000F) != 0) { if ((uintptr_t)(const void*)x % 16 == 0) {
return LBFGSERR_INVALID_X_SSE; return LBFGSERR_INVALID_X_SSE;
} }
#endif/*defined(USE_SSE)*/ #endif/*defined(USE_SSE)*/
@ -490,7 +490,7 @@ int lbfgs(
/* Report the progress. */ /* Report the progress. */
if (cd.proc_progress) { if (cd.proc_progress) {
if (ret = cd.proc_progress(cd.instance, x, g, fx, xnorm, gnorm, step, cd.n, k, ls)) { if ((ret = cd.proc_progress(cd.instance, x, g, fx, xnorm, gnorm, step, cd.n, k, ls))) {
goto lbfgs_exit; goto lbfgs_exit;
} }
} }