roboptim-commit Mailing List for RobOptim (Page 97)
Status: Beta
Brought to you by:
flamiraux
You can subscribe to this list here.
2009 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(62) |
Jul
(62) |
Aug
(36) |
Sep
(24) |
Oct
(41) |
Nov
(182) |
Dec
(8) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2010 |
Jan
(12) |
Feb
(13) |
Mar
(104) |
Apr
(95) |
May
(90) |
Jun
(90) |
Jul
(93) |
Aug
(97) |
Sep
(91) |
Oct
(93) |
Nov
(90) |
Dec
(95) |
2011 |
Jan
(96) |
Feb
(84) |
Mar
(94) |
Apr
(91) |
May
(93) |
Jun
(91) |
Jul
(93) |
Aug
(93) |
Sep
(107) |
Oct
(93) |
Nov
(58) |
Dec
|
2012 |
Jan
(8) |
Feb
(4) |
Mar
|
Apr
(3) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
(6) |
Dec
(5) |
2013 |
Jan
(16) |
Feb
(22) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Thomas M. <tho...@us...> - 2009-06-16 06:27:50
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "roboptim". The branch, core has been updated via 84b9add6b020a9543e7762303026943178e798c5 (commit) from 87e12bc00ac637af31eff18ffebbc7889e94c0a4 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 84b9add6b020a9543e7762303026943178e798c5 Author: Thomas Moulard <tho...@gm...> Date: Tue Jun 16 15:25:35 2009 +0900 Synchronize with share. * build-aux/pkg-config.mk: Here. Signed-off-by: Thomas Moulard <tho...@gm...> diff --git a/ChangeLog b/ChangeLog index 9dc1f69..b120b3c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2009-06-16 Thomas Moulard <tho...@gm...> + Synchronize with share. + * build-aux/pkg-config.mk: Here. + +2009-06-16 Thomas Moulard <tho...@gm...> + Require at least Boost 1.37. * configure.ac: Check that Boost version is newer than 1.37 to allow the use of make_shared. diff --git a/build-aux/pkg-config.mk b/build-aux/pkg-config.mk index 5dc23aa..c138112 100644 --- a/build-aux/pkg-config.mk +++ b/build-aux/pkg-config.mk @@ -55,7 +55,7 @@ edit = $(SED) -e "s|@prefix\@|$(prefix)|" \ -e 's,@VERSION\@,$(PACKAGE_VERSION),g' EXTRA_DIST += build-aux/pkg-config.pc.in -CLEANFILES += $(PKG_CONFIG_FILE) +CLEANFILES += $(pkg_config_file) # pkg-config generation. @PACKAGE_TARNAME@.pc: $(srcdir)/build-aux/pkg-config.pc.in @@ -67,11 +67,11 @@ install-data-local: install-pkg-config uninstall-local: uninstall-pkg-config install-pkg-config: $(PACKAGE_TARNAME).pc - $(mkdir_p) $(PKG_DIR) - $(install_sh_DATA) "$(PKG_CONFIG_FILE)" $(PKG_DIR) + $(mkdir_p) $(pkgdir) + $(install_sh_DATA) $(pkg_config_file) $(pkgdir) uninstall-pkg-config: - -rm -f "$(PKG_DIR)$(PKG_CONFIG_FILE)" + -rm -f "$(pkgdir)$(pkg_config_file)" # Check that the pkg-config file is generated. check-local: @PACKAGE_TARNAME@.pc ----------------------------------------------------------------------- Summary of changes: ChangeLog | 5 +++++ build-aux/pkg-config.mk | 8 ++++---- 2 files changed, 9 insertions(+), 4 deletions(-) hooks/post-receive -- roboptim |
From: Thomas M. <tho...@us...> - 2009-06-16 06:27:13
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "roboptim". The branch, trajectory has been updated via 0353ccbd345bbd6f636079031a16c541fe200604 (commit) from fbaa084129e9e19cca30dab3318576dcd468612f (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 0353ccbd345bbd6f636079031a16c541fe200604 Author: Thomas Moulard <tho...@gm...> Date: Tue Jun 16 15:24:58 2009 +0900 Synchonize with share. * build-aux/pkg-config.mk: Here. Signed-off-by: Thomas Moulard <tho...@gm...> diff --git a/ChangeLog b/ChangeLog index c7f37c5..f6726f6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2009-06-16 Thomas Moulard <tho...@gm...> + Synchonize with share. + * build-aux/pkg-config.mk: Here. + +2009-06-16 Thomas Moulard <tho...@gm...> + Fix buildchain. * Makefile.am: Use new pkg-config rules. diff --git a/build-aux/pkg-config.mk b/build-aux/pkg-config.mk index 5dc23aa..c138112 100644 --- a/build-aux/pkg-config.mk +++ b/build-aux/pkg-config.mk @@ -55,7 +55,7 @@ edit = $(SED) -e "s|@prefix\@|$(prefix)|" \ -e 's,@VERSION\@,$(PACKAGE_VERSION),g' EXTRA_DIST += build-aux/pkg-config.pc.in -CLEANFILES += $(PKG_CONFIG_FILE) +CLEANFILES += $(pkg_config_file) # pkg-config generation. @PACKAGE_TARNAME@.pc: $(srcdir)/build-aux/pkg-config.pc.in @@ -67,11 +67,11 @@ install-data-local: install-pkg-config uninstall-local: uninstall-pkg-config install-pkg-config: $(PACKAGE_TARNAME).pc - $(mkdir_p) $(PKG_DIR) - $(install_sh_DATA) "$(PKG_CONFIG_FILE)" $(PKG_DIR) + $(mkdir_p) $(pkgdir) + $(install_sh_DATA) $(pkg_config_file) $(pkgdir) uninstall-pkg-config: - -rm -f "$(PKG_DIR)$(PKG_CONFIG_FILE)" + -rm -f "$(pkgdir)$(pkg_config_file)" # Check that the pkg-config file is generated. check-local: @PACKAGE_TARNAME@.pc ----------------------------------------------------------------------- Summary of changes: ChangeLog | 5 +++++ build-aux/pkg-config.mk | 8 ++++---- 2 files changed, 9 insertions(+), 4 deletions(-) hooks/post-receive -- roboptim |
From: Thomas M. <tho...@us...> - 2009-06-16 06:26:54
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "roboptim". The branch, share has been updated via a53adc1a84735ceaf8071556387af2aec305d2e2 (commit) from 0e3cc5c43fa02c2054e6453842ec3066a067a249 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit a53adc1a84735ceaf8071556387af2aec305d2e2 Author: Thomas Moulard <tho...@gm...> Date: Tue Jun 16 15:24:37 2009 +0900 Fix broken pkg-config.mk file. * .gitignore: New. * build-aux/pkg-config.mk: Fix variable names. Signed-off-by: Thomas Moulard <tho...@gm...> diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..46af51c --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +,* ++committed* diff --git a/ChangeLog b/ChangeLog index 574cb98..cdbb6dc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2009-06-16 Thomas Moulard <tho...@gm...> + + Fix broken pkg-config.mk file. + * .gitignore: New. + * build-aux/pkg-config.mk: Fix variable names. + 2009-06-15 Thomas Moulard <tho...@gm...> Update to new constraint interface. diff --git a/build-aux/pkg-config.mk b/build-aux/pkg-config.mk index 5dc23aa..c138112 100644 --- a/build-aux/pkg-config.mk +++ b/build-aux/pkg-config.mk @@ -55,7 +55,7 @@ edit = $(SED) -e "s|@prefix\@|$(prefix)|" \ -e 's,@VERSION\@,$(PACKAGE_VERSION),g' EXTRA_DIST += build-aux/pkg-config.pc.in -CLEANFILES += $(PKG_CONFIG_FILE) +CLEANFILES += $(pkg_config_file) # pkg-config generation. @PACKAGE_TARNAME@.pc: $(srcdir)/build-aux/pkg-config.pc.in @@ -67,11 +67,11 @@ install-data-local: install-pkg-config uninstall-local: uninstall-pkg-config install-pkg-config: $(PACKAGE_TARNAME).pc - $(mkdir_p) $(PKG_DIR) - $(install_sh_DATA) "$(PKG_CONFIG_FILE)" $(PKG_DIR) + $(mkdir_p) $(pkgdir) + $(install_sh_DATA) $(pkg_config_file) $(pkgdir) uninstall-pkg-config: - -rm -f "$(PKG_DIR)$(PKG_CONFIG_FILE)" + -rm -f "$(pkgdir)$(pkg_config_file)" # Check that the pkg-config file is generated. check-local: @PACKAGE_TARNAME@.pc ----------------------------------------------------------------------- Summary of changes: .gitignore | 2 ++ ChangeLog | 6 ++++++ build-aux/pkg-config.mk | 8 ++++---- 3 files changed, 12 insertions(+), 4 deletions(-) create mode 100644 .gitignore hooks/post-receive -- roboptim |
From: Thomas M. <tho...@us...> - 2009-06-16 06:19:06
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "roboptim". The branch, trajectory has been updated via fbaa084129e9e19cca30dab3318576dcd468612f (commit) from 0838415b946ec1ffc24bf41db39d20c4a7ece4c3 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit fbaa084129e9e19cca30dab3318576dcd468612f Author: Thomas Moulard <tho...@gm...> Date: Tue Jun 16 15:16:48 2009 +0900 Fix buildchain. * Makefile.am: Use new pkg-config rules. Signed-off-by: Thomas Moulard <tho...@gm...> diff --git a/ChangeLog b/ChangeLog index 75b9144..c7f37c5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2009-06-16 Thomas Moulard <tho...@gm...> + Fix buildchain. + * Makefile.am: Use new pkg-config rules. + +2009-06-16 Thomas Moulard <tho...@gm...> + Implement Freeze class. * include/Makefile.am: Distribute new headers. * include/roboptim/trajectory/freeze.hh: New. diff --git a/Makefile.am b/Makefile.am index 3edf7e4..cca0bdb 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,3 +1,5 @@ +include $(top_srcdir)/build-aux/init.mk + # Search for autoconf macros in build-aux. ACLOCAL_AMFLAGS = -I build-aux @@ -9,7 +11,7 @@ SUBDIRS = \ # Provide bootstrap with the generated package. -EXTRA_DIST = bootstrap build-aux/bootstrap +EXTRA_DIST += bootstrap build-aux/bootstrap # Nothing to do in this directory. @@ -19,37 +21,7 @@ all: LIBTOOL_DEPS = @LIBTOOL_DEPS@ libtool: $(LIBTOOL_DEPS) - -# Pkg-config generation -PKG_CONFIG_FILE = @PACKAGE_TARNAME@.pc -PKG_DIR="$(DESTDIR)$(libdir)/pkgconfig/" - -edit = $(SED) -e "s|@prefix\@|$(prefix)|" \ - -e 's,@exec_prefix\@,$(exec_prefix),g' \ - -e 's,@libdir\@,$(libdir),g' \ - -e 's,@includedir\@,$(includedir),g' \ - -e 's,@datarootdir\@,$(datarootdir),g' \ - -e 's,@PACKAGE\@,$(PACKAGE),g' \ - -e 's,@PACKAGE_TARNAME\@,$(PACKAGE_TARNAME),g' \ - -e 's,@PACKAGE_REQD\@,$(PACKAGE_REQD),g' \ - -e 's,@VERSION\@,$(PACKAGE_VERSION),g' - -@PACKAGE_TARNAME@.pc: $(srcdir)/configure $(srcdir)/build-aux/pkg-config.pc.in - $(edit) $(srcdir)/build-aux/pkg-config.pc.in >$@ - -EXTRA_DIST += build-aux/pkg-config.pc.in -CLEANFILES = $(PKG_CONFIG_FILE) - -install-data-local: install-pkg-config -uninstall-local: uninstall-pkg-config - -install-pkg-config: $(PACKAGE_TARNAME).pc - $(mkdir_p) $(PKG_DIR) - cp "$(PKG_CONFIG_FILE)" $(PKG_DIR) - -uninstall-pkg-config: - rm "$(PKG_DIR)$(PKG_CONFIG_FILE)" - +include $(top_srcdir)/build-aux/pkg-config.mk # -- Generate documentation .PHONY: doc html ----------------------------------------------------------------------- Summary of changes: ChangeLog | 5 +++++ Makefile.am | 36 ++++-------------------------------- 2 files changed, 9 insertions(+), 32 deletions(-) hooks/post-receive -- roboptim |
From: Thomas M. <tho...@us...> - 2009-06-16 04:33:30
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "roboptim". The branch, core has been updated via 87e12bc00ac637af31eff18ffebbc7889e94c0a4 (commit) from 841ab2a0706260951f4fbe512f165b9dc29a15f5 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 87e12bc00ac637af31eff18ffebbc7889e94c0a4 Author: Thomas Moulard <tho...@gm...> Date: Tue Jun 16 13:31:17 2009 +0900 Require at least Boost 1.37. * configure.ac: Check that Boost version is newer than 1.37 to allow the use of make_shared. Signed-off-by: Thomas Moulard <tho...@gm...> diff --git a/ChangeLog b/ChangeLog index c99989f..9dc1f69 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 2009-06-16 Thomas Moulard <tho...@gm...> + Require at least Boost 1.37. + * configure.ac: Check that Boost version is newer + than 1.37 to allow the use of make_shared. + +2009-06-16 Thomas Moulard <tho...@gm...> + Fix buildchain. * Makefile.am: Remove useless rules. diff --git a/configure.ac b/configure.ac index 3c4b268..ce1e6b0 100644 --- a/configure.ac +++ b/configure.ac @@ -63,6 +63,9 @@ AC_CHECK_LIB([ltdl], [lt_dlopen], [], # Search for Boost + +# Need 1.37 for boost::make_shared. +BOOST_REQUIRE(1.37) BOOST_FORMAT BOOST_MPL BOOST_OPTIONAL ----------------------------------------------------------------------- Summary of changes: ChangeLog | 6 ++++++ configure.ac | 3 +++ 2 files changed, 9 insertions(+), 0 deletions(-) hooks/post-receive -- roboptim |
From: Thomas M. <tho...@us...> - 2009-06-16 04:22:57
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "roboptim". The branch, core has been updated via 841ab2a0706260951f4fbe512f165b9dc29a15f5 (commit) from a6c1e8dad3cfd49324f28ca39103bb7a5ea0d738 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 841ab2a0706260951f4fbe512f165b9dc29a15f5 Author: Thomas Moulard <tho...@gm...> Date: Tue Jun 16 13:20:43 2009 +0900 Fix buildchain. * Makefile.am: Remove useless rules. Signed-off-by: Thomas Moulard <tho...@gm...> diff --git a/ChangeLog b/ChangeLog index 9a9b8d7..c99989f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2009-06-16 Thomas Moulard <tho...@gm...> + Fix buildchain. + * Makefile.am: Remove useless rules. + +2009-06-16 Thomas Moulard <tho...@gm...> + Add sections into Problem class. * include/roboptim/core/problem.hh: Here. diff --git a/Makefile.am b/Makefile.am index acd4386..4ffdf04 100644 --- a/Makefile.am +++ b/Makefile.am @@ -11,7 +11,11 @@ SUBDIRS = \ # Provide bootstrap with the generated package. -EXTRA_DIST = bootstrap build-aux/bootstrap $(PACKAGE_TARNAME).m4 THANKS TODO +EXTRA_DIST += bootstrap \ + build-aux/bootstrap \ + $(PACKAGE_TARNAME).m4 \ + THANKS \ + TODO # Nothing to do in this directory. @@ -22,22 +26,8 @@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ libtool: $(LIBTOOL_DEPS) $(SHELL) ./config.status --recheck -# Pkg-config generation -PKG_CONFIG_FILE = @PACKAGE_TARNAME@.pc -PKG_DIR="$(DESTDIR)$(libdir)/pkgconfig/" - -edit = $(SED) -e "s|@prefix\@|$(prefix)|" \ - -e 's,@exec_prefix\@,$(exec_prefix),g' \ - -e 's,@libdir\@,$(libdir),g' \ - -e 's,@includedir\@,$(includedir),g' \ - -e 's,@datarootdir\@,$(datarootdir),g' \ - -e 's,@PACKAGE\@,$(PACKAGE),g' \ - -e 's,@PACKAGE_TARNAME\@,$(PACKAGE_TARNAME),g' \ - -e 's,@VERSION\@,$(PACKAGE_VERSION),g' - include $(top_srcdir)/build-aux/pkg-config.mk - # -- Generate documentation .PHONY: doc html doc html: ----------------------------------------------------------------------- Summary of changes: ChangeLog | 5 +++++ Makefile.am | 20 +++++--------------- 2 files changed, 10 insertions(+), 15 deletions(-) hooks/post-receive -- roboptim |
From: Thomas M. <tho...@us...> - 2009-06-16 04:18:39
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "roboptim". The branch, core has been updated via a6c1e8dad3cfd49324f28ca39103bb7a5ea0d738 (commit) from 13fde339a65c8767f7d6ea2cfa9698da80fc662b (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit a6c1e8dad3cfd49324f28ca39103bb7a5ea0d738 Author: Thomas Moulard <tho...@gm...> Date: Tue Jun 16 13:16:23 2009 +0900 Add sections into Problem class. * include/roboptim/core/problem.hh: Here. Signed-off-by: Thomas Moulard <tho...@gm...> diff --git a/ChangeLog b/ChangeLog index ecfc57b..9a9b8d7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-06-16 Thomas Moulard <tho...@gm...> + + Add sections into Problem class. + * include/roboptim/core/problem.hh: Here. + 2009-06-15 Thomas Moulard <tho...@gm...> Fix implementation. diff --git a/include/roboptim/core/problem.hh b/include/roboptim/core/problem.hh index 7c9a7c2..6a23f35 100644 --- a/include/roboptim/core/problem.hh +++ b/include/roboptim/core/problem.hh @@ -154,6 +154,9 @@ namespace roboptim /// \brief Scale vector. typedef std::vector<value_type> scales_t; + /// \name Constructors and destructors. + /// \{ + /// \pre costfunction \f$\mathbb{R}^n \rightarrow \mathbb{R}\f$ explicit Problem (const function_t&) throw (); @@ -166,10 +169,46 @@ namespace roboptim ~Problem () throw (); + /// \} + + + /// \name Cost function. + /// \{ + /// \brief Retrieve cost function. /// \return cost function const function_t& function () const throw (); + /// \brief Retrieve arguments bounds. + /// Arguments bounds define in which interval + /// each argument is valid. + /// \return arguments bounds + intervals_t& argumentBounds () throw (); + + /// \brief Retrieve arguments bounds. + /// Arguments bounds define in which interval + /// each argument is valid. + /// \return arguments bounds + const intervals_t& argumentBounds () const throw (); + + /// \brief Retrieve arguments scales. + /// Arguments scales define which scale is applied for + /// each argument. + /// \return arguments scales + scales_t& argumentScales () throw (); + + /// \brief Retrieve arguments scales. + /// Arguments scales define which scale is applied for + /// each argument. + /// \return arguments scales + const scales_t& argumentScales () const throw (); + + /// \} + + + /// \name Constraints. + /// \{ + /// \brief Retrieve constraints. /// \return constraints const constraints_t& constraints () const throw (); @@ -186,45 +225,30 @@ namespace roboptim value_type scale = 1.) throw (std::runtime_error); - /// \brief Set the initial guess. - /// \return reference on the initial guess - startingPoint_t& startingPoint () throw (); - - /// \brief Get the initial guess. - /// \return reference on the initial guess - const startingPoint_t& startingPoint () const throw (); - /// \brief Retrieve constraints bounds. /// \return constraints bounds const intervals_t& bounds () const throw (); - /// \brief Retrieve arguments bounds. - /// Arguments bounds define in which interval - /// each argument is valid. - /// \return arguments bounds - intervals_t& argumentBounds () throw (); - - /// \brief Retrieve arguments bounds. - /// Arguments bounds define in which interval - /// each argument is valid. - /// \return arguments bounds - const intervals_t& argumentBounds () const throw (); - /// \brief Retrieve constraints scales. /// \return constraints scales const scales_t& scales () const throw (); - /// \brief Retrieve arguments scales. - /// Arguments scales define which scale is applied for - /// each argument. - /// \return arguments scales - scales_t& argumentScales () throw (); + /// \} + + + /// \name Starting point (initial guess). + /// \{ + + /// \brief Set the initial guess. + /// \return reference on the initial guess + startingPoint_t& startingPoint () throw (); + + /// \brief Get the initial guess. + /// \return reference on the initial guess + const startingPoint_t& startingPoint () const throw (); + + /// \} - /// \brief Retrieve arguments scales. - /// Arguments scales define which scale is applied for - /// each argument. - /// \return arguments scales - const scales_t& argumentScales () const throw (); /// \brief Display the problem on the specified output stream. /// ----------------------------------------------------------------------- Summary of changes: ChangeLog | 5 ++ include/roboptim/core/problem.hh | 84 ++++++++++++++++++++++++------------- 2 files changed, 59 insertions(+), 30 deletions(-) hooks/post-receive -- roboptim |
From: Thomas M. <tho...@us...> - 2009-06-16 02:58:01
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "roboptim". The branch, trajectory has been updated via 0838415b946ec1ffc24bf41db39d20c4a7ece4c3 (commit) via e639b0d573bd365ef620b32efec0f20dff5329a1 (commit) from 11e541a0e8924b13c22b62a911ff90dcff9490b6 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 0838415b946ec1ffc24bf41db39d20c4a7ece4c3 Author: Thomas Moulard <tho...@gm...> Date: Tue Jun 16 11:55:40 2009 +0900 Implement Freeze class. * include/Makefile.am: Distribute new headers. * include/roboptim/trajectory/freeze.hh: New. * include/roboptim/trajectory/freeze.hxx: New. * tests/spline-optimization.cc: Use Freeze. * tests/spline-optimization.stdout: Regenerate. Signed-off-by: Thomas Moulard <tho...@gm...> diff --git a/.gitignore b/.gitignore index be9ded2..a0df6f6 100644 --- a/.gitignore +++ b/.gitignore @@ -17,3 +17,4 @@ tests/testsuite +committed/ ,* testsuite.log +*svn-log* diff --git a/ChangeLog b/ChangeLog index fb5ef3a..75b9144 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2009-06-16 Thomas Moulard <tho...@gm...> + + Implement Freeze class. + * include/Makefile.am: Distribute new headers. + * include/roboptim/trajectory/freeze.hh: New. + * include/roboptim/trajectory/freeze.hxx: New. + * tests/spline-optimization.cc: Use Freeze. + * tests/spline-optimization.stdout: Regenerate. + 2009-06-11 Thomas Moulard <tho...@gm...> Fix build-chain when headers are in non-standard directories. diff --git a/include/Makefile.am b/include/Makefile.am index fea87e0..4fd6476 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -4,6 +4,8 @@ include $(top_srcdir)/build-aux/init.mk nobase_include_HEADERS = \ roboptim/trajectory/free-time-trajectory.hh \ roboptim/trajectory/free-time-trajectory.hxx \ + roboptim/trajectory/freeze.hh \ + roboptim/trajectory/freeze.hxx \ roboptim/trajectory/fwd.hh \ roboptim/trajectory/spline.hh \ roboptim/trajectory/spline-length.hh \ diff --git a/include/roboptim/trajectory/freeze.hh b/include/roboptim/trajectory/freeze.hh new file mode 100644 index 0000000..59495c7 --- /dev/null +++ b/include/roboptim/trajectory/freeze.hh @@ -0,0 +1,80 @@ +// Copyright (C) 2009 by Thomas Moulard, AIST, CNRS, INRIA. +// +// This file is part of the roboptim. +// +// roboptim is free software: you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// roboptim is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public License +// along with roboptim. If not, see <http://www.gnu.org/licenses/>. + +#ifndef ROBOPTIM_TRAJECTORY_FREEZE_HH +# define ROBOPTIM_TRAJECTORY_FREEZE_HH +# include <vector> +# include <utility> + +# include <roboptim/core/fwd.hh> +# include <roboptim/core/problem.hh> + +namespace roboptim +{ + /// \brief Add constraints that freezes parmeters. + /// + /// This constraint expects a vector of pairs (argument id, value) to + /// build a function that will freeze the given arguments to their + /// associated value. + /// + /// For instance, the vector: [(0, 5.), (3, -12.)] forces the first + /// parameter to five and the fourth one to minus twelve. + /// + /// This class adds to the problem one linear constraint per + /// frozen parameter. + template <typename F, typename CLIST, typename C> + class Freeze + { + public: + /// \brief Pair representing an argument index and a value. + typedef std::pair<size_t, Function::value_type> frozenArgument_t; + + /// \brief Problem type. + typedef Problem<F, CLIST> problem_t; + + /// \brief Vector of pairs (argument index, value). + /// + /// This type define what are the frozen arguments and what their + /// value. + typedef std::vector<frozenArgument_t> frozenArguments_t; + + /// \brief Create the constraint from a vector of pairs. + /// + /// \param problem problem that will be modified. + /// \param fa Vector of pairs containing what to freeze and to what value. + Freeze (problem_t& problem, const frozenArguments_t fa) throw (); + + virtual ~Freeze () throw (); + + /// \brief Apply modification. + void operator () () throw (); + + private: + /// \brief Reference to the problem that will be modified. + problem_t& problem_; + + /// \brief Vector which defines how to freeze values. + const frozenArguments_t frozenArguments_; + }; + + /// Example shows freeze use. + /// \example spline-optimization.cc + +} // end of namespace roboptim. + +# include <roboptim/trajectory/freeze.hxx> +#endif //! ROBOPTIM_TRAJECTORY_FREEZE_HH diff --git a/include/roboptim/trajectory/freeze.hxx b/include/roboptim/trajectory/freeze.hxx new file mode 100644 index 0000000..1070257 --- /dev/null +++ b/include/roboptim/trajectory/freeze.hxx @@ -0,0 +1,69 @@ +// Copyright (C) 2009 by Thomas Moulard, AIST, CNRS, INRIA. +// +// This file is part of the roboptim. +// +// roboptim is free software: you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// roboptim is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public License +// along with roboptim. If not, see <http://www.gnu.org/licenses/>. + +#ifndef ROBOPTIM_TRAJECTORY_FREEZE_HXX +# define ROBOPTIM_TRAJECTORY_FREEZE_HXX +# include <boost/make_shared.hpp> + +# include <roboptim/core/numeric-linear-function.hh> + +namespace roboptim +{ + template <typename F, typename CLIST, typename C> + Freeze<F, CLIST, C>::Freeze (problem_t& problem, + const frozenArguments_t fa) throw () + : problem_ (problem), + frozenArguments_ (fa) + { + } + + template <typename F, typename CLIST, typename C> + Freeze<F, CLIST, C>::~Freeze () throw () + { + } + + template <typename F, typename CLIST, typename C> + void + Freeze<F, CLIST, C>::operator () () throw () + { + using namespace boost; + typedef frozenArguments_t::const_iterator citer_t; + + for (citer_t it = frozenArguments_.begin (); + it != frozenArguments_.end (); ++it) + { + assert (it->first < problem_.function ().inputSize ()); + + Function::matrix_t a (1, problem_.function ().inputSize ()); + Function::vector_t b (1); + + a.clear (), b.clear (); + + a(0, it->first) = 1.; + + b[0] = -it->second; + + shared_ptr<C> ptr = static_pointer_cast<C> + (make_shared<NumericLinearFunction> (a, b)); + this->problem_.addConstraint (ptr, + Function::makeInterval (0., 0.)); + } + } + +} // end of namespace roboptim. + +#endif //! ROBOPTIM_TRAJECTORY_FREEZE_HXX diff --git a/tests/spline-optimization.cc b/tests/spline-optimization.cc index 6b78877..2e2126e 100644 --- a/tests/spline-optimization.cc +++ b/tests/spline-optimization.cc @@ -16,20 +16,21 @@ // along with roboptim. If not, see <http://www.gnu.org/licenses/>. #include <boost/assign/list_of.hpp> +#include <boost/mpl/vector.hpp> #include <boost/numeric/ublas/io.hpp> #include <roboptim/core/finite-difference-gradient.hh> -#include <roboptim/core/freeze.hh> #include <roboptim/core/solver-factory.hh> #include <roboptim/core/visualization/gnuplot.hh> #include <roboptim/core/visualization/gnuplot-commands.hh> #include <roboptim/core/visualization/gnuplot-function.hh> +#include <roboptim/trajectory/freeze.hh> #include <roboptim/trajectory/fwd.hh> +#include <roboptim/trajectory/spline-length.hh> #include <roboptim/trajectory/spline.hh> #include <roboptim/trajectory/trajectory-cost.hh> -#include <roboptim/trajectory/spline-length.hh> #include "common.hh" @@ -37,8 +38,7 @@ using namespace roboptim; using namespace roboptim::visualization; using namespace roboptim::visualization::gnuplot; -typedef boost::variant<const DerivableFunction*, - const LinearFunction*> constraint_t; +typedef boost::mpl::vector<DerivableFunction, LinearFunction> constraint_t; typedef Solver<DerivableFunction, constraint_t> solver_t; int run_test () @@ -124,32 +124,14 @@ int run_test () solver_t::problem_t problem (cost); problem.startingPoint () = params; - Freeze freeze (params.size (), list_of <Freeze::frozenArgument_t> (0, params[0]) - (1, params[1]) - (params.size () - 2, params[params.size () - 2]) - (params.size () - 1, params[params.size () - 1])); - - // Check constraint gradient. - { - Function::vector_t x (params.size ()); - x.clear (); - if (! checkGradient (freeze, 0, x)) - { - FiniteDifferenceGradient fdfunction (freeze); - DerivableFunction::gradient_t grad = freeze.gradient (x, 0); - DerivableFunction::gradient_t fdgrad = fdfunction.gradient (x, 0); - - std::cerr << freeze (x) << std::endl - << grad << std::endl - << fdgrad << std::endl; - assert (0 && "Bad gradient"); - } - - x = params; - assert (checkGradient (freeze, 0, x)); - } - - problem.addConstraint (&freeze, Function::makeInterval (0., 0.)); + typedef Freeze<DerivableFunction, constraint_t, LinearFunction> freeze_t; + freeze_t freeze (problem, + list_of <freeze_t::frozenArgument_t> + (0, params[0]) + (1, params[1]) + (params.size () - 2, params[params.size () - 2]) + (params.size () - 1, params[params.size () - 1])); + freeze (); SolverFactory<solver_t> factory ("cfsqp", problem); solver_t& solver = factory (); @@ -159,8 +141,6 @@ int run_test () solver_t::result_t res = solver.minimum (); - std::cerr << "Parameters (after): " << params << std::endl; - std::cerr << solver << std::endl; switch (res.which ()) @@ -197,6 +177,7 @@ int run_test () } } + std::cerr << "Parameters (after): " << params << std::endl; // Check cost gradient (final). { diff --git a/tests/spline-optimization.stdout b/tests/spline-optimization.stdout index 0e9bfc0..0dd93d1 100644 --- a/tests/spline-optimization.stdout +++ b/tests/spline-optimization.stdout @@ -424,407 +424,407 @@ plot '-' with line e plot '-' with line -0.5 0.5 -0.500011 0.500011 -0.500085 0.500085 -0.500287 0.500287 -0.500679 0.500679 -0.501327 0.501327 -0.502293 0.502293 -0.503641 0.503641 -0.505435 0.505435 -0.507739 0.507739 -0.510616 0.510616 -0.51413 0.51413 -0.518344 0.518344 -0.523323 0.523323 -0.52913 0.52913 -0.535828 0.535828 -0.543482 0.543482 -0.552155 0.552155 -0.561911 0.561911 -0.572814 0.572814 -0.584926 0.584926 -0.598313 0.598313 -0.613037 0.613037 -0.629163 0.629163 -0.646753 0.646753 -0.665872 0.665872 -0.686583 0.686583 -0.708951 0.708951 -0.733038 0.733038 -0.758909 0.758909 -0.786627 0.786627 -0.816256 0.816256 -0.847859 0.847859 -0.8815 0.8815 -0.917244 0.917244 -0.955153 0.955153 -0.995291 0.995291 -1.03772 1.03772 -1.08251 1.08251 -1.12972 1.12972 -1.17941 1.17941 -1.23165 1.23165 -1.2865 1.2865 -1.34403 1.34403 -1.4043 1.4043 -1.46737 1.46737 -1.5333 1.5333 -1.60217 1.60217 -1.67402 1.67402 -1.74894 1.74894 -1.82698 1.82698 -1.9082 1.9082 -1.99267 1.99267 -2.08045 2.08045 -2.17161 2.17161 -2.26621 2.26621 -2.36431 2.36431 -2.46597 2.46597 -2.57127 2.57127 -2.68026 2.68026 -2.79301 2.79301 -2.90959 2.90959 -3.03004 3.03004 -3.15445 3.15445 -3.28287 3.28287 -3.41537 3.41537 -3.552 3.552 -3.69284 3.69284 -3.83795 3.83795 -3.98739 3.98739 -4.14122 4.14122 -4.29951 4.29951 -4.46233 4.46233 -4.62973 4.62973 -4.80178 4.80178 -4.97854 4.97854 -5.16009 5.16009 -5.34647 5.34647 -5.53775 5.53775 -5.73401 5.73401 -5.93529 5.93529 -6.14166 6.14166 -6.35305 6.35305 -6.56942 6.56942 -6.7907 6.7907 -7.01683 7.01683 -7.24774 7.24774 -7.48339 7.48339 -7.7237 7.7237 -7.96861 7.96861 -8.21807 8.21807 -8.47201 8.47201 -8.73037 8.73037 -8.99309 8.99309 -9.2601 9.2601 -9.53135 9.53135 -9.80678 9.80678 -10.0863 10.0863 -10.3699 10.3699 -10.6575 10.6575 -10.949 10.949 -11.2444 11.2444 -11.5435 11.5435 -11.8465 11.8465 -12.1531 12.1531 -12.4633 12.4633 -12.7771 12.7771 -13.0944 13.0944 -13.4151 13.4151 -13.7392 13.7392 -14.0666 14.0666 -14.3973 14.3973 -14.7312 14.7312 -15.0681 15.0681 -15.4082 15.4082 -15.7513 15.7513 -16.0973 16.0973 -16.4462 16.4462 -16.7979 16.7979 -17.1524 17.1524 -17.5096 17.5096 -17.8694 17.8694 -18.2318 18.2318 -18.5967 18.5967 -18.9641 18.9641 -19.3338 19.3338 -19.7059 19.7059 -20.0803 20.0803 -20.4568 20.4568 -20.8356 20.8356 -21.2164 21.2164 -21.5992 21.5992 -21.984 21.984 -22.3707 22.3707 -22.7592 22.7592 -23.1495 23.1495 -23.5416 23.5416 -23.9353 23.9353 -24.3305 24.3305 -24.7274 24.7274 -25.1256 25.1256 -25.5253 25.5253 -25.9264 25.9264 -26.3287 26.3287 -26.7323 26.7323 -27.137 27.137 -27.5428 27.5428 -27.9497 27.9497 -28.3576 28.3576 -28.7663 28.7663 -29.176 29.176 -29.5864 29.5864 -29.9975 29.9975 -30.4094 30.4094 -30.8218 30.8218 -31.2348 31.2348 -31.6483 31.6483 -32.0622 32.0622 -32.4765 32.4765 -32.8911 32.8911 -33.3059 33.3059 -33.7209 33.7209 -34.1361 34.1361 -34.5515 34.5515 -34.967 34.967 -35.3827 35.3827 -35.7986 35.7986 -36.2146 36.2146 -36.6307 36.6307 -37.047 37.047 -37.4635 37.4635 -37.8801 37.8801 -38.2968 38.2968 -38.7136 38.7136 -39.1306 39.1306 -39.5477 39.5477 -39.9649 39.9649 -40.3822 40.3822 -40.7996 40.7996 -41.2171 41.2171 -41.6347 41.6347 -42.0524 42.0524 -42.4702 42.4702 -42.8881 42.8881 -43.306 43.306 -43.7241 43.7241 -44.1422 44.1422 -44.5603 44.5603 -44.9785 44.9785 -45.3968 45.3968 -45.8151 45.8151 -46.2335 46.2335 -46.6519 46.6519 -47.0703 47.0703 -47.4888 47.4888 -47.9073 47.9073 -48.3258 48.3258 -48.7443 48.7443 -49.1629 49.1629 -49.5814 49.5814 +-1.90088e-15 -1.90088e-15 +1.0723e-05 1.0723e-05 +8.57843e-05 8.57843e-05 +0.000289522 0.000289522 +0.000686275 0.000686275 +0.00134038 0.00134038 +0.00231618 0.00231618 +0.003678 0.003678 +0.0054902 0.0054902 +0.0078171 0.0078171 +0.010723 0.010723 +0.0142724 0.0142724 +0.0185294 0.0185294 +0.0235585 0.0235585 +0.029424 0.029424 +0.0361903 0.0361903 +0.0439216 0.0439216 +0.0526823 0.0526823 +0.0625368 0.0625368 +0.0735493 0.0735493 +0.0857843 0.0857843 +0.0993061 0.0993061 +0.114179 0.114179 +0.130467 0.130467 +0.148235 0.148235 +0.167547 0.167547 +0.188468 0.188468 +0.211062 0.211062 +0.235392 0.235392 +0.261524 0.261524 +0.289522 0.289522 +0.31945 0.31945 +0.351373 0.351373 +0.385354 0.385354 +0.421458 0.421458 +0.45975 0.45975 +0.500294 0.500294 +0.543154 0.543154 +0.588395 0.588395 +0.63608 0.63608 +0.686275 0.686275 +0.739043 0.739043 +0.794449 0.794449 +0.852557 0.852557 +0.913431 0.913431 +0.977137 0.977137 +1.04374 1.04374 +1.1133 1.1133 +1.18588 1.18588 +1.26155 1.26155 +1.34038 1.34038 +1.42242 1.42242 +1.50775 1.50775 +1.59641 1.59641 +1.68849 1.68849 +1.78405 1.78405 +1.88314 1.88314 +1.98583 1.98583 +2.09219 2.09219 +2.20229 2.20229 +2.31618 2.31618 +2.43393 2.43393 +2.5556 2.5556 +2.68126 2.68126 +2.81098 2.81098 +2.94481 2.94481 +3.08283 3.08283 +3.22509 3.22509 +3.37167 3.37167 +3.52261 3.52261 +3.678 3.678 +3.83789 3.83789 +4.00235 4.00235 +4.17144 4.17144 +4.34523 4.34523 +4.52378 4.52378 +4.70716 4.70716 +4.89542 4.89542 +5.08864 5.08864 +5.28688 5.28688 +5.4902 5.4902 +5.69864 5.69864 +5.91217 5.91217 +6.13073 6.13073 +6.35424 6.35424 +6.58265 6.58265 +6.8159 6.8159 +7.05393 7.05393 +7.29667 7.29667 +7.54406 7.54406 +7.79603 7.79603 +8.05254 8.05254 +8.3135 8.3135 +8.57888 8.57888 +8.84859 8.84859 +9.12258 9.12258 +9.40078 9.40078 +9.68315 9.68315 +9.9696 9.9696 +10.2601 10.2601 +10.5545 10.5545 +10.8529 10.8529 +11.1551 11.1551 +11.4611 11.4611 +11.7708 11.7708 +12.0841 12.0841 +12.4011 12.4011 +12.7216 12.7216 +13.0456 13.0456 +13.3729 13.3729 +13.7037 13.7037 +14.0377 14.0377 +14.3749 14.3749 +14.7153 14.7153 +15.0588 15.0588 +15.4053 15.4053 +15.7548 15.7548 +16.1072 16.1072 +16.4625 16.4625 +16.8206 16.8206 +17.1814 17.1814 +17.5448 17.5448 +17.9109 17.9109 +18.2795 18.2795 +18.6506 18.6506 +19.0241 19.0241 +19.3999 19.3999 +19.7781 19.7781 +20.1584 20.1584 +20.541 20.541 +20.9256 20.9256 +21.3123 21.3123 +21.701 21.701 +22.0916 22.0916 +22.4841 22.4841 +22.8783 22.8783 +23.2743 23.2743 +23.672 23.672 +24.0713 24.0713 +24.4721 24.4721 +24.8744 24.8744 +25.2781 25.2781 +25.6832 25.6832 +26.0896 26.0896 +26.4973 26.4973 +26.9061 26.9061 +27.316 27.316 +27.727 27.727 +28.1389 28.1389 +28.5518 28.5518 +28.9656 28.9656 +29.3802 29.3802 +29.7955 29.7955 +30.2115 30.2115 +30.6281 30.6281 +31.0453 31.0453 +31.4629 31.4629 +31.881 31.881 +32.2995 32.2995 +32.7182 32.7182 +33.1373 33.1373 +33.5565 33.5565 +33.9759 33.9759 +34.3954 34.3954 +34.8151 34.8151 +35.235 35.235 +35.6551 35.6551 +36.0753 36.0753 +36.4957 36.4957 +36.9162 36.9162 +37.3369 37.3369 +37.7577 37.7577 +38.1786 38.1786 +38.5996 38.5996 +39.0208 39.0208 +39.4421 39.4421 +39.8635 39.8635 +40.2851 40.2851 +40.7067 40.7067 +41.1284 41.1284 +41.5502 41.5502 +41.9722 41.9722 +42.3942 42.3942 +42.8163 42.8163 +43.2384 43.2384 +43.6607 43.6607 +44.083 44.083 +44.5054 44.5054 +44.9278 44.9278 +45.3503 45.3503 +45.7728 45.7728 +46.1954 46.1954 +46.618 46.618 +47.0407 47.0407 +47.4634 47.4634 +47.8861 47.8861 +48.3089 48.3089 +48.7316 48.7316 +49.1544 49.1544 +49.5772 49.5772 50 50 -50.4186 50.4186 -50.8371 50.8371 -51.2557 51.2557 -51.6742 51.6742 -52.0927 52.0927 -52.5112 52.5112 -52.9297 52.9297 -53.3481 53.3481 -53.7665 53.7665 -54.1849 54.1849 -54.6032 54.6032 -55.0215 55.0215 -55.4397 55.4397 -55.8578 55.8578 -56.2759 56.2759 -56.694 56.694 -57.1119 57.1119 -57.5298 57.5298 -57.9476 57.9476 -58.3653 58.3653 -58.7829 58.7829 -59.2004 59.2004 -59.6178 59.6178 -60.0351 60.0351 -60.4523 60.4523 -60.8694 60.8694 -61.2864 61.2864 -61.7032 61.7032 -62.1199 62.1199 -62.5365 62.5365 -62.953 62.953 -63.3693 63.3693 -63.7854 63.7854 -64.2014 64.2014 -64.6173 64.6173 -65.033 65.033 -65.4485 65.4485 -65.8639 65.8639 -66.2791 66.2791 -66.6941 66.6941 -67.1089 67.1089 -67.5235 67.5235 -67.9378 67.9378 -68.3517 68.3517 -68.7652 68.7652 -69.1782 69.1782 -69.5906 69.5906 -70.0025 70.0025 -70.4136 70.4136 -70.824 70.824 -71.2337 71.2337 -71.6424 71.6424 -72.0503 72.0503 -72.4572 72.4572 -72.863 72.863 -73.2677 73.2677 -73.6713 73.6713 -74.0736 74.0736 -74.4747 74.4747 -74.8744 74.8744 -75.2726 75.2726 -75.6695 75.6695 -76.0647 76.0647 -76.4584 76.4584 -76.8505 76.8505 -77.2408 77.2408 -77.6293 77.6293 -78.016 78.016 -78.4008 78.4008 -78.7836 78.7836 -79.1644 79.1644 -79.5432 79.5432 -79.9197 79.9197 -80.2941 80.2941 -80.6662 80.6662 -81.0359 81.0359 -81.4033 81.4033 -81.7682 81.7682 -82.1306 82.1306 -82.4904 82.4904 -82.8476 82.8476 -83.2021 83.2021 -83.5538 83.5538 -83.9027 83.9027 -84.2487 84.2487 -84.5918 84.5918 -84.9319 84.9319 -85.2688 85.2688 -85.6027 85.6027 -85.9334 85.9334 -86.2608 86.2608 -86.5849 86.5849 -86.9056 86.9056 -87.2229 87.2229 -87.5367 87.5367 -87.8469 87.8469 -88.1535 88.1535 -88.4565 88.4565 -88.7556 88.7556 -89.051 89.051 -89.3425 89.3425 -89.6301 89.6301 -89.9137 89.9137 -90.1932 90.1932 -90.4686 90.4686 -90.7399 90.7399 -91.0069 91.0069 -91.2696 91.2696 -91.528 91.528 -91.7819 91.7819 -92.0314 92.0314 -92.2763 92.2763 -92.5166 92.5166 -92.7523 92.7523 -92.9832 92.9832 -93.2093 93.2093 -93.4306 93.4306 -93.6469 93.6469 -93.8583 93.8583 -94.0647 94.0647 -94.266 94.266 -94.4622 94.4622 -94.6535 94.6535 -94.8399 94.8399 -95.0215 95.0215 -95.1982 95.1982 -95.3703 95.3703 -95.5377 95.5377 -95.7005 95.7005 -95.8588 95.8588 -96.0126 96.0126 -96.162 96.1621 -96.3072 96.3072 -96.448 96.448 -96.5846 96.5846 -96.7171 96.7171 -96.8455 96.8455 -96.97 96.97 -97.0904 97.0904 -97.207 97.207 -97.3197 97.3197 -97.4287 97.4287 -97.534 97.534 -97.6357 97.6357 -97.7338 97.7338 -97.8284 97.8284 -97.9196 97.9196 -98.0073 98.0073 -98.0918 98.0918 -98.173 98.173 -98.2511 98.2511 -98.326 98.326 -98.3978 98.3978 -98.4667 98.4667 -98.5326 98.5326 -98.5957 98.5957 -98.656 98.656 -98.7135 98.7135 -98.7683 98.7683 -98.8206 98.8206 -98.8703 98.8703 -98.9175 98.9175 -98.9623 98.9623 -99.0047 99.0047 -99.0448 99.0448 -99.0828 99.0828 -99.1185 99.1185 -99.1521 99.1521 -99.1837 99.1837 -99.2134 99.2134 -99.2411 99.2411 -99.267 99.267 -99.291 99.291 -99.3134 99.3134 -99.3341 99.3341 -99.3532 99.3532 -99.3708 99.3708 -99.387 99.387 -99.4017 99.4017 -99.4151 99.4151 -99.4272 99.4272 -99.4381 99.4381 -99.4478 99.4478 -99.4565 99.4565 -99.4642 99.4642 -99.4709 99.4709 -99.4767 99.4767 -99.4817 99.4817 -99.4859 99.4859 -99.4894 99.4894 -99.4923 99.4923 -99.4946 99.4946 -99.4964 99.4964 -99.4977 99.4977 -99.4987 99.4987 -99.4993 99.4993 +50.4228 50.4228 +50.8456 50.8456 +51.2684 51.2684 +51.6911 51.6911 +52.1139 52.1139 +52.5366 52.5366 +52.9593 52.9593 +53.382 53.382 +53.8046 53.8046 +54.2272 54.2272 +54.6497 54.6497 +55.0722 55.0722 +55.4946 55.4946 +55.917 55.917 +56.3393 56.3393 +56.7616 56.7616 +57.1837 57.1837 +57.6058 57.6058 +58.0278 58.0278 +58.4498 58.4498 +58.8716 58.8716 +59.2933 59.2933 +59.7149 59.7149 +60.1365 60.1365 +60.5579 60.5579 +60.9792 60.9792 +61.4004 61.4004 +61.8214 61.8214 +62.2423 62.2423 +62.6631 62.6631 +63.0838 63.0838 +63.5043 63.5043 +63.9247 63.9247 +64.3449 64.3449 +64.765 64.765 +65.1849 65.1849 +65.6046 65.6046 +66.0241 66.0241 +66.4435 66.4435 +66.8627 66.8627 +67.2818 67.2818 +67.7005 67.7005 +68.119 68.119 +68.5371 68.5371 +68.9547 68.9547 +69.3719 69.3719 +69.7885 69.7885 +70.2045 70.2045 +70.6198 70.6198 +71.0344 71.0344 +71.4482 71.4482 +71.8611 71.8611 +72.273 72.273 +72.684 72.684 +73.0939 73.0939 +73.5027 73.5027 +73.9104 73.9104 +74.3168 74.3168 +74.7219 74.7219 +75.1256 75.1256 +75.5279 75.5279 +75.9287 75.9287 +76.328 76.328 +76.7257 76.7257 +77.1217 77.1217 +77.5159 77.5159 +77.9084 77.9084 +78.299 78.299 +78.6877 78.6877 +79.0744 79.0744 +79.459 79.459 +79.8416 79.8416 +80.2219 80.2219 +80.6001 80.6001 +80.9759 80.9759 +81.3494 81.3494 +81.7205 81.7205 +82.0891 82.0891 +82.4552 82.4552 +82.8186 82.8186 +83.1794 83.1794 +83.5375 83.5375 +83.8928 83.8928 +84.2452 84.2452 +84.5947 84.5947 +84.9412 84.9412 +85.2847 85.2847 +85.6251 85.6251 +85.9623 85.9623 +86.2963 86.2963 +86.6271 86.6271 +86.9544 86.9544 +87.2784 87.2784 +87.5989 87.5989 +87.9159 87.9159 +88.2292 88.2292 +88.5389 88.5389 +88.8449 88.8449 +89.1471 89.1471 +89.4455 89.4455 +89.7399 89.7399 +90.0304 90.0304 +90.3169 90.3169 +90.5992 90.5992 +90.8774 90.8774 +91.1514 91.1514 +91.4211 91.4211 +91.6865 91.6865 +91.9475 91.9475 +92.204 92.204 +92.4559 92.4559 +92.7033 92.7033 +92.9461 92.9461 +93.1841 93.1841 +93.4173 93.4173 +93.6458 93.6458 +93.8693 93.8693 +94.0878 94.0878 +94.3014 94.3014 +94.5098 94.5098 +94.7131 94.7131 +94.9114 94.9114 +95.1046 95.1046 +95.2928 95.2928 +95.4762 95.4762 +95.6548 95.6548 +95.8286 95.8286 +95.9976 95.9976 +96.1621 96.1621 +96.322 96.322 +96.4774 96.4774 +96.6283 96.6283 +96.7749 96.7749 +96.9172 96.9172 +97.0552 97.0552 +97.189 97.189 +97.3187 97.3187 +97.4444 97.4444 +97.5661 97.5661 +97.6838 97.6838 +97.7977 97.7977 +97.9078 97.9078 +98.0142 98.0142 +98.1169 98.1169 +98.216 98.216 +98.3115 98.3115 +98.4036 98.4036 +98.4923 98.4923 +98.5776 98.5776 +98.6596 98.6596 +98.7384 98.7384 +98.8141 98.8141 +98.8867 98.8867 +98.9563 98.9563 +99.0229 99.0229 +99.0866 99.0866 +99.1474 99.1474 +99.2056 99.2056 +99.261 99.261 +99.3137 99.3137 +99.3639 99.3639 +99.4116 99.4116 +99.4568 99.4568 99.4997 99.4997 -99.4999 99.4999 -99.5 99.5 -99.5 99.5 +99.5402 99.5402 +99.5785 99.5785 +99.6146 99.6146 +99.6486 99.6486 +99.6805 99.6805 +99.7105 99.7105 +99.7385 99.7385 +99.7646 99.7646 +99.7889 99.7889 +99.8115 99.8115 +99.8325 99.8325 +99.8518 99.8518 +99.8695 99.8695 +99.8858 99.8858 +99.9007 99.9007 +99.9142 99.9142 +99.9265 99.9265 +99.9375 99.9375 +99.9473 99.9473 +99.9561 99.9561 +99.9638 99.9638 +99.9706 99.9706 +99.9764 99.9764 +99.9815 99.9815 +99.9857 99.9857 +99.9893 99.9893 +99.9922 99.9922 +99.9945 99.9945 +99.9963 99.9963 +99.9977 99.9977 +99.9987 99.9987 +99.9993 99.9993 +99.9997 99.9997 +99.9999 99.9999 +100 100 +100 100 e unset multiplot commit e639b0d573bd365ef620b32efec0f20dff5329a1 Author: Thomas Moulard <tho...@gm...> Date: Thu Jun 11 16:42:39 2009 +0900 Fix build-chain when headers are in non-standard directories. * src/Makefile.am, * tests/Makefile.am: Add ROBOPTIMCORE_CFLAGS to CPPFLAGS. Signed-off-by: Thomas Moulard <tho...@gm...> diff --git a/ChangeLog b/ChangeLog index 91f8d73..fb5ef3a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2009-06-11 Thomas Moulard <tho...@gm...> + + Fix build-chain when headers are in non-standard directories. + * src/Makefile.am, + * tests/Makefile.am: Add ROBOPTIMCORE_CFLAGS to CPPFLAGS. + 2009-06-10 Thomas Moulard <tho...@gm...> Synchronize. diff --git a/src/Makefile.am b/src/Makefile.am index 852c842..ace08b3 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,5 +1,8 @@ include $(top_srcdir)/build-aux/init.mk +# Add RobOptim flags. +AM_CPPFLAGS += $(ROBOPTIMCORE_CFLAGS) + # Add available warnings flags. AM_CXXFLAGS += $(WARNING_CXXFLAGS) diff --git a/tests/Makefile.am b/tests/Makefile.am index eab59b2..33dee61 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -1,6 +1,9 @@ include $(top_srcdir)/build-aux/init.mk include $(top_srcdir)/build-aux/autotest.mk +# Add RobOptim flags. +AM_CPPFLAGS += $(ROBOPTIMCORE_CFLAGS) + # Add available warnings flags. AM_CXXFLAGS += $(WARNING_CXXFLAGS) ----------------------------------------------------------------------- Summary of changes: .gitignore | 1 + ChangeLog | 15 + include/Makefile.am | 2 + include/roboptim/trajectory/freeze.hh | 80 ++++ include/roboptim/trajectory/freeze.hxx | 69 +++ src/Makefile.am | 3 + tests/Makefile.am | 3 + tests/spline-optimization.cc | 45 +-- tests/spline-optimization.stdout | 798 ++++++++++++++++---------------- 9 files changed, 585 insertions(+), 431 deletions(-) create mode 100644 include/roboptim/trajectory/freeze.hh create mode 100644 include/roboptim/trajectory/freeze.hxx hooks/post-receive -- roboptim |
From: Thomas M. <tho...@us...> - 2009-06-15 14:02:26
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "roboptim". The branch, core-ipopt-plugin has been updated via 469c4a6d874ab37a2f21719ec73745bc6cc491a0 (commit) from 1ced04750d544c68df03fe8fbe4c63a05c988ea8 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 469c4a6d874ab37a2f21719ec73745bc6cc491a0 Author: Thomas Moulard <tho...@gm...> Date: Mon Jun 15 23:00:05 2009 +0900 Regenerate reference. Display has been updated in roboptim-core. * tests/plugin.stdout, * tests/simple.stdout: Regenerate. Signed-off-by: Thomas Moulard <tho...@gm...> diff --git a/ChangeLog b/ChangeLog index d8c42f8..215e8a6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,12 @@ 2009-06-15 Thomas Moulard <tho...@gm...> + Regenerate reference. + Display has been updated in roboptim-core. + * tests/plugin.stdout, + * tests/simple.stdout: Regenerate. + +2009-06-15 Thomas Moulard <tho...@gm...> + Generalize constraints. * include/roboptim/core/plugin/ipopt.hh, * src/roboptim-core-ipopt-plugin.cc, diff --git a/tests/plugin.stdout b/tests/plugin.stdout index 6c67f62..338908c 100644 --- a/tests/plugin.stdout +++ b/tests/plugin.stdout @@ -6,10 +6,12 @@ Problem: Constraint 0 Bounds: (25, inf) Scales: 1 + Initial value: [1](25) Constraint 1 Bounds: (40, 40) Scales: 1 + Initial value: [1](52) Starting point: [4](1,5,5,1) Starting value: [1](12) diff --git a/tests/simple.stdout b/tests/simple.stdout index 6c67f62..338908c 100644 --- a/tests/simple.stdout +++ b/tests/simple.stdout @@ -6,10 +6,12 @@ Problem: Constraint 0 Bounds: (25, inf) Scales: 1 + Initial value: [1](25) Constraint 1 Bounds: (40, 40) Scales: 1 + Initial value: [1](52) Starting point: [4](1,5,5,1) Starting value: [1](12) ----------------------------------------------------------------------- Summary of changes: ChangeLog | 7 +++++++ tests/plugin.stdout | 2 ++ tests/simple.stdout | 2 ++ 3 files changed, 11 insertions(+), 0 deletions(-) hooks/post-receive -- roboptim |
From: Thomas M. <tho...@us...> - 2009-06-15 13:05:03
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "roboptim". The branch, core has been updated via 626ce050fbfc84f0f9b81c7213baf2d9c2a80dd1 (commit) from 3e7e3a16a20c3cb3fe6d53e3593763c460c29e43 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 626ce050fbfc84f0f9b81c7213baf2d9c2a80dd1 Author: Thomas Moulard <tho...@gm...> Date: Mon Jun 15 22:02:45 2009 +0900 Display initial constraints values. * include/roboptim/core/problem.hxx: Display constraints initial values. * src/result.cc: Restyle. * tests/simple.stdout: Regenerate. Signed-off-by: Thomas Moulard <tho...@gm...> diff --git a/ChangeLog b/ChangeLog index 5b8dfcb..33e030d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,12 @@ 2009-06-15 Thomas Moulard <tho...@gm...> + Display initial constraints values. + * include/roboptim/core/problem.hxx: Display constraints initial values. + * src/result.cc: Restyle. + * tests/simple.stdout: Regenerate. + +2009-06-15 Thomas Moulard <tho...@gm...> + Update forward declarations. * include/roboptim/core/fwd.hh: Add ConstantFunction. diff --git a/include/roboptim/core/problem.hxx b/include/roboptim/core/problem.hxx index ec1c2db..5dc1552 100644 --- a/include/roboptim/core/problem.hxx +++ b/include/roboptim/core/problem.hxx @@ -18,6 +18,7 @@ #ifndef ROBOPTIM_CORE_PROBLEM_HXX # define ROBOPTIM_CORE_PROBLEM_HXX # include <algorithm> +# include <boost/mpl/at.hpp> # include <boost/numeric/ublas/io.hpp> # include <boost/type_traits/is_pointer.hpp> # include <boost/type_traits/remove_pointer.hpp> @@ -199,6 +200,8 @@ namespace roboptim std::ostream& Problem<F, CLIST>::print (std::ostream& o) const throw () { + using namespace boost; + o << "Problem:" << incendl; // Function. o << function () << iendl; @@ -223,8 +226,15 @@ namespace roboptim o << iendl << incindent << "Constraint " << i << incindent << iendl << "Bounds: " << bounds ()[i] << iendl - << "Scales: " << scales ()[i] << iendl - << decindent << decindent; + << "Scales: " << scales ()[i] << iendl; + + if (startingPoint_) + { + shared_ptr<Function> g = get<shared_ptr<Function> > (*it); + o << "Initial value: " << (*g) (*startingPoint_) << incindent << iendl; + } + + o << decindent << decindent; } // Starting point. @@ -238,11 +248,6 @@ namespace roboptim // Infinity. o << iendl << "Infinity value (for all functions): " << Function::infinity (); - - // Arguments' bounds. - // Arguments' scales. - - return o << decindent; } diff --git a/src/result.cc b/src/result.cc index 9b9f0a8..5d46a3a 100644 --- a/src/result.cc +++ b/src/result.cc @@ -51,9 +51,9 @@ namespace roboptim << "Size (input, output): " << inputSize << ", " << outputSize << iendl << "X: " << x << iendl << "Value: " << value << iendl - << "Lambda: " << lambda - << decindent; - return o; + << "Lambda: " << lambda; + + return o << decindent; } std::ostream& operator<< (std::ostream& o, const Result& r) diff --git a/tests/simple.stdout b/tests/simple.stdout index 6c4a896..143ace0 100644 --- a/tests/simple.stdout +++ b/tests/simple.stdout @@ -6,21 +6,23 @@ Problem: Constraint 0 Bounds: (0, 5) Scales: 3.5 - - Starting point: [4](0,0,0,0) - Starting value: [1](0) - Infinity value (for all functions): inf + Initial value: [1](0) + + Starting point: [4](0,0,0,0) + Starting value: [1](0) + Infinity value (for all functions): inf --- Problem: - Function - Argument's bounds: (-inf, inf), (-inf, inf), (-inf, inf), (-inf, inf) - Argument's scales: 1, 1, 1, 1 - Number of constraints: 1 - Constraint 0 - Bounds: (0, 5) - Scales: 3.5 - - Starting point: [4](0,0,0,0) - Starting value: [1](0) - Infinity value (for all functions): inf + Function + Argument's bounds: (-inf, inf), (-inf, inf), (-inf, inf), (-inf, inf) + Argument's scales: 1, 1, 1, 1 + Number of constraints: 1 + Constraint 0 + Bounds: (0, 5) + Scales: 3.5 + Initial value: [1](0) + + Starting point: [4](0,0,0,0) + Starting value: [1](0) + Infinity value (for all functions): inf The dummy solver always fail. ----------------------------------------------------------------------- Summary of changes: ChangeLog | 7 +++++++ include/roboptim/core/problem.hxx | 19 ++++++++++++------- src/result.cc | 6 +++--- tests/simple.stdout | 32 +++++++++++++++++--------------- 4 files changed, 39 insertions(+), 25 deletions(-) hooks/post-receive -- roboptim |
From: Thomas M. <tho...@us...> - 2009-06-15 08:07:30
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "roboptim". The branch, core has been updated via 3e7e3a16a20c3cb3fe6d53e3593763c460c29e43 (commit) from a5d23a3f6d90fce0f5b8214fd65845a43767a43d (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 3e7e3a16a20c3cb3fe6d53e3593763c460c29e43 Author: Thomas Moulard <tho...@gm...> Date: Mon Jun 15 17:05:13 2009 +0900 Update forward declarations. * include/roboptim/core/fwd.hh: Add ConstantFunction. Signed-off-by: Thomas Moulard <tho...@gm...> diff --git a/ChangeLog b/ChangeLog index e0d44ca..5b8dfcb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2009-06-15 Thomas Moulard <tho...@gm...> + Update forward declarations. + * include/roboptim/core/fwd.hh: Add ConstantFunction. + +2009-06-15 Thomas Moulard <tho...@gm...> + Generalize addConstraint. * include/roboptim/core/problem.hh, * include/roboptim/core/problem.hxx: diff --git a/include/roboptim/core/fwd.hh b/include/roboptim/core/fwd.hh index acd6e32..ad0f0e0 100644 --- a/include/roboptim/core/fwd.hh +++ b/include/roboptim/core/fwd.hh @@ -28,11 +28,10 @@ namespace roboptim /// the problem. class NoSolution {}; - + class ConstantFunction; class DerivableFunction; class DummySolver; class FiniteDifferenceGradient; - class Freeze; class Function; class GenericSolver; class LinearFunction; ----------------------------------------------------------------------- Summary of changes: ChangeLog | 5 +++++ include/roboptim/core/fwd.hh | 3 +-- 2 files changed, 6 insertions(+), 2 deletions(-) hooks/post-receive -- roboptim |
From: Thomas M. <tho...@us...> - 2009-06-15 07:10:41
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "roboptim". The branch, core-ipopt-plugin has been updated via 1ced04750d544c68df03fe8fbe4c63a05c988ea8 (commit) from b69e1fbf48dbbf24421060ff964d7a5f198e4f15 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 1ced04750d544c68df03fe8fbe4c63a05c988ea8 Author: Thomas Moulard <tho...@gm...> Date: Mon Jun 15 16:08:09 2009 +0900 Generalize constraints. * include/roboptim/core/plugin/ipopt.hh, * src/roboptim-core-ipopt-plugin.cc, * tests/hs071.hh, * tests/plugin.cc, * tests/simple.cc: Update to new generalized constraint system. Signed-off-by: Thomas Moulard <tho...@gm...> diff --git a/ChangeLog b/ChangeLog index 21e334f..d8c42f8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2009-06-15 Thomas Moulard <tho...@gm...> + + Generalize constraints. + * include/roboptim/core/plugin/ipopt.hh, + * src/roboptim-core-ipopt-plugin.cc, + * tests/hs071.hh, + * tests/plugin.cc, + * tests/simple.cc: + Update to new generalized constraint system. + 2009-06-11 Thomas Moulard <tho...@gm...> Fix build-chain when headers are in non-standard directories. diff --git a/include/roboptim/core/plugin/ipopt.hh b/include/roboptim/core/plugin/ipopt.hh index d93efc8..5e85c49 100644 --- a/include/roboptim/core/plugin/ipopt.hh +++ b/include/roboptim/core/plugin/ipopt.hh @@ -17,6 +17,7 @@ #ifndef ROBOPTIM_CORE_IPOPT_HH # define ROBOPTIM_CORE_IPOPT_HH +# include <boost/mpl/vector.hpp> # include <coin/IpSmartPtr.hpp> # include <roboptim/core/solver.hh> # include <roboptim/core/twice-derivable-function.hh> @@ -47,14 +48,14 @@ namespace roboptim /// \warning Ipopt needs twice derivable functions, so be sure /// to provide hessians in your function's problems. class IpoptSolver : public Solver<TwiceDerivableFunction, - const TwiceDerivableFunction*> + boost::mpl::vector<TwiceDerivableFunction> > { public: friend class detail::MyTNLP; /// \brief Parent type. - typedef Solver<TwiceDerivableFunction, const TwiceDerivableFunction*> - parent_t; + typedef Solver<TwiceDerivableFunction, + boost::mpl::vector<TwiceDerivableFunction> > parent_t; /// \brief Instantiate the solver from a problem. /// diff --git a/src/roboptim-core-ipopt-plugin.cc b/src/roboptim-core-ipopt-plugin.cc index 7169894..07bf63d 100644 --- a/src/roboptim-core-ipopt-plugin.cc +++ b/src/roboptim-core-ipopt-plugin.cc @@ -35,6 +35,12 @@ namespace roboptim TNLP::LinearityType cfsqp_tag (const LinearFunction& f); TNLP::LinearityType cfsqp_tag (const Function& f); + void + jacobianFromGradients + (DerivableFunction::matrix_t& jac, + const IpoptSolver::problem_t::constraints_t& c, + const TwiceDerivableFunction::vector_t& x); + /// \internal /// Set "linear" tag to linear functions. TNLP::LinearityType cfsqp_tag (const LinearFunction& f) @@ -50,6 +56,28 @@ namespace roboptim } /// \internal + /// Concatenate jacobians. + void + jacobianFromGradients + (DerivableFunction::matrix_t& jac, + const IpoptSolver::problem_t::constraints_t& c, + const TwiceDerivableFunction::vector_t& x) + { + using namespace boost; + for (unsigned i = 0; i < jac.size1 (); ++i) + { + shared_ptr<TwiceDerivableFunction> g = + get<shared_ptr<TwiceDerivableFunction> > (c[i]); + DerivableFunction::jacobian_t grad = g->jacobian (x); + + for (unsigned j = 0; j < jac.size2 (); ++j) + jac (i, j) = grad(0, j); + } + } + + + + /// \internal /// Ipopt non linear problem definition. struct MyTNLP : public TNLP { @@ -122,10 +150,16 @@ namespace roboptim virtual bool get_function_linearity (Index m, LinearityType* const_types) throw () { + using namespace boost; assert (solver_.problem ().constraints ().size () - m == 0); for (Index i = 0; i < m; ++i) - const_types[i] = cfsqp_tag (*solver_.problem ().constraints ()[i]); + { + shared_ptr<TwiceDerivableFunction> f = + get<shared_ptr<TwiceDerivableFunction> > + (solver_.problem ().constraints ()[i]); + const_types[i] = cfsqp_tag (*f); + } return true; } @@ -211,6 +245,7 @@ namespace roboptim Index m, Number* g) throw () { + using namespace boost; assert (solver_.problem ().function ().inputSize () - n == 0); assert (solver_.problem ().constraints ().size () - m == 0); @@ -223,7 +258,11 @@ namespace roboptim int i = 0; for (citer_t it = solver_.problem ().constraints ().begin (); it != solver_.problem ().constraints ().end (); ++it, ++i) - g_[i] = (**it) (x_)[0]; + { + shared_ptr<TwiceDerivableFunction> g = + get<shared_ptr<TwiceDerivableFunction> > (*it); + g_[i] = (*g) (x_)[0]; + } vector_to_array(g, g_); return true; } @@ -234,6 +273,7 @@ namespace roboptim Index *jCol, Number* values) throw () { + using namespace boost; assert (solver_.problem ().function ().inputSize () - n == 0); assert (solver_.problem ().constraints ().size () - m == 0); @@ -255,13 +295,11 @@ namespace roboptim Function::matrix_t jac (solver_.problem ().constraints ().size (), solver_.problem ().function ().inputSize ()); - jacobian_from_gradients<TwiceDerivableFunction> - (jac, solver_.problem ().constraints (), x_); - + jacobianFromGradients (jac, solver_.problem ().constraints (), x_); int idx = 0; for (int i = 0; i < m; ++i) - for (int j = 0; j < n; ++j) - values[idx++] = jac (i, j); + for (int j = 0; j < n; ++j) + values[idx++] = jac (i, j); } return true; @@ -283,7 +321,11 @@ namespace roboptim int i = 0; for (citer_t it = solver_.problem ().constraints ().begin (); it != solver_.problem ().constraints ().end (); ++it) - h += lambda[i++] * (*it)->hessian (x, 0); + { + shared_ptr<TwiceDerivableFunction> g = + get<shared_ptr<TwiceDerivableFunction> > (*it); + h += lambda[i++] * g->hessian (x, 0); + } } virtual bool diff --git a/tests/hs071.hh b/tests/hs071.hh index 0066d1c..aa3e421 100644 --- a/tests/hs071.hh +++ b/tests/hs071.hh @@ -19,6 +19,7 @@ #ifndef OPTIMIZATION_TESTS_HS071_HH # define OPTIMIZATION_TESTS_HS071_HH # include <utility> +# include <boost/make_shared.hpp> # include <roboptim/core/twice-derivable-function.hh> using namespace roboptim; @@ -174,7 +175,7 @@ struct G1 : public TwiceDerivableFunction template <typename T> -void initialize_problem (T& pb, const G0& g0, const G1& g1) +void initialize_problem (T& pb) { // Set bound for all variables. // 1. < x_i < 5. (x_i in [1.;5.]) @@ -182,8 +183,11 @@ void initialize_problem (T& pb, const G0& g0, const G1& g1) pb.argumentBounds ()[i] = Function::makeInterval (1., 5.); // Add constraints. - pb.addConstraint (&g0, Function::makeLowerInterval (25.)); - pb.addConstraint (&g1, Function::makeInterval (40., 40.)); + pb.addConstraint (boost::make_shared<G0> (), + Function::makeLowerInterval (25.)); + + pb.addConstraint (boost::make_shared<G1> (), + Function::makeInterval (40., 40.)); // Set the starting point. Function::vector_t start (pb.function ().inputSize ()); diff --git a/tests/plugin.cc b/tests/plugin.cc index e908c5a..df08662 100644 --- a/tests/plugin.cc +++ b/tests/plugin.cc @@ -18,6 +18,7 @@ #include <iostream> #include <boost/numeric/ublas/io.hpp> #include <boost/variant/get.hpp> +#include <boost/mpl/vector.hpp> #include <roboptim/core/solver-factory.hh> @@ -25,16 +26,15 @@ #include "hs071.hh" using namespace roboptim; -typedef Solver<TwiceDerivableFunction, const TwiceDerivableFunction*> solver_t; +typedef Solver<TwiceDerivableFunction, + boost::mpl::vector<TwiceDerivableFunction> > solver_t; int run_test () { F f; - G0 g0; - G1 g1; solver_t::problem_t pb (f); - initialize_problem (pb, g0, g1); + initialize_problem (pb); // Initialize solver SolverFactory<solver_t> factory ("ipopt", pb); diff --git a/tests/simple.cc b/tests/simple.cc index 7856666..aae774d 100644 --- a/tests/simple.cc +++ b/tests/simple.cc @@ -29,11 +29,9 @@ int run_test () { F f; - G0 g0; - G1 g1; IpoptSolver::problem_t pb (f); - initialize_problem (pb, g0, g1); + initialize_problem (pb); // Initialize solver IpoptSolver solver (pb); ----------------------------------------------------------------------- Summary of changes: ChangeLog | 10 ++++++ include/roboptim/core/plugin/ipopt.hh | 7 ++-- src/roboptim-core-ipopt-plugin.cc | 58 ++++++++++++++++++++++++++++---- tests/hs071.hh | 10 ++++-- tests/plugin.cc | 8 ++-- tests/simple.cc | 4 +-- 6 files changed, 76 insertions(+), 21 deletions(-) hooks/post-receive -- roboptim |
From: Thomas M. <tho...@us...> - 2009-06-15 07:07:44
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "roboptim". The branch, share has been updated via 0e3cc5c43fa02c2054e6453842ec3066a067a249 (commit) from b458a86d5d1b1805fc6074ffb0fdee8c5324ed11 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 0e3cc5c43fa02c2054e6453842ec3066a067a249 Author: Thomas Moulard <tho...@gm...> Date: Mon Jun 15 16:04:56 2009 +0900 Update to new constraint interface. * optimization-tests/hs071.hh: New. Signed-off-by: Thomas Moulard <tho...@gm...> diff --git a/ChangeLog b/ChangeLog index e6c5f7b..574cb98 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-06-15 Thomas Moulard <tho...@gm...> + + Update to new constraint interface. + * optimization-tests/hs071.hh: New. + 2009-06-10 Thomas Moulard <tho...@gm...> Remove comment and fix remodir computation. diff --git a/optimization-tests/hs071.hh b/optimization-tests/hs071.hh new file mode 100644 index 0000000..aa3e421 --- /dev/null +++ b/optimization-tests/hs071.hh @@ -0,0 +1,198 @@ +// Copyright (C) 2009 by Thomas Moulard, AIST, CNRS, INRIA. +// +// This file is part of the roboptim. +// +// roboptim is free software: you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// roboptim is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public License +// along with roboptim. If not, see <http://www.gnu.org/licenses/>. + + +#ifndef OPTIMIZATION_TESTS_HS071_HH +# define OPTIMIZATION_TESTS_HS071_HH +# include <utility> +# include <boost/make_shared.hpp> +# include <roboptim/core/twice-derivable-function.hh> + +using namespace roboptim; + +struct F : public TwiceDerivableFunction +{ + F () : TwiceDerivableFunction (4, 1) + { + } + + void + impl_compute (result_t& result, const argument_t& x) const throw () + { + result.clear (); + result (0) = x[0] * x[3] * (x[0] + x[1] + x[2]) + x[3]; + } + + void + impl_gradient (gradient_t& grad, const argument_t& x, size_type) const throw () + { + grad.clear (); + grad[0] = x[0] * x[3] + x[3] * (x[0] + x[1] + x[2]); + grad[1] = x[0] * x[3]; + grad[2] = x[0] * x[3] + 1; + grad[3] = x[0] * (x[0] + x[1] + x[2]); + } + + void + impl_hessian (hessian_t& h, const argument_t& x, size_type) const throw () + { + h.clear (); + h (0, 0) = 2 * x[3]; + h (0, 1) = x[3]; + h (0, 2) = x[3]; + h (0, 3) = 2 * x[0] + x[1] + x[2]; + + h (1, 0) = x[3]; + h (1, 1) = 0.; + h (1, 2) = 0.; + h (1, 3) = x[0]; + + h (2, 0) = x[3]; + h (2, 1) = 0.; + h (2, 2) = 0.; + h (2, 3) = x[1]; + + h (3, 0) = 2 * x[0] + x[1] + x[2]; + h (3, 1) = x[0]; + h (3, 2) = x[0]; + h (3, 3) = 0.; + } +}; + +struct G0 : public TwiceDerivableFunction +{ + G0 () + : TwiceDerivableFunction (4, 1) + { + } + + void + impl_compute (result_t& res, const argument_t& x) const throw () + { + res.clear (); + res (0) = x[0] * x[1] * x[2] * x[3]; + } + + void + impl_gradient (gradient_t& grad, const argument_t& x, size_type) const throw () + { + grad.clear (); + grad[0] = x[1] * x[2] * x[3]; + grad[1] = x[0] * x[2] * x[3]; + grad[2] = x[0] * x[1] * x[3]; + grad[3] = x[0] * x[1] * x[2]; + } + + void + impl_hessian (hessian_t& h, const argument_t& x, size_type) const throw () + { + h.clear (); + h (0, 0) = 0.; + h (0, 1) = x[2] * x[3]; + h (0, 2) = x[1] * x[3]; + h (0, 3) = x[1] * x[2]; + + h (1, 0) = x[2] * x[3]; + h (1, 1) = 0.; + h (1, 2) = x[0] * x[3]; + h (1, 3) = x[0] * x[2]; + + h (2, 0) = x[1] * x[3]; + h (2, 1) = x[0] * x[3]; + h (2, 2) = 0.; + h (2, 3) = x[0] * x[1]; + + h (3, 0) = x[1] * x[2]; + h (3, 1) = x[0] * x[2]; + h (3, 2) = x[0] * x[1]; + h (3, 3) = 0.; + } +}; + +struct G1 : public TwiceDerivableFunction +{ + G1 () + : TwiceDerivableFunction (4, 1) + { + } + + void + impl_compute (result_t& res, const argument_t& x) const throw () + { + res.clear (); + res (0) = x[0]*x[0] + x[1]*x[1] + x[2]*x[2] + x[3]*x[3]; + } + + void + impl_gradient (gradient_t& grad, const argument_t& x, size_type) const throw () + { + grad.clear (); + grad[0] = 2 * x[0]; + grad[1] = 2 * x[1]; + grad[2] = 2 * x[2]; + grad[3] = 2 * x[3]; + } + + void + impl_hessian (hessian_t& h, const argument_t& x, size_type) const throw () + { + h.clear (); + h (0, 0) = 2.; + h (0, 1) = 0.; + h (0, 2) = 0.; + h (0, 3) = 0.; + + h (1, 0) = 0.; + h (1, 1) = 2.; + h (1, 2) = 0.; + h (1, 3) = 0.; + + h (2, 0) = 0.; + h (2, 1) = 0.; + h (2, 2) = 2.; + h (2, 3) = 0.; + + h (3, 0) = 0.; + h (3, 1) = 0.; + h (3, 2) = 0.; + h (3, 3) = 2.; + } +}; + + +template <typename T> +void initialize_problem (T& pb) +{ + // Set bound for all variables. + // 1. < x_i < 5. (x_i in [1.;5.]) + for (Function::size_type i = 0; i < pb.function ().inputSize (); ++i) + pb.argumentBounds ()[i] = Function::makeInterval (1., 5.); + + // Add constraints. + pb.addConstraint (boost::make_shared<G0> (), + Function::makeLowerInterval (25.)); + + pb.addConstraint (boost::make_shared<G1> (), + Function::makeInterval (40., 40.)); + + // Set the starting point. + Function::vector_t start (pb.function ().inputSize ()); + start[0] = 1., start[1] = 5., start[2] = 5., start[3] = 1.; + pb.startingPoint () = start; +} + +#endif //! OPTIMIZATION_TESTS_HS071_HH ----------------------------------------------------------------------- Summary of changes: ChangeLog | 5 + optimization-tests/hs071.hh | 198 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 203 insertions(+), 0 deletions(-) create mode 100644 optimization-tests/hs071.hh hooks/post-receive -- roboptim |
From: Thomas M. <tho...@us...> - 2009-06-15 05:33:58
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "roboptim". The branch, core has been updated via a5d23a3f6d90fce0f5b8214fd65845a43767a43d (commit) from 8118168101c2a163fd5923e94efe44c17f635f67 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit a5d23a3f6d90fce0f5b8214fd65845a43767a43d Author: Thomas Moulard <tho...@gm...> Date: Mon Jun 15 14:31:43 2009 +0900 Generalize addConstraint. * include/roboptim/core/problem.hh, * include/roboptim/core/problem.hxx: Modify addConstraint in order to let the user choose how a constraint should be considered (example: consider a constraint as a linear or as a non-linear function). Signed-off-by: Thomas Moulard <tho...@gm...> diff --git a/ChangeLog b/ChangeLog index 943a425..e0d44ca 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,15 @@ 2009-06-15 Thomas Moulard <tho...@gm...> + Generalize addConstraint. + * include/roboptim/core/problem.hh, + * include/roboptim/core/problem.hxx: + Modify addConstraint in order to let the user + choose how a constraint should be considered + (example: consider a constraint as a linear or + as a non-linear function). + +2009-06-15 Thomas Moulard <tho...@gm...> + Add constant function. * include/Makefile.am: Distribute new headers. * include/roboptim/core/constant-function.hh: New. diff --git a/include/roboptim/core/problem.hh b/include/roboptim/core/problem.hh index a7eff3a..7c9a7c2 100644 --- a/include/roboptim/core/problem.hh +++ b/include/roboptim/core/problem.hh @@ -90,8 +90,10 @@ namespace roboptim /// /// It is recommended to add a constraint using the following syntax: /// \code - /// problem.addConstraint (boost::make_shared<MyConstraint> (...), ...); + /// problem.addConstraint<C> (boost::make_shared<MyFunction> (...), ...); /// \endcode + /// where C is the constraint type and MyFunction the function type. + /// /// /// Unlike other classes which just copy functions, pointers are used /// here in order to allow sub-classes of constraints to be inserted @@ -173,10 +175,13 @@ namespace roboptim const constraints_t& constraints () const throw (); /// \brief Add a constraint to the problem. + /// /// \param constraint the constraint that will be added /// \param interval interval in which the constraint is satisfied /// \param scale constraint scale - void addConstraint (constraint_t constraint, + /// \tparam C constraint type (has to be in CLIST) + template <typename C> + void addConstraint (boost::shared_ptr<C> constraint, interval_t interval, value_type scale = 1.) throw (std::runtime_error); diff --git a/include/roboptim/core/problem.hxx b/include/roboptim/core/problem.hxx index aacea6c..ec1c2db 100644 --- a/include/roboptim/core/problem.hxx +++ b/include/roboptim/core/problem.hxx @@ -104,14 +104,19 @@ namespace roboptim } template <typename F, typename CLIST> + template <typename C> void - Problem<F, CLIST>::addConstraint (constraint_t x, + Problem<F, CLIST>::addConstraint (boost::shared_ptr<C> x, interval_t b, value_type s) throw (std::runtime_error) { + //FIXME: check that C is in CLIST. + + // Check that the pointer is not null. + assert (!!x.get ()); assert (b.first <= b.second); - constraints_.push_back (x); + constraints_.push_back (boost::static_pointer_cast<C> (x)); bounds_.push_back (b); scales_.push_back (s); } ----------------------------------------------------------------------- Summary of changes: ChangeLog | 10 ++++++++++ include/roboptim/core/problem.hh | 9 +++++++-- include/roboptim/core/problem.hxx | 9 +++++++-- 3 files changed, 24 insertions(+), 4 deletions(-) hooks/post-receive -- roboptim |
From: Thomas M. <tho...@us...> - 2009-06-15 03:01:32
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "roboptim". The branch, core has been updated via 8118168101c2a163fd5923e94efe44c17f635f67 (commit) from fc47c009d836717af25e992a45c7e6753e278c71 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 8118168101c2a163fd5923e94efe44c17f635f67 Author: Thomas Moulard <tho...@gm...> Date: Mon Jun 15 11:59:17 2009 +0900 Add constant function. * include/Makefile.am: Distribute new headers. * include/roboptim/core/constant-function.hh: New. * src/Makefile.am: Compile constant function. * src/constant-function.cc: New. * tests/Makefile.am: Add constant function test. * tests/constant-function.cc: New. * tests/constant-function.stdout: New. * tests/problem-cc.cc: Use constant function. * tests/testsuite.at: Run test suite. Signed-off-by: Thomas Moulard <tho...@gm...> diff --git a/ChangeLog b/ChangeLog index dce4965..943a425 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,18 @@ 2009-06-15 Thomas Moulard <tho...@gm...> + Add constant function. + * include/Makefile.am: Distribute new headers. + * include/roboptim/core/constant-function.hh: New. + * src/Makefile.am: Compile constant function. + * src/constant-function.cc: New. + * tests/Makefile.am: Add constant function test. + * tests/constant-function.cc: New. + * tests/constant-function.stdout: New. + * tests/problem-cc.cc: Use constant function. + * tests/testsuite.at: Run test suite. + +2009-06-15 Thomas Moulard <tho...@gm...> + Generalize constraint storage. * include/roboptim/core/plugin/dummy.hh: Use new syntax to specify constraints types. diff --git a/include/Makefile.am b/include/Makefile.am index 5485362..8f546e5 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -2,6 +2,7 @@ include $(top_srcdir)/build-aux/init.mk # --- Distribute and install headers. nobase_include_HEADERS = \ + roboptim/core/constant-function.hh \ roboptim/core/derivable-function.hh \ roboptim/core/function.hh \ roboptim/core/fwd.hh \ diff --git a/include/roboptim/core/constant-function.hh b/include/roboptim/core/constant-function.hh new file mode 100644 index 0000000..f07b0cb --- /dev/null +++ b/include/roboptim/core/constant-function.hh @@ -0,0 +1,64 @@ +// Copyright (C) 2009 by Thomas Moulard, AIST, CNRS, INRIA. +// +// This file is part of the roboptim. +// +// roboptim is free software: you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// roboptim is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public License +// along with roboptim. If not, see <http://www.gnu.org/licenses/>. + +#ifndef ROBOPTIM_CORE_CONSTANT_FUNCTION_HH +# define ROBOPTIM_CORE_CONSTANT_FUNCTION_HH +# include <roboptim/core/linear-function.hh> + +namespace roboptim +{ + /// \addtogroup roboptim_function + /// @{ + + /// \brief Constant function. + /// + /// Implement a constant function using the formula: + /// \f[f(x) = offset\f] + /// where \f$offset\f$ is set when the class is instantiated. + class ConstantFunction : public LinearFunction + { + public: + /// \brief Build an constant function. + /// + /// \param offset constant function offset + ConstantFunction (const vector_t& offset) throw (); + ~ConstantFunction () throw (); + + /// \brief Display the function on the specified output stream. + /// + /// \param o output stream used for display + /// \return output stream + virtual std::ostream& print (std::ostream&) const throw (); + + protected: + void impl_compute (result_t& , const vector_t&) const throw (); + void impl_gradient (gradient_t&, const vector_t&, size_type = 0) + const throw (); + void impl_jacobian (jacobian_t&, const vector_t&) const throw (); + + private: + const vector_t offset_; + }; + + /// Example shows constant function use. + /// \example constant-function.cc + + /// @} + +} // end of namespace roboptim + +#endif //! ROBOPTIM_CORE_CONSTANT_FUNCTION_HH diff --git a/src/Makefile.am b/src/Makefile.am index 144fb7d..61a4aad 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -7,6 +7,7 @@ lib_LTLIBRARIES = libroboptim-core.la \ roboptim-core-dummy-plugin.la libroboptim_core_la_SOURCES = \ + constant-function.cc \ doc.hh \ derivable-function.cc \ finite-difference-gradient.cc \ diff --git a/src/constant-function.cc b/src/constant-function.cc new file mode 100644 index 0000000..488c1d5 --- /dev/null +++ b/src/constant-function.cc @@ -0,0 +1,69 @@ +// Copyright (C) 2009 by Thomas Moulard, AIST, CNRS, INRIA. +// +// This file is part of the roboptim. +// +// roboptim is free software: you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// roboptim is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public License +// along with roboptim. If not, see <http://www.gnu.org/licenses/>. + +#include <boost/numeric/ublas/io.hpp> +#include <boost/numeric/ublas/matrix.hpp> +#include <boost/numeric/ublas/vector.hpp> + +#include <roboptim/core/indent.hh> +#include <roboptim/core/constant-function.hh> + +namespace roboptim +{ + ConstantFunction::ConstantFunction (const vector_t& offset) + throw () + : LinearFunction (offset.size (), offset.size ()), + offset_ (offset) + { + } + + ConstantFunction::~ConstantFunction () throw () + { + } + + void + ConstantFunction::impl_compute (result_t& result, + const argument_t& argument) + const throw () + { + result = this->offset_; + } + + void + ConstantFunction::impl_jacobian (jacobian_t& jacobian, + const argument_t&) const throw () + { + jacobian.clear (); + } + + void + ConstantFunction::impl_gradient (gradient_t& gradient, + const argument_t& argument, + size_type idFunction) const throw () + { + gradient.clear (); + } + + std::ostream& + ConstantFunction::print (std::ostream& o) const throw () + { + return o << "Constant function" << incindent << iendl + << "offset = " << this->offset_ << iendl + << decindent; + } + +} // end of namespace roboptim diff --git a/tests/Makefile.am b/tests/Makefile.am index 7703215..ebb566e 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -62,6 +62,11 @@ check_PROGRAMS += identity-function identity_function_SOURCES = identity-function.cc $(COMMON_SOURCES) identity_function_LDADD = $(top_builddir)/src/libroboptim-core.la +# constant-function +check_PROGRAMS += constant-function +constant_function_SOURCES = constant-function.cc $(COMMON_SOURCES) +constant_function_LDADD = $(top_builddir)/src/libroboptim-core.la + # visualization-gnuplot-simple check_PROGRAMS += visualization-gnuplot-simple visualization_gnuplot_simple_SOURCES = visualization-gnuplot-simple.cc \ @@ -97,6 +102,7 @@ generate-reference: # Distribute reference files. EXTRA_DIST += \ + constant-function.stdout \ finite-difference-gradient.stdout \ identity-function.stdout \ n-times-derivable-function.stdout \ diff --git a/tests/constant-function.cc b/tests/constant-function.cc new file mode 100644 index 0000000..fbf7587 --- /dev/null +++ b/tests/constant-function.cc @@ -0,0 +1,51 @@ +// Copyright (C) 2009 by Thomas Moulard, AIST, CNRS, INRIA. +// +// This file is part of the roboptim. +// +// roboptim is free software: you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// roboptim is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public License +// along with roboptim. If not, see <http://www.gnu.org/licenses/>. + +#include <iostream> +#include <boost/numeric/ublas/io.hpp> + +#include "common.hh" +#include <roboptim/core/constant-function.hh> + +using namespace roboptim; + +int run_test () +{ + ConstantFunction::vector_t offset (4); + offset[0] = 12.; + offset[1] = 46.; + offset[2] = 2.; + offset[3] = -9.; + + ConstantFunction cst (offset); + + ConstantFunction::vector_t x (4); + x.clear (); + + std::cout + << cst << std::endl + << "Evaluate: " << std::endl + << cst (x) << std::endl + << "Gradient: " << std::endl + << cst.gradient (x) << std::endl + << "Jacobian: " << std::endl + << cst.jacobian (x) << std::endl; + + return 0; +} + +GENERATE_TEST () diff --git a/tests/constant-function.stdout b/tests/constant-function.stdout new file mode 100644 index 0000000..4ebd20f --- /dev/null +++ b/tests/constant-function.stdout @@ -0,0 +1,9 @@ +Constant function + offset = [4](12,46,2,-9) + +Evaluate: +[4](12,46,2,-9) +Gradient: +[4](0,0,0,0) +Jacobian: +[4,4]((0,0,0,0),(0,0,0,0),(0,0,0,0),(0,0,0,0)) diff --git a/tests/problem-cc.cc b/tests/problem-cc.cc index 43d8d33..9334e33 100644 --- a/tests/problem-cc.cc +++ b/tests/problem-cc.cc @@ -19,30 +19,12 @@ #include <boost/mpl/vector.hpp> +#include <roboptim/core/constant-function.hh> #include <roboptim/core/derivable-function.hh> #include <roboptim/core/problem.hh> using namespace roboptim; -// Define null function. -struct F : public DerivableFunction -{ -public: - F () throw () : DerivableFunction (1, 1) - {} - - void impl_compute (result_t& result, const argument_t&) const throw () - { - result.clear (); - } - - void impl_gradient (gradient_t& gradient, - const argument_t& argument, size_type) const throw () - { - gradient.clear (); - } -}; - // Check that a problem has really been copied. #define CHECK_COPY(A, B) \ assert (&(A).function () == &(B).function ()); \ @@ -54,7 +36,10 @@ int run_test () problemSrc_t; typedef Problem<Function, boost::mpl::vector<Function> > problemDst_t; - F f; + ConstantFunction::vector_t v (1); + v.clear (); + + ConstantFunction f (v); problemSrc_t pbSrc (f); diff --git a/tests/testsuite.at b/tests/testsuite.at index c35e901..a07656b 100644 --- a/tests/testsuite.at +++ b/tests/testsuite.at @@ -37,6 +37,7 @@ CHECK_STDOUT([n-times-derivable-function], [Check N times derivable function.]) CHECK_STDOUT([finite-difference-gradient], [Check finite difference gradient.]) CHECK_STDOUT([result], [Check Result class.]) CHECK_STDOUT([identity-function], [Check identity function class.]) +CHECK_STDOUT([constant-function], [Check constant function class.]) AT_BANNER([Plug-in mechanism]) CHECK_STDOUT([plugin], [Load dummy plug-in dynamically.]) ----------------------------------------------------------------------- Summary of changes: ChangeLog | 13 +++++++++ include/Makefile.am | 1 + .../{identity-function.hh => constant-function.hh} | 28 ++++++++++---------- src/Makefile.am | 1 + src/{identity-function.cc => constant-function.cc} | 25 +++++++---------- tests/Makefile.am | 6 ++++ .../{identity-function.cc => constant-function.cc} | 16 +++++----- ...ty-function.stdout => constant-function.stdout} | 6 ++-- tests/problem-cc.cc | 25 +++-------------- tests/testsuite.at | 1 + 10 files changed, 62 insertions(+), 60 deletions(-) copy include/roboptim/core/{identity-function.hh => constant-function.hh} (69%) copy src/{identity-function.cc => constant-function.cc} (65%) copy tests/{identity-function.cc => constant-function.cc} (79%) copy tests/{identity-function.stdout => constant-function.stdout} (50%) hooks/post-receive -- roboptim |
From: Thomas M. <tho...@us...> - 2009-06-15 02:48:07
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "roboptim". The branch, core has been updated via fc47c009d836717af25e992a45c7e6753e278c71 (commit) via ed38cc943ed7392645006c6a1fd668121badf73f (commit) from 3244943fef1566a1d882d77eef4395023b6c53d1 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit fc47c009d836717af25e992a45c7e6753e278c71 Author: Thomas Moulard <tho...@gm...> Date: Mon Jun 15 11:45:49 2009 +0900 Generalize constraint storage. * include/roboptim/core/plugin/dummy.hh: Use new syntax to specify constraints types. * include/roboptim/core/problem.hh, * include/roboptim/core/problem.hxx: Generalize constraint storage. * tests/plugin.cc, * tests/problem-cc.cc, * tests/simple.cc: Use new syntax to specify constraints types. Signed-off-by: Thomas Moulard <tho...@gm...> diff --git a/ChangeLog b/ChangeLog index 79bde44..dce4965 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,17 @@ 2009-06-15 Thomas Moulard <tho...@gm...> + Generalize constraint storage. + * include/roboptim/core/plugin/dummy.hh: Use new syntax + to specify constraints types. + * include/roboptim/core/problem.hh, + * include/roboptim/core/problem.hxx: Generalize constraint storage. + * tests/plugin.cc, + * tests/problem-cc.cc, + * tests/simple.cc: Use new syntax to specify constraints + types. + +2009-06-15 Thomas Moulard <tho...@gm...> + Fix distribution. * include/Makefile.am: Distribute identity-function.hh. * tests/Makefile.am: Remove freeze.stdout and diff --git a/include/roboptim/core/plugin/dummy.hh b/include/roboptim/core/plugin/dummy.hh index 29ab262..dcb1e0c 100644 --- a/include/roboptim/core/plugin/dummy.hh +++ b/include/roboptim/core/plugin/dummy.hh @@ -18,6 +18,8 @@ #ifndef ROBOPTIM_CORE_DUMMY_HH # define ROBOPTIM_CORE_DUMMY_HH +# include <boost/mpl/vector.hpp> + # include <roboptim/core/solver.hh> namespace roboptim @@ -29,11 +31,11 @@ namespace roboptim /// /// It is also a good starting point for users that /// want to develop their own solver. - class DummySolver : public Solver<Function, const Function*> + class DummySolver : public Solver<Function, boost::mpl::vector<Function> > { public: /// \brief Define parent's type. - typedef Solver<Function, const Function*> parent_t; + typedef Solver<Function, boost::mpl::vector<Function> > parent_t; /// \brief Build a solver from a problem. /// \param problem problem that will be solved diff --git a/include/roboptim/core/problem.hh b/include/roboptim/core/problem.hh index 57ca52c..a7eff3a 100644 --- a/include/roboptim/core/problem.hh +++ b/include/roboptim/core/problem.hh @@ -19,15 +19,47 @@ # define ROBOPTIM_CORE_PROBLEM_HH # include <iostream> # include <stdexcept> + +# include <boost/mpl/transform.hpp> # include <boost/optional.hpp> +# include <boost/shared_ptr.hpp> # include <boost/static_assert.hpp> # include <boost/type_traits/is_base_of.hpp> +# include <boost/variant.hpp> # include <roboptim/core/fwd.hh> # include <roboptim/core/function.hh> namespace roboptim { + namespace detail + { + using namespace boost; + using namespace boost::mpl; + + /// \brief Transform a types list into a types list of shared pointers. + /// + /// If the input list is: + /// \code + /// boost::mpl::vector<int, long> + /// \endcode + //// + /// then the result (type) will be: + /// \code + /// boost::mpl::vector<boost::shared_ptr<int>, + /// boost::shared_ptr<long> > + /// \endcode + /// + /// \tparam CLIST list that will be transformed + template <typename CLIST> + struct add_shared_ptr + { + /// \brief Result. + typedef typename boost::mpl::transform + <CLIST, typename boost::shared_ptr<boost::mpl::_1> >::type type; + }; + } // end of namespace detail. + /// \addtogroup roboptim_problem /// @{ @@ -51,18 +83,59 @@ namespace roboptim /// method: a reference to a function and an interval is needed. /// /// The cost function is immutable. - template <typename F, typename C> + /// + /// Constraints are stored as a Boost.Variant of smart pointers + /// (i.e. more precisely using a boost::shared_ptr) representing all + /// the different possibles constraint types. + /// + /// It is recommended to add a constraint using the following syntax: + /// \code + /// problem.addConstraint (boost::make_shared<MyConstraint> (...), ...); + /// \endcode + /// + /// Unlike other classes which just copy functions, pointers are used + /// here in order to allow sub-classes of constraints to be inserted + /// in the problem. + /// For instance, a twice derivable function can be inserted in + /// a problem which expects a derivable function. + /// + /// \tparam F function type + /// \tparam CLIST type list satisfying MPL's sequence concept + template <typename F, typename CLIST> class Problem { BOOST_STATIC_ASSERT((boost::is_base_of<Function, F>::value)); + + //FIXME: check that CLIST is a MPL vector of Function's sub-classes. public: - template <typename F_, typename C_> + template <typename F_, typename CLIST_> friend class Problem; /// \brief Function type. + /// + /// This has to be either Function or one of its + /// sub-classes. typedef F function_t; + /// \brief Constraint's type. - typedef C constraint_t; + /// + /// Generate a Boost.Variant of shared pointers tyle from the + /// static constraints types list. + /// + /// For instance, if one instantiates + /// \code + /// Problem<QuadraticFunction, vector<LinearFunction, QuadraticFunction> > + /// \endcode + /// then this type will be set to: + /// \code + /// boost::variant<boost::shared_ptr<LinearFunction>, + /// boost::shared_ptr<QuadraticFunction> > + /// \endcode + /// + /// The meta-algorithm which add shared pointers is implemented + /// in detail::add_shared_pointer. + typedef typename boost::make_variant_over + <typename detail::add_shared_ptr<CLIST>::type>::type constraint_t; // \brief Import function's value_type type. typedef typename function_t::value_type value_type; @@ -83,11 +156,11 @@ namespace roboptim explicit Problem (const function_t&) throw (); /// \brief Copy constructor. - explicit Problem (const Problem<F, C>&) throw (); + explicit Problem (const Problem<F, CLIST>&) throw (); /// \brief Copy constructor (convert from another class of problem). - template <typename F_, typename C_> - explicit Problem (const Problem<F_, C_>&) throw (); + template <typename F_, typename CLIST_> + explicit Problem (const Problem<F_, CLIST_>&) throw (); ~Problem () throw (); @@ -100,10 +173,11 @@ namespace roboptim const constraints_t& constraints () const throw (); /// \brief Add a constraint to the problem. - /// \param constraint reference to the constraint to add + /// \param constraint the constraint that will be added /// \param interval interval in which the constraint is satisfied /// \param scale constraint scale - void addConstraint (const C& constraint, interval_t interval, + void addConstraint (constraint_t constraint, + interval_t interval, value_type scale = 1.) throw (std::runtime_error); @@ -181,8 +255,8 @@ namespace roboptim /// \param o output stream used for display /// \param pb problem to be displayed /// \return output stream - template <typename F, typename C> - std::ostream& operator<< (std::ostream& o, const Problem<F, C>& pb); + template <typename F, typename CLIST> + std::ostream& operator<< (std::ostream& o, const Problem<F, CLIST>& pb); } // end of namespace roboptim # include <roboptim/core/problem.hxx> diff --git a/include/roboptim/core/problem.hxx b/include/roboptim/core/problem.hxx index cdc3487..aacea6c 100644 --- a/include/roboptim/core/problem.hxx +++ b/include/roboptim/core/problem.hxx @@ -30,8 +30,8 @@ namespace roboptim { - template <typename F, typename C> - Problem<F, C>::Problem (const function_t& f) throw () + template <typename F, typename CLIST> + Problem<F, CLIST>::Problem (const function_t& f) throw () : function_ (f), startingPoint_ (), constraints_ (), @@ -50,14 +50,14 @@ namespace roboptim std::fill (argumentScales_.begin (), argumentScales_.end (), 1.); } - template <typename F, typename C> - Problem<F, C>::~Problem () throw () + template <typename F, typename CLIST> + Problem<F, CLIST>::~Problem () throw () { } // Copy constructor. - template <typename F, typename C> - Problem<F, C>::Problem (const Problem<F, C>& pb) throw () + template <typename F, typename CLIST> + Problem<F, CLIST>::Problem (const Problem<F, CLIST>& pb) throw () : function_ (pb.function_), startingPoint_ (pb.startingPoint_), constraints_ (pb.constraints_), @@ -69,9 +69,9 @@ namespace roboptim } // Copy constructor (convert from another class of problem). - template <typename F, typename C> - template <typename F_, typename C_> - Problem<F, C>::Problem (const Problem<F_, C_>& pb) throw () + template <typename F, typename CLIST> + template <typename F_, typename CLIST_> + Problem<F, CLIST>::Problem (const Problem<F_, CLIST_>& pb) throw () : function_ (pb.function_), startingPoint_ (pb.startingPoint_), constraints_ (), @@ -83,32 +83,31 @@ namespace roboptim // Check that F is a subtype of F_. BOOST_STATIC_ASSERT((boost::is_base_of<F, F_>::value)); - // Check that C is a subtype of C_. - typedef typename boost::remove_pointer<C_>::type rpC_; - typedef typename boost::remove_pointer<C>::type rpC; - BOOST_STATIC_ASSERT((boost::is_base_of<rpC, rpC_>::value)); + //FIXME: check that CLIST is a MPL vector of Function's sub-classes. std::copy (pb.constraints_.begin (), pb.constraints_.end (), constraints_.begin ()); } - template <typename F, typename C> - const typename Problem<F, C>::function_t& - Problem<F, C>::function () const throw () + template <typename F, typename CLIST> + const typename Problem<F, CLIST>::function_t& + Problem<F, CLIST>::function () const throw () { return function_; } - template <typename F, typename C> - const typename Problem<F, C>::constraints_t& - Problem<F, C>::constraints () const throw () + template <typename F, typename CLIST> + const typename Problem<F, CLIST>::constraints_t& + Problem<F, CLIST>::constraints () const throw () { return constraints_; } - template <typename F, typename C> + template <typename F, typename CLIST> void - Problem<F, C>::addConstraint (const C& x, interval_t b, value_type s) + Problem<F, CLIST>::addConstraint (constraint_t x, + interval_t b, + value_type s) throw (std::runtime_error) { assert (b.first <= b.second); @@ -117,58 +116,58 @@ namespace roboptim scales_.push_back (s); } - template <typename F, typename C> - typename Problem<F, C>::startingPoint_t& - Problem<F, C>::startingPoint () throw () + template <typename F, typename CLIST> + typename Problem<F, CLIST>::startingPoint_t& + Problem<F, CLIST>::startingPoint () throw () { return startingPoint_; } - template <typename F, typename C> - const typename Problem<F, C>::startingPoint_t& - Problem<F, C>::startingPoint () const throw () + template <typename F, typename CLIST> + const typename Problem<F, CLIST>::startingPoint_t& + Problem<F, CLIST>::startingPoint () const throw () { return startingPoint_; } - template <typename F, typename C> - const typename Problem<F, C>::intervals_t& - Problem<F, C>::bounds () const throw () + template <typename F, typename CLIST> + const typename Problem<F, CLIST>::intervals_t& + Problem<F, CLIST>::bounds () const throw () { return bounds_; } - template <typename F, typename C> - typename Problem<F, C>::intervals_t& - Problem<F, C>::argumentBounds () throw () + template <typename F, typename CLIST> + typename Problem<F, CLIST>::intervals_t& + Problem<F, CLIST>::argumentBounds () throw () { return argumentBounds_; } - template <typename F, typename C> - const typename Problem<F, C>::intervals_t& - Problem<F, C>::argumentBounds () const throw () + template <typename F, typename CLIST> + const typename Problem<F, CLIST>::intervals_t& + Problem<F, CLIST>::argumentBounds () const throw () { return argumentBounds_; } - template <typename F, typename C> - const typename Problem<F, C>::scales_t& - Problem<F, C>::scales () const throw () + template <typename F, typename CLIST> + const typename Problem<F, CLIST>::scales_t& + Problem<F, CLIST>::scales () const throw () { return scales_; } - template <typename F, typename C> - typename Problem<F, C>::scales_t& - Problem<F, C>::argumentScales () throw () + template <typename F, typename CLIST> + typename Problem<F, CLIST>::scales_t& + Problem<F, CLIST>::argumentScales () throw () { return argumentScales_; } - template <typename F, typename C> - const typename Problem<F, C>::scales_t& - Problem<F, C>::argumentScales () const throw () + template <typename F, typename CLIST> + const typename Problem<F, CLIST>::scales_t& + Problem<F, CLIST>::argumentScales () const throw () { return argumentScales_; } @@ -191,9 +190,9 @@ namespace roboptim } } - template <typename F, typename C> + template <typename F, typename CLIST> std::ostream& - Problem<F, C>::print (std::ostream& o) const throw () + Problem<F, CLIST>::print (std::ostream& o) const throw () { o << "Problem:" << incendl; // Function. @@ -242,9 +241,9 @@ namespace roboptim return o << decindent; } - template <typename F, typename C> + template <typename F, typename CLIST> std::ostream& - operator<< (std::ostream& o, const Problem<F, C>& pb) + operator<< (std::ostream& o, const Problem<F, CLIST>& pb) { return pb.print (o); } diff --git a/tests/plugin.cc b/tests/plugin.cc index f7fc106..a43ee9b 100644 --- a/tests/plugin.cc +++ b/tests/plugin.cc @@ -17,13 +17,15 @@ #include <iostream> +#include <boost/mpl/vector.hpp> + #include "common.hh" #include <roboptim/core/solver-factory.hh> using namespace roboptim; // Specify the solver that will be used. -typedef Solver<Function, const Function*> solver_t; +typedef Solver<Function, boost::mpl::vector<Function> > solver_t; // Define a simple function. struct F : public Function diff --git a/tests/problem-cc.cc b/tests/problem-cc.cc index 0210959..43d8d33 100644 --- a/tests/problem-cc.cc +++ b/tests/problem-cc.cc @@ -16,6 +16,9 @@ // along with roboptim. If not, see <http://www.gnu.org/licenses/>. #include "common.hh" + +#include <boost/mpl/vector.hpp> + #include <roboptim/core/derivable-function.hh> #include <roboptim/core/problem.hh> @@ -43,15 +46,13 @@ public: // Check that a problem has really been copied. #define CHECK_COPY(A, B) \ assert (&(A).function () == &(B).function ()); \ - assert ((A).constraints ().size () == (B).constraints ().size ()); \ - \ - for (unsigned i = 0; i < (A).constraints ().size (); ++i) \ - assert ((A).constraints ()[i] == (B).constraints ()[i]) + assert ((A).constraints ().size () == (B).constraints ().size ()); int run_test () { - typedef Problem<DerivableFunction, const DerivableFunction*> problemSrc_t; - typedef Problem<Function, const Function*> problemDst_t; + typedef Problem<DerivableFunction, boost::mpl::vector<DerivableFunction> > + problemSrc_t; + typedef Problem<Function, boost::mpl::vector<Function> > problemDst_t; F f; diff --git a/tests/simple.cc b/tests/simple.cc index f7dfc0a..153dcfa 100644 --- a/tests/simple.cc +++ b/tests/simple.cc @@ -16,6 +16,7 @@ // along with roboptim. If not, see <http://www.gnu.org/licenses/>. #include <iostream> +#include <boost/make_shared.hpp> #include "common.hh" #include <roboptim/core/plugin/dummy.hh> @@ -73,8 +74,8 @@ int run_test () && pb.argumentScales ()[2] == 1. && pb.argumentScales ()[3] == 1.); - F f3; - pb.addConstraint (&f3, Function::makeInterval (0., 5.), 3.5); + pb.addConstraint (boost::make_shared<F> (), + Function::makeInterval (0., 5.), 3.5); assert (pb.constraints ().size () == 1); assert (&pb.constraints ()[0] != 0); assert (pb.bounds ().size () == 1); commit ed38cc943ed7392645006c6a1fd668121badf73f Author: Thomas Moulard <tho...@gm...> Date: Mon Jun 15 11:44:11 2009 +0900 Fix distribution. * include/Makefile.am: Distribute identity-function.hh. * tests/Makefile.am: Remove freeze.stdout and add identity-function.stdout. Signed-off-by: Thomas Moulard <tho...@gm...> diff --git a/ChangeLog b/ChangeLog index d1ca2e3..79bde44 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2009-06-15 Thomas Moulard <tho...@gm...> + + Fix distribution. + * include/Makefile.am: Distribute identity-function.hh. + * tests/Makefile.am: Remove freeze.stdout and + add identity-function.stdout. + 2009-06-13 Thomas Moulard <tho...@gm...> Implement identity function. diff --git a/include/Makefile.am b/include/Makefile.am index 9656bf1..5485362 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -7,6 +7,7 @@ nobase_include_HEADERS = \ roboptim/core/fwd.hh \ roboptim/core/finite-difference-gradient.hh \ roboptim/core/generic-solver.hh \ + roboptim/core/identity-function.hh \ roboptim/core/indent.hh \ roboptim/core/linear-function.hh \ roboptim/core/n-times-derivable-function.hh \ diff --git a/tests/Makefile.am b/tests/Makefile.am index 696810b..7703215 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -98,7 +98,7 @@ generate-reference: # Distribute reference files. EXTRA_DIST += \ finite-difference-gradient.stdout \ - freeze.stdout \ + identity-function.stdout \ n-times-derivable-function.stdout \ numeric-linear-function.stdout \ numeric-quadratic-function.stdout \ ----------------------------------------------------------------------- Summary of changes: ChangeLog | 19 +++++++ include/Makefile.am | 1 + include/roboptim/core/plugin/dummy.hh | 6 ++- include/roboptim/core/problem.hh | 94 ++++++++++++++++++++++++++++---- include/roboptim/core/problem.hxx | 97 ++++++++++++++++----------------- tests/Makefile.am | 2 +- tests/plugin.cc | 4 +- tests/problem-cc.cc | 13 +++-- tests/simple.cc | 5 +- 9 files changed, 170 insertions(+), 71 deletions(-) hooks/post-receive -- roboptim |
From: Thomas M. <tho...@us...> - 2009-06-12 15:21:14
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "roboptim". The branch, core has been updated via 3244943fef1566a1d882d77eef4395023b6c53d1 (commit) via 7a527a92bb6f5f7d5a51b20c98a17752940fa1dd (commit) from 137cebd0bd76cf06185de30917873875e0ff17b9 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 3244943fef1566a1d882d77eef4395023b6c53d1 Author: Thomas Moulard <tho...@gm...> Date: Sat Jun 13 00:20:00 2009 +0900 Implement identity function. * include/roboptim/core/identity-function.hh: New. * src/Makefile.am: Add new source. * src/identity-function.cc: New. * tests/Makefile.am: Compile new test. * tests/identity-function.cc: New. * tests/identity-function.stdout: New. * tests/testsuite.at: Run new test case. Signed-off-by: Thomas Moulard <tho...@gm...> diff --git a/ChangeLog b/ChangeLog index 48739b6..d1ca2e3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2009-06-13 Thomas Moulard <tho...@gm...> + + Implement identity function. + * include/roboptim/core/identity-function.hh: New. + * src/Makefile.am: Add new source. + * src/identity-function.cc: New. + * tests/Makefile.am: Compile new test. + * tests/identity-function.cc: New. + * tests/identity-function.stdout: New. + * tests/testsuite.at: Run new test case. + 2009-06-12 Thomas Moulard <tho...@gm...> Remove Freeze function. diff --git a/include/roboptim/core/identity-function.hh b/include/roboptim/core/identity-function.hh new file mode 100644 index 0000000..e4cffe0 --- /dev/null +++ b/include/roboptim/core/identity-function.hh @@ -0,0 +1,64 @@ +// Copyright (C) 2009 by Thomas Moulard, AIST, CNRS, INRIA. +// +// This file is part of the roboptim. +// +// roboptim is free software: you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// roboptim is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public License +// along with roboptim. If not, see <http://www.gnu.org/licenses/>. + +#ifndef ROBOPTIM_CORE_IDENTITY_FUNCTION_HH +# define ROBOPTIM_CORE_IDENTITY_FUNCTION_HH +# include <roboptim/core/linear-function.hh> + +namespace roboptim +{ + /// \addtogroup roboptim_function + /// @{ + + /// \brief Identity function. + /// + /// Implement a linear function using the formula: + /// \f[f(x) = x + offset\f] + /// where \f$A\f$ and \f$b\f$ are set when the class is instantiated. + class IdentityFunction : public LinearFunction + { + public: + /// \brief Build an identity function. + /// + /// \param offset identity function offset + IdentityFunction (const vector_t& offset) throw (); + ~IdentityFunction () throw (); + + /// \brief Display the function on the specified output stream. + /// + /// \param o output stream used for display + /// \return output stream + virtual std::ostream& print (std::ostream&) const throw (); + + protected: + void impl_compute (result_t& , const vector_t&) const throw (); + void impl_gradient (gradient_t&, const vector_t&, size_type = 0) + const throw (); + void impl_jacobian (jacobian_t&, const vector_t&) const throw (); + + private: + const vector_t offset_; + }; + + /// Example shows identity function use. + /// \example identity-function.cc + + /// @} + +} // end of namespace roboptim + +#endif //! ROBOPTIM_CORE_IDENTITY_FUNCTION_HH diff --git a/src/Makefile.am b/src/Makefile.am index f968b13..144fb7d 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -12,6 +12,7 @@ libroboptim_core_la_SOURCES = \ finite-difference-gradient.cc \ function.cc \ generic-solver.cc \ + identity-function.cc \ indent.cc \ linear-function.cc \ numeric-linear-function.cc \ diff --git a/src/identity-function.cc b/src/identity-function.cc new file mode 100644 index 0000000..6be5724 --- /dev/null +++ b/src/identity-function.cc @@ -0,0 +1,74 @@ +// Copyright (C) 2009 by Thomas Moulard, AIST, CNRS, INRIA. +// +// This file is part of the roboptim. +// +// roboptim is free software: you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// roboptim is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public License +// along with roboptim. If not, see <http://www.gnu.org/licenses/>. + +#include <boost/numeric/ublas/io.hpp> +#include <boost/numeric/ublas/matrix.hpp> +#include <boost/numeric/ublas/vector.hpp> + +#include <roboptim/core/indent.hh> +#include <roboptim/core/identity-function.hh> + +namespace roboptim +{ + IdentityFunction::IdentityFunction (const vector_t& offset) + throw () + : LinearFunction (offset.size (), offset.size ()), + offset_ (offset) + { + } + + IdentityFunction::~IdentityFunction () throw () + { + } + + void + IdentityFunction::impl_compute (result_t& result, + const argument_t& argument) + const throw () + { + using namespace boost::numeric::ublas; + result = argument + this->offset_; + } + + void + IdentityFunction::impl_jacobian (jacobian_t& jacobian, + const argument_t&) const throw () + { + using namespace boost::numeric::ublas; + jacobian = identity_matrix<value_type> (jacobianSize ().first, + jacobianSize ().second); + } + + void + IdentityFunction::impl_gradient (gradient_t& gradient, + const argument_t& argument, + size_type idFunction) const throw () + { + using namespace boost::numeric::ublas; + gradient.clear (); + gradient[idFunction] = 1.; + } + + std::ostream& + IdentityFunction::print (std::ostream& o) const throw () + { + return o << "Identity function" << incindent << iendl + << "offset = " << this->offset_ << iendl + << decindent; + } + +} // end of namespace roboptim diff --git a/tests/Makefile.am b/tests/Makefile.am index ae715ef..696810b 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -57,6 +57,11 @@ check_PROGRAMS += finite-difference-gradient finite_difference_gradient_SOURCES = finite-difference-gradient.cc $(COMMON_SOURCES) finite_difference_gradient_LDADD = $(top_builddir)/src/libroboptim-core.la +# identity-function +check_PROGRAMS += identity-function +identity_function_SOURCES = identity-function.cc $(COMMON_SOURCES) +identity_function_LDADD = $(top_builddir)/src/libroboptim-core.la + # visualization-gnuplot-simple check_PROGRAMS += visualization-gnuplot-simple visualization_gnuplot_simple_SOURCES = visualization-gnuplot-simple.cc \ diff --git a/tests/identity-function.cc b/tests/identity-function.cc new file mode 100644 index 0000000..2d21636 --- /dev/null +++ b/tests/identity-function.cc @@ -0,0 +1,51 @@ +// Copyright (C) 2009 by Thomas Moulard, AIST, CNRS, INRIA. +// +// This file is part of the roboptim. +// +// roboptim is free software: you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// roboptim is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public License +// along with roboptim. If not, see <http://www.gnu.org/licenses/>. + +#include <iostream> +#include <boost/numeric/ublas/io.hpp> + +#include "common.hh" +#include <roboptim/core/identity-function.hh> + +using namespace roboptim; + +int run_test () +{ + IdentityFunction::vector_t offset (4); + offset[0] = 12.; + offset[1] = 46.; + offset[2] = 2.; + offset[3] = -9.; + + IdentityFunction id (offset); + + IdentityFunction::vector_t x (4); + x.clear (); + + std::cout + << id << std::endl + << "Evaluate: " << std::endl + << id (x) << std::endl + << "Gradient: " << std::endl + << id.gradient (x) << std::endl + << "Jacobian: " << std::endl + << id.jacobian (x) << std::endl; + + return 0; +} + +GENERATE_TEST () diff --git a/tests/identity-function.stdout b/tests/identity-function.stdout new file mode 100644 index 0000000..0956add --- /dev/null +++ b/tests/identity-function.stdout @@ -0,0 +1,9 @@ +Identity function + offset = [4](12,46,2,-9) + +Evaluate: +[4](12,46,2,-9) +Gradient: +[4](1,0,0,0) +Jacobian: +[4,4]((1,0,0,0),(0,1,0,0),(0,0,1,0),(0,0,0,1)) diff --git a/tests/testsuite.at b/tests/testsuite.at index 5289ce6..c35e901 100644 --- a/tests/testsuite.at +++ b/tests/testsuite.at @@ -36,6 +36,7 @@ CHECK_STDOUT([problem-cc], [Check problem copy constructor.]) CHECK_STDOUT([n-times-derivable-function], [Check N times derivable function.]) CHECK_STDOUT([finite-difference-gradient], [Check finite difference gradient.]) CHECK_STDOUT([result], [Check Result class.]) +CHECK_STDOUT([identity-function], [Check identity function class.]) AT_BANNER([Plug-in mechanism]) CHECK_STDOUT([plugin], [Load dummy plug-in dynamically.]) commit 7a527a92bb6f5f7d5a51b20c98a17752940fa1dd Author: Thomas Moulard <tho...@gm...> Date: Fri Jun 12 14:18:48 2009 +0900 Remove Freeze function. * include/Makefile.am: Remove freeze.hh from list. * include/roboptim/core/freeze.hh: Remove. * src/Makefile.am: Remove freeze.cc from list. * src/freeze.cc: Remove. * tests/Makefile.am: Remove test. * tests/freeze.cc: Remove. * tests/freeze.stdout: Remove. * tests/testsuite.at: Remove test. Signed-off-by: Thomas Moulard <tho...@gm...> diff --git a/ChangeLog b/ChangeLog index 0c4fa5d..48739b6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2009-06-12 Thomas Moulard <tho...@gm...> + + Remove Freeze function. + * include/Makefile.am: Remove freeze.hh from list. + * include/roboptim/core/freeze.hh: Remove. + * src/Makefile.am: Remove freeze.cc from list. + * src/freeze.cc: Remove. + * tests/Makefile.am: Remove test. + * tests/freeze.cc: Remove. + * tests/freeze.stdout: Remove. + * tests/testsuite.at: Remove test. + 2009-06-10 Thomas Moulard <tho...@gm...> Synchronize. diff --git a/include/Makefile.am b/include/Makefile.am index b62718d..9656bf1 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -3,7 +3,6 @@ include $(top_srcdir)/build-aux/init.mk # --- Distribute and install headers. nobase_include_HEADERS = \ roboptim/core/derivable-function.hh \ - roboptim/core/freeze.hh \ roboptim/core/function.hh \ roboptim/core/fwd.hh \ roboptim/core/finite-difference-gradient.hh \ diff --git a/include/roboptim/core/freeze.hh b/include/roboptim/core/freeze.hh deleted file mode 100644 index 0e377ab..0000000 --- a/include/roboptim/core/freeze.hh +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright (C) 2009 by Thomas Moulard, AIST, CNRS, INRIA. -// -// This file is part of the roboptim. -// -// roboptim is free software: you can redistribute it and/or modify -// it under the terms of the GNU Lesser General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// roboptim is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with roboptim. If not, see <http://www.gnu.org/licenses/>. - -#ifndef ROBOPTIM_CORE_FREEZE_HH -# define ROBOPTIM_CORE_FREEZE_HH -# include <vector> -# include <utility> - -# include <roboptim/core/fwd.hh> -# include <roboptim/core/derivable-function.hh> -# include <roboptim/core/problem.hh> - -namespace roboptim -{ - /// \addtogroup roboptim_function - /// @{ - - /// \brief Constraint that can be used to force some arguments values. - /// - /// This constraint expects a vector of pairs (argument id, value) to - /// build a function that will freeze the given arguments to their - /// associated value. - /// - /// For instance, the vector: [(0, 5.), (3, -12.)] forces the first - /// parameter to five and the fourth one to minus twelve. - /// - // The expression of this function is: - /// \f[-1 + \sum_{i} (x_i - value_i)^2\f] - /// where \f$i\f$ covers the index list specified by the vector described - /// before, \f$x_i\f$ is i-th value of the input argument and \f$value_i\f$ - /// is this argument's fixed value. - /// - /// Hence, the global minimum of this function is -1 and is reached - /// when the current position matches the frozen position. - class Freeze : public DerivableFunction - { - public: - /// \brief Pair representing an argument index and a value. - typedef std::pair<size_t, value_type> frozenArgument_t; - - /// \brief Vector of pairs (argument index, value). - /// - /// This type define what are the frozen arguments and what their - /// value. - typedef std::vector<frozenArgument_t> frozenArguments_t; - - /// \brief Create the constraint from a vector of pairs. - /// - /// \param size Input size (function argument's size) - /// \param fa Vector of pairs containing what to freeze and to what value. - Freeze (const size_t size, const frozenArguments_t fa) throw (); - - virtual ~Freeze () throw (); - - /// \brief Add itself to an optimization problem. - /// \param pb Problem on which the constraint will be added. - template <typename F, typename C> - void addToProblem (Problem<F, C>& pb) throw () - { - pb.addConstraint (this, Function::makeInterval (-1., -1.)); - } - - protected: - void impl_compute (result_t& res, const argument_t& x) const throw (); - void impl_gradient (gradient_t& grad, const argument_t& x, size_type = 0) - const throw (); - private: - /// \brief Vector which defines how to freeze values. - const frozenArguments_t frozenArguments_; - }; - - /// Example shows freeze use. - /// \example freeze.cc - - /// @} - -} // end of namespace roboptim. - -#endif //! ROBOPTIM_FREEZE_HH diff --git a/src/Makefile.am b/src/Makefile.am index b08b008..f968b13 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -10,7 +10,6 @@ libroboptim_core_la_SOURCES = \ doc.hh \ derivable-function.cc \ finite-difference-gradient.cc \ - freeze.cc \ function.cc \ generic-solver.cc \ indent.cc \ diff --git a/src/freeze.cc b/src/freeze.cc deleted file mode 100644 index dae339f..0000000 --- a/src/freeze.cc +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright (C) 2009 by Thomas Moulard, AIST, CNRS, INRIA. -// -// This file is part of the roboptim. -// -// roboptim is free software: you can redistribute it and/or modify -// it under the terms of the GNU Lesser General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// roboptim is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with roboptim. If not, see <http://www.gnu.org/licenses/>. - -#include <roboptim/core/freeze.hh> - -namespace roboptim -{ - Freeze::Freeze (const size_t size, const frozenArguments_t fa) throw () - : DerivableFunction (size, 1), - frozenArguments_ (fa) - { - // Check that given index id are valid. - typedef frozenArguments_t::const_iterator citer_t; - for (citer_t it = frozenArguments_.begin (); it != frozenArguments_.end (); - ++it) - assert (it->first < size); - } - - Freeze::~Freeze () throw () - { - } - - void - Freeze::impl_compute (result_t& res, const argument_t& x) const throw () - { - res (0) = 0.; - typedef frozenArguments_t::const_iterator citer_t; - for (citer_t it = frozenArguments_.begin (); it != frozenArguments_.end (); - ++it) - res (0) += (x[it->first] - it->second) * (x[it->first] - it->second); - res (0) -= 1; - } - - void - Freeze::impl_gradient (gradient_t& grad, const argument_t& x, size_type i) - const throw () - { - grad.clear (); - typedef frozenArguments_t::const_iterator citer_t; - for (citer_t it = frozenArguments_.begin (); it != frozenArguments_.end (); - ++it) - grad (it->first) += 2 * (x[it->first] - it->second); - } -} // end of namespace roboptim. diff --git a/tests/Makefile.am b/tests/Makefile.am index fd2f2c5..ae715ef 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -30,11 +30,6 @@ check_PROGRAMS += problem-cc problem_cc_SOURCES = problem-cc.cc $(COMMON_SOURCES) problem_cc_LDADD = $(top_builddir)/src/libroboptim-core.la -# freeze -check_PROGRAMS += freeze -freeze_SOURCES = freeze.cc $(COMMON_SOURCES) -freeze_LDADD = $(top_builddir)/src/libroboptim-core.la - # numeric-linear-function check_PROGRAMS += numeric-linear-function numeric_linear_function_SOURCES = numeric-linear-function.cc $(COMMON_SOURCES) diff --git a/tests/freeze.cc b/tests/freeze.cc deleted file mode 100644 index 8829083..0000000 --- a/tests/freeze.cc +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (C) 2009 by Thomas Moulard, AIST, CNRS, INRIA. -// -// This file is part of the roboptim. -// -// roboptim is free software: you can redistribute it and/or modify -// it under the terms of the GNU Lesser General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// roboptim is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with roboptim. If not, see <http://www.gnu.org/licenses/>. - -#include <boost/assign/list_of.hpp> -#include <boost/numeric/ublas/io.hpp> - -#include "common.hh" -#include <roboptim/core/freeze.hh> - -using namespace roboptim; - -int run_test () -{ - using namespace boost::assign; - - // Freeze arguments 1, 2 and 3 (4 arguments in total). - Freeze f (4, list_of <Freeze::frozenArgument_t> (0, 3.) (1, 7.) (2, 0.)); - - // Create an argument vector. - Freeze::vector_t v (4); - v.clear (); - - // Evaluate at frozen point: the result is minimal (i.e. -1). - v[0] = 3., v[1] = 7., v[2] = 0.; - std::cout - << "Value: " << v << std::endl - << "Result: " << f (v) << std::endl; - - - // Evaluate at another point. - v[0] = 8., v[1] = 2., v[2] = 5., v[3] = 666.; - std::cout - << "Value: " << v << std::endl - << "Result: " << f (v) << std::endl; - - return 0; -} - -GENERATE_TEST () diff --git a/tests/freeze.stdout b/tests/freeze.stdout deleted file mode 100644 index a70c6d5..0000000 --- a/tests/freeze.stdout +++ /dev/null @@ -1,4 +0,0 @@ -Value: [4](3,7,0,0) -Result: [1](-1) -Value: [4](8,2,5,666) -Result: [1](74) diff --git a/tests/testsuite.at b/tests/testsuite.at index f42f4e5..5289ce6 100644 --- a/tests/testsuite.at +++ b/tests/testsuite.at @@ -33,7 +33,6 @@ CHECK_STDOUT([numeric-linear-function], [Check numeric linear functions.]) CHECK_STDOUT([numeric-quadratic-function], [Check numeric quadratic functions.]) CHECK_STDOUT([problem-cc], [Check problem copy constructor.]) -CHECK_STDOUT([freeze], [Check freeze constraint.]) CHECK_STDOUT([n-times-derivable-function], [Check N times derivable function.]) CHECK_STDOUT([finite-difference-gradient], [Check finite difference gradient.]) CHECK_STDOUT([result], [Check Result class.]) ----------------------------------------------------------------------- Summary of changes: ChangeLog | 23 +++++ include/Makefile.am | 1 - include/roboptim/core/freeze.hh | 93 -------------------- ...ric-linear-function.hh => identity-function.hh} | 34 +++---- src/Makefile.am | 2 +- src/freeze.cc | 58 ------------ ...ric-linear-function.cc => identity-function.cc} | 45 ++++----- tests/Makefile.am | 10 +- tests/freeze.cc | 53 ----------- tests/freeze.stdout | 4 - ...tion-gnuplot-simple.cc => identity-function.cc} | 33 ++++--- tests/identity-function.stdout | 9 ++ tests/testsuite.at | 2 +- 13 files changed, 93 insertions(+), 274 deletions(-) delete mode 100644 include/roboptim/core/freeze.hh copy include/roboptim/core/{numeric-linear-function.hh => identity-function.hh} (64%) delete mode 100644 src/freeze.cc copy src/{numeric-linear-function.cc => identity-function.cc} (54%) delete mode 100644 tests/freeze.cc delete mode 100644 tests/freeze.stdout copy tests/{visualization-gnuplot-simple.cc => identity-function.cc} (63%) create mode 100644 tests/identity-function.stdout hooks/post-receive -- roboptim |
From: Thomas M. <tho...@us...> - 2009-06-11 07:42:41
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "roboptim". The branch, core-ipopt-plugin has been updated via b69e1fbf48dbbf24421060ff964d7a5f198e4f15 (commit) from 040d5266b7826d406d620da14310a149ba15e6d8 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit b69e1fbf48dbbf24421060ff964d7a5f198e4f15 Author: Thomas Moulard <tho...@gm...> Date: Thu Jun 11 16:40:56 2009 +0900 Fix build-chain when headers are in non-standard directories. * src/Makefile.am, * tests/Makefile.am: Add ROBOPTIMCORE_CFLAGS to CPPFLAGS. Signed-off-by: Thomas Moulard <tho...@gm...> diff --git a/ChangeLog b/ChangeLog index 7207f15..21e334f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2009-06-11 Thomas Moulard <tho...@gm...> + + Fix build-chain when headers are in non-standard directories. + * src/Makefile.am, + * tests/Makefile.am: Add ROBOPTIMCORE_CFLAGS to CPPFLAGS. + 2009-06-10 Thomas Moulard <tho...@gm...> Synchronize. diff --git a/src/Makefile.am b/src/Makefile.am index 5151377..1a6c29b 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,5 +1,8 @@ include $(top_srcdir)/build-aux/init.mk +# Add RobOptim flags. +AM_CPPFLAGS += $(ROBOPTIMCORE_CFLAGS) + # Add available warnings flags. AM_CXXFLAGS += $(WARNING_CXXFLAGS) diff --git a/tests/Makefile.am b/tests/Makefile.am index 40577b2..7747953 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -1,6 +1,9 @@ include $(top_srcdir)/build-aux/init.mk include $(top_srcdir)/build-aux/autotest.mk +# Add RobOptim flags. +AM_CPPFLAGS += $(ROBOPTIMCORE_CFLAGS) + # Add available warnings flags. AM_CXXFLAGS += $(WARNING_CXXFLAGS) ----------------------------------------------------------------------- Summary of changes: ChangeLog | 6 ++++++ src/Makefile.am | 3 +++ tests/Makefile.am | 3 +++ 3 files changed, 12 insertions(+), 0 deletions(-) hooks/post-receive -- roboptim |
From: Thomas M. <tho...@us...> - 2009-06-10 11:29:24
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "roboptim". The branch, web has been updated via 3a9927ec05d115d501f32eb07bddbfc574a4de3a (commit) from e896d72a9e05e6dc727ac766d453ec8d88cc1377 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 3a9927ec05d115d501f32eb07bddbfc574a4de3a Author: Thomas Moulard <tho...@gm...> Date: Wed Jun 10 20:28:49 2009 +0900 Fix plug-in's documentation links. * htdocs/index.html: Update links. Signed-off-by: Thomas Moulard <tho...@gm...> diff --git a/ChangeLog b/ChangeLog index 3d6585a..5274081 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2009-06-10 Thomas Moulard <tho...@gm...> + Fix plug-in's documentation links. + * htdocs/index.html: Update links. + +2009-06-10 Thomas Moulard <tho...@gm...> + Add link to commit mailing-list and Git web broser. * htdocs/index.html: Here. diff --git a/htdocs/index.html b/htdocs/index.html index eb2fdbd..a9fd982 100644 --- a/htdocs/index.html +++ b/htdocs/index.html @@ -76,7 +76,7 @@ <ul> <li><a href="doc/core-plugin/ipopt/0.2/">HTML (0.2)</a></li> - <li><a href="doc/core-plugin/ipopt/HEAD/">HTML + <li><a href="doc/core-ipopt-plugin/HEAD/">HTML (development version)</a></li> </ul> </li> @@ -84,7 +84,7 @@ <ul> <li><a href="doc/core-plugin/cfsqp/0.2/">HTML (0.2)</a></li> - <li><a href="doc/core-plugin/cfsqp/HEAD/">HTML + <li><a href="doc/core-cfsqp-plugin/HEAD/">HTML (development version)</a></li> </ul> </li> ----------------------------------------------------------------------- Summary of changes: ChangeLog | 5 +++++ htdocs/index.html | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) hooks/post-receive -- roboptim |
From: Thomas M. <tho...@us...> - 2009-06-10 10:13:34
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "roboptim". The branch, core-ipopt-plugin has been updated via 040d5266b7826d406d620da14310a149ba15e6d8 (commit) from 54ab3abf6abc7627d94aa3d5a29e4943355041fc (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 040d5266b7826d406d620da14310a149ba15e6d8 Author: Thomas Moulard <tho...@gm...> Date: Wed Jun 10 19:13:00 2009 +0900 Synchronize. * doc/sf-upload.sh.in: Here. Signed-off-by: Thomas Moulard <tho...@gm...> diff --git a/ChangeLog b/ChangeLog index a1df730..7207f15 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,11 @@ 2009-06-10 Thomas Moulard <tho...@gm...> Synchronize. + * doc/sf-upload.sh.in: Here. + +2009-06-10 Thomas Moulard <tho...@gm...> + + Synchronize. * build-aux/boost.m4: New. * build-aux/deb.mk: New. * build-aux/doxygen.m4: New. diff --git a/doc/sf-upload.sh.in b/doc/sf-upload.sh.in index a54ed34..ffdbb15 100644 --- a/doc/sf-upload.sh.in +++ b/doc/sf-upload.sh.in @@ -38,7 +38,8 @@ fi rsync_cmd="$rsync -avP -e ssh" localdir="@abs_top_builddir@/doc/html/" -remotedir="htdocs/doc/@PACKAGE_TARNAME@/$VERSION" +pkgname=$(echo '@PACKAGE_TARNAME@' | sed 's|^roboptim-||') +remotedir="htdocs/doc/$pkgname/$VERSION" rsync_loghost="$SF_USERNAME,rob...@we...:" echo "Fixing local rights."; @@ -48,8 +49,6 @@ find "$localdir" -type f -print0 | xargs -0 chmod 644 echo "Uploading documentation to SourceForge server."; $rsync_cmd "$localdir" "$rsync_loghost$remotedir" -#echo "Fixing documentation rights."; -#echo "cd \"$remotedir\"; chmod 644 *" | $rsync_cmd "$rsync_loghost$remotedir" ret="$?"; if test 0 -eq "$ret"; then echo "Done. Exiting"; ----------------------------------------------------------------------- Summary of changes: ChangeLog | 5 +++++ doc/sf-upload.sh.in | 5 ++--- 2 files changed, 7 insertions(+), 3 deletions(-) hooks/post-receive -- roboptim |
From: Thomas M. <tho...@us...> - 2009-06-10 10:11:08
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "roboptim". The branch, trajectory has been updated via 11e541a0e8924b13c22b62a911ff90dcff9490b6 (commit) from 45e922d711617be94758c6ab235c98262df09d49 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 11e541a0e8924b13c22b62a911ff90dcff9490b6 Author: Thomas Moulard <tho...@gm...> Date: Wed Jun 10 19:10:38 2009 +0900 Synchronize. * doc/sf-upload.sh.in: Here. Signed-off-by: Thomas Moulard <tho...@gm...> diff --git a/ChangeLog b/ChangeLog index 280bc66..91f8d73 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2009-06-10 Thomas Moulard <tho...@gm...> + Synchronize. + * doc/sf-upload.sh.in: Here. + +2009-06-10 Thomas Moulard <tho...@gm...> + Synchronize with share. * build-aux/boost.m4, * build-aux/deb.mk: Synchronize. diff --git a/doc/sf-upload.sh.in b/doc/sf-upload.sh.in index 62f902b..ffdbb15 100644 --- a/doc/sf-upload.sh.in +++ b/doc/sf-upload.sh.in @@ -49,8 +49,6 @@ find "$localdir" -type f -print0 | xargs -0 chmod 644 echo "Uploading documentation to SourceForge server."; $rsync_cmd "$localdir" "$rsync_loghost$remotedir" -#echo "Fixing documentation rights."; -#echo "cd \"$remotedir\"; chmod 644 *" | $rsync_cmd "$rsync_loghost$remotedir" ret="$?"; if test 0 -eq "$ret"; then echo "Done. Exiting"; ----------------------------------------------------------------------- Summary of changes: ChangeLog | 5 +++++ doc/sf-upload.sh.in | 2 -- 2 files changed, 5 insertions(+), 2 deletions(-) hooks/post-receive -- roboptim |
From: Thomas M. <tho...@us...> - 2009-06-10 10:10:26
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "roboptim". The branch, core has been updated via 137cebd0bd76cf06185de30917873875e0ff17b9 (commit) from 2331fd79c977c584ba2656529e2527c16561a8e2 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 137cebd0bd76cf06185de30917873875e0ff17b9 Author: Thomas Moulard <tho...@gm...> Date: Wed Jun 10 19:09:58 2009 +0900 Synchronize. * doc/sf-upload.sh.in: Here. Signed-off-by: Thomas Moulard <tho...@gm...> diff --git a/ChangeLog b/ChangeLog index 5a98f0e..0c4fa5d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,11 @@ 2009-06-10 Thomas Moulard <tho...@gm...> + Synchronize. + * doc/sf-upload.sh.in: Here. + +2009-06-10 Thomas Moulard <tho...@gm...> + Use new pkg-config rules. * Makefile.am: Here. diff --git a/doc/sf-upload.sh.in b/doc/sf-upload.sh.in index 62f902b..ffdbb15 100644 --- a/doc/sf-upload.sh.in +++ b/doc/sf-upload.sh.in @@ -49,8 +49,6 @@ find "$localdir" -type f -print0 | xargs -0 chmod 644 echo "Uploading documentation to SourceForge server."; $rsync_cmd "$localdir" "$rsync_loghost$remotedir" -#echo "Fixing documentation rights."; -#echo "cd \"$remotedir\"; chmod 644 *" | $rsync_cmd "$rsync_loghost$remotedir" ret="$?"; if test 0 -eq "$ret"; then echo "Done. Exiting"; ----------------------------------------------------------------------- Summary of changes: ChangeLog | 5 +++++ doc/sf-upload.sh.in | 2 -- 2 files changed, 5 insertions(+), 2 deletions(-) hooks/post-receive -- roboptim |
From: Thomas M. <tho...@us...> - 2009-06-10 10:09:46
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "roboptim". The branch, share has been updated via b458a86d5d1b1805fc6074ffb0fdee8c5324ed11 (commit) from c4fa250fdaae35bf3763058ebac81633caa420b7 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit b458a86d5d1b1805fc6074ffb0fdee8c5324ed11 Author: Thomas Moulard <tho...@gm...> Date: Wed Jun 10 19:08:48 2009 +0900 Remove comment and fix remodir computation. * doc/sf-upload.sh.in: Here. Signed-off-by: Thomas Moulard <tho...@gm...> diff --git a/ChangeLog b/ChangeLog index e24211e..e6c5f7b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2009-06-10 Thomas Moulard <tho...@gm...> + Remove comment and fix remodir computation. + * doc/sf-upload.sh.in: Here. + +2009-06-10 Thomas Moulard <tho...@gm...> + Fix remotedir computation in SF upload script. * doc/sf-upload.sh.in: Here. diff --git a/doc/sf-upload.sh.in b/doc/sf-upload.sh.in index a54ed34..ffdbb15 100644 --- a/doc/sf-upload.sh.in +++ b/doc/sf-upload.sh.in @@ -38,7 +38,8 @@ fi rsync_cmd="$rsync -avP -e ssh" localdir="@abs_top_builddir@/doc/html/" -remotedir="htdocs/doc/@PACKAGE_TARNAME@/$VERSION" +pkgname=$(echo '@PACKAGE_TARNAME@' | sed 's|^roboptim-||') +remotedir="htdocs/doc/$pkgname/$VERSION" rsync_loghost="$SF_USERNAME,rob...@we...:" echo "Fixing local rights."; @@ -48,8 +49,6 @@ find "$localdir" -type f -print0 | xargs -0 chmod 644 echo "Uploading documentation to SourceForge server."; $rsync_cmd "$localdir" "$rsync_loghost$remotedir" -#echo "Fixing documentation rights."; -#echo "cd \"$remotedir\"; chmod 644 *" | $rsync_cmd "$rsync_loghost$remotedir" ret="$?"; if test 0 -eq "$ret"; then echo "Done. Exiting"; ----------------------------------------------------------------------- Summary of changes: ChangeLog | 5 +++++ doc/sf-upload.sh.in | 5 ++--- 2 files changed, 7 insertions(+), 3 deletions(-) hooks/post-receive -- roboptim |
From: Thomas M. <tho...@us...> - 2009-06-10 10:04:22
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "roboptim". The branch, core-ipopt-plugin has been updated via 54ab3abf6abc7627d94aa3d5a29e4943355041fc (commit) from 46894d092f0008c6c1a55840b746ac420158a377 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 54ab3abf6abc7627d94aa3d5a29e4943355041fc Author: Thomas Moulard <tho...@gm...> Date: Wed Jun 10 19:03:24 2009 +0900 Synchronize. * build-aux/boost.m4: New. * build-aux/deb.mk: New. * build-aux/doxygen.m4: New. * build-aux/ebuild.mk: New. * build-aux/init.mk: Synchronize. * build-aux/move-if-change: New. * build-aux/pkg-config.mk: New. * build-aux/pkg-config.pc.in: New. * build-aux/rpm.mk: New. * configure.ac, * doc/Doxyfile.in, * doc/Makefile.am, * doc/sf-upload.sh.in: Synchronize. Signed-off-by: Thomas Moulard <tho...@gm...> diff --git a/ChangeLog b/ChangeLog index ceed503..a1df730 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,20 @@ +2009-06-10 Thomas Moulard <tho...@gm...> + + Synchronize. + * build-aux/boost.m4: New. + * build-aux/deb.mk: New. + * build-aux/doxygen.m4: New. + * build-aux/ebuild.mk: New. + * build-aux/init.mk: Synchronize. + * build-aux/move-if-change: New. + * build-aux/pkg-config.mk: New. + * build-aux/pkg-config.pc.in: New. + * build-aux/rpm.mk: New. + * configure.ac, + * doc/Doxyfile.in, + * doc/Makefile.am, + * doc/sf-upload.sh.in: Synchronize. + 2009-06-08 Thomas Moulard <tho...@gm...> Update to new interface. diff --git a/build-aux/boost.m4 b/build-aux/boost.m4 new file mode 100644 index 0000000..a9fc46c --- /dev/null +++ b/build-aux/boost.m4 @@ -0,0 +1,933 @@ +# boost.m4: Locate Boost headers and libraries for autoconf-based projects. +# Copyright (C) 2007, 2008, 2009 Benoit Sigoure <ts...@lr...> +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# Additional permission under section 7 of the GNU General Public +# License, version 3 ("GPLv3"): +# +# If you convey this file as part of a work that contains a +# configuration script generated by Autoconf, you may do so under +# terms of your choice. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +# serial 10 +# Original sources can be found at http://repo.or.cz/w/boost.m4.git +# You can fetch the latest version of the script by doing: +# wget 'http://repo.or.cz/w/boost.m4.git?a=blob_plain;f=build-aux/boost.m4;hb=HEAD' -O boost.m4 + +# ------ # +# README # +# ------ # + +# This file provides several macros to use the various Boost libraries. +# The first macro is BOOST_REQUIRE. It will simply check if it's possible to +# find the Boost headers of a given (optional) minimum version and it will +# define BOOST_CPPFLAGS accordingly. It will add an option --with-boost to +# your configure so that users can specify non standard locations. +# If the user's environment contains BOOST_ROOT and --with-boost was not +# specified, --with-boost=$BOOST_ROOT is implicitly used. +# For more README and documentation, go to http://repo.or.cz/w/boost.m4.git +# Note: THESE MACROS ASSUME THAT YOU USE LIBTOOL. If you don't, don't worry, +# simply read the README, it will show you what to do step by step. + +m4_pattern_forbid([^_?BOOST_]) + + +# _BOOST_SED_CPP(SED-PROGRAM, PROGRAM, +# [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) +# -------------------------------------------------------- +# Same as AC_EGREP_CPP, but leave the result in conftest.i. +# PATTERN is *not* overquoted, as in AC_EGREP_CPP. It could be useful +# to turn this into a macro which extracts the value of any macro. +m4_define([_BOOST_SED_CPP], +[AC_LANG_PREPROC_REQUIRE()dnl +AC_REQUIRE([AC_PROG_SED])dnl +AC_LANG_CONFTEST([AC_LANG_SOURCE([[$2]])]) +AS_IF([dnl eval is necessary to expand ac_cpp. +dnl Ultrix and Pyramid sh refuse to redirect output of eval, so use subshell. +(eval "$ac_cpp conftest.$ac_ext") 2>&AS_MESSAGE_LOG_FD | + $SED -n -e "$1" >conftest.i 2>&1], + [$3], + [$4])dnl +rm -f conftest* +])# AC_EGREP_CPP + + + +# BOOST_REQUIRE([VERSION]) +# ------------------------ +# Look for Boost. If version is given, it must either be a literal of the form +# "X.Y.Z" where X, Y and Z are integers (the ".Z" part being optional) or a +# variable "$var". +# Defines the value BOOST_CPPFLAGS. This macro only checks for headers with +# the required version, it does not check for any of the Boost libraries. +# FIXME: Add a 2nd optional argument so that it's not fatal if Boost isn't found +# and add an AC_DEFINE to tell whether HAVE_BOOST. +AC_DEFUN([BOOST_REQUIRE], +[boost_save_IFS=$IFS +boost_version_req="$1" +IFS=. +set x $boost_version_req 0 0 0 +IFS=$boost_save_IFS +shift +boost_version_req=`expr "$[1]" '*' 100000 + "$[2]" '*' 100 + "$[3]"` +AC_ARG_WITH([boost], + [AS_HELP_STRING([--with-boost=DIR], + [prefix of Boost $1 @<:@guess@:>@])])dnl +AC_ARG_VAR([BOOST_ROOT],[Location of Boost installation])dnl +# If BOOST_ROOT is set and the user has not provided a value to +# --with-boost, then treat BOOST_ROOT as if it the user supplied it. +if test x"$BOOST_ROOT" != x; then + if test x"$with_boost" = x; then + AC_MSG_NOTICE([Detected BOOST_ROOT; continuing with --with-boost=$BOOST_ROOT]) + with_boost=$BOOST_ROOT + else + AC_MSG_NOTICE([Detected BOOST_ROOT=$BOOST_ROOT, but overridden by --with-boost=$with_boost]) + fi +fi +AC_SUBST([DISTCHECK_CONFIGURE_FLAGS], + ["$DISTCHECK_CONFIGURE_FLAGS '--with-boost=$with_boost'"]) +boost_save_CPPFLAGS=$CPPFLAGS + AC_CACHE_CHECK([for Boost headers version >= $boost_version_req], + [boost_cv_inc_path], + [boost_cv_inc_path=no +AC_LANG_PUSH([C++])dnl +m4_pattern_allow([^BOOST_VERSION$])dnl + AC_LANG_CONFTEST([AC_LANG_PROGRAM([[#include <boost/version.hpp> +#if !defined BOOST_VERSION +# error BOOST_VERSION is not defined +#elif BOOST_VERSION < $boost_version_req +# error Boost headers version < $boost_version_req +#endif +]])]) + # If the user provided a value to --with-boost, use it and only it. + case $with_boost in #( + ''|yes) set x '' /opt/local/include /usr/local/include /opt/include \ + /usr/include C:/Boost/include;; #( + *) set x "$with_boost/include" "$with_boost";; + esac + shift + for boost_dir + do + # Without --layout=system, Boost (or at least some versions) installs + # itself in <prefix>/include/boost-<version>. This inner loop helps to + # find headers in such directories. + # I didn't indent this loop on purpose (to avoid over-indented code) + for boost_inc in "$boost_dir" "$boost_dir"/boost-* + do + test x"$boost_inc" != x && CPPFLAGS="$CPPFLAGS -I$boost_inc" + AC_COMPILE_IFELSE([], [boost_cv_inc_path=yes], [boost_cv_version=no]) + if test x"$boost_cv_inc_path" = xyes; then + if test x"$boost_inc" != x; then + boost_cv_inc_path=$boost_inc + fi + break 2 + fi + done + done +AC_LANG_POP([C++])dnl + ]) + case $boost_cv_inc_path in #( + no) AC_MSG_ERROR([cannot find Boost headers version >= $boost_version_req]);;#( + yes) BOOST_CPPFLAGS=;;#( + *) AC_SUBST([BOOST_CPPFLAGS], ["-I$boost_cv_inc_path"]);; + esac + AC_CACHE_CHECK([for Boost's header version], + [boost_cv_lib_version], + [m4_pattern_allow([^BOOST_LIB_VERSION$])dnl + _BOOST_SED_CPP([/^boost-lib-version = /{s///;s/\"//g;p;g;}], + [#include <boost/version.hpp> +boost-lib-version = BOOST_LIB_VERSION], + [boost_cv_lib_version=`cat conftest.i`])]) + # e.g. "134" for 1_34_1 or "135" for 1_35 + boost_major_version=`echo "$boost_cv_lib_version" | sed 's/_//;s/_.*//'` + case $boost_major_version in #( + '' | *[[!0-9]]*) + AC_MSG_ERROR([Invalid value: boost_major_version=$boost_major_version]) + ;; + esac +CPPFLAGS=$boost_save_CPPFLAGS +])# BOOST_REQUIRE + +# BOOST_STATIC() +# -------------- +# Add the "--enable-static-boost" configure argument. If this argument is given +# on the command line, static versions of the libraries will be looked up. +AC_DEFUN([BOOST_STATIC], + [AC_ARG_ENABLE([static-boost], + [AC_HELP_STRING([--enable-static-boost], + [Prefer the static boost libraries over the shared ones [no]])], + [enable_static_boost=yes], + [enable_static_boost=no])])# BOOST_STATIC + +# BOOST_FIND_HEADER([HEADER-NAME], [ACTION-IF-NOT-FOUND], [ACTION-IF-FOUND]) +# -------------------------------------------------------------------------- +# Wrapper around AC_CHECK_HEADER for Boost headers. Useful to check for +# some parts of the Boost library which are only made of headers and don't +# require linking (such as Boost.Foreach). +# +# Default ACTION-IF-NOT-FOUND: Fail with a fatal error. +# +# Default ACTION-IF-FOUND: define the preprocessor symbol HAVE_<HEADER-NAME> in +# case of success # (where HEADER-NAME is written LIKE_THIS, e.g., +# HAVE_BOOST_FOREACH_HPP). +AC_DEFUN([BOOST_FIND_HEADER], +[AC_REQUIRE([BOOST_REQUIRE])dnl +AC_LANG_PUSH([C++])dnl +boost_save_CPPFLAGS=$CPPFLAGS +CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS" +AC_CHECK_HEADER([$1], + [m4_default([$3], [AC_DEFINE(AS_TR_CPP([HAVE_$1]), [1], + [Define to 1 if you have <$1>])])], + [m4_default([$2], [AC_MSG_ERROR([cannot find $1])])]) +CPPFLAGS=$boost_save_CPPFLAGS +AC_LANG_POP([C++])dnl +])# BOOST_FIND_HEADER + + +# BOOST_FIND_LIB([LIB-NAME], [PREFERRED-RT-OPT], [HEADER-NAME], [CXX-TEST], +# [CXX-PROLOGUE]) +# ------------------------------------------------------------------------- +# Look for the Boost library LIB-NAME (e.g., LIB-NAME = `thread', for +# libboost_thread). Check that HEADER-NAME works and check that +# libboost_LIB-NAME can link with the code CXX-TEST. The optional argument +# CXX-PROLOGUE can be used to include some C++ code before the `main' +# function. +# +# Invokes BOOST_FIND_HEADER([HEADER-NAME]) (see above). +# +# Boost libraries typically come compiled with several flavors (with different +# runtime options) so PREFERRED-RT-OPT is the preferred suffix. A suffix is one +# or more of the following letters: sgdpn (in that order). s = static +# runtime, d = debug build, g = debug/diagnostic runtime, p = STLPort build, +# n = (unsure) STLPort build without iostreams from STLPort (it looks like `n' +# must always be used along with `p'). Additionally, PREFERRED-RT-OPT can +# start with `mt-' to indicate that there is a preference for multi-thread +# builds. Some sample values for PREFERRED-RT-OPT: (nothing), mt, d, mt-d, gdp +# ... If you want to make sure you have a specific version of Boost +# (eg, >= 1.33) you *must* invoke BOOST_REQUIRE before this macro. +AC_DEFUN([BOOST_FIND_LIB], +[AC_REQUIRE([_BOOST_FIND_COMPILER_TAG])dnl +AC_REQUIRE([BOOST_REQUIRE])dnl +AC_REQUIRE([BOOST_STATIC])dnl +AC_REQUIRE([_BOOST_GUESS_WHETHER_TO_USE_MT])dnl +AC_LANG_PUSH([C++])dnl +AS_VAR_PUSHDEF([Boost_lib], [boost_cv_lib_$1])dnl +AS_VAR_PUSHDEF([Boost_lib_LDFLAGS], [boost_cv_lib_$1_LDFLAGS])dnl +AS_VAR_PUSHDEF([Boost_lib_LIBS], [boost_cv_lib_$1_LIBS])dnl +BOOST_FIND_HEADER([$3]) +boost_save_CPPFLAGS=$CPPFLAGS +CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS" +# Now let's try to find the library. The algorithm is as follows: first look +# for a given library name according to the user's PREFERRED-RT-OPT. For each +# library name, we prefer to use the ones that carry the tag (toolset name). +# Each library is searched through the various standard paths were Boost is +# usually installed. If we can't find the standard variants, we try to +# enforce -mt (for instance on MacOSX, libboost_threads.dylib doesn't exist +# but there's -obviously- libboost_threads-mt.dylib). +AC_CACHE_CHECK([for the Boost $1 library], [Boost_lib], + [Boost_lib=no + case "$2" in #( + mt | mt-) boost_mt=-mt; boost_rtopt=;; #( + mt* | mt-*) boost_mt=-mt; boost_rtopt=`expr "X$2" : 'Xmt-*\(.*\)'`;; #( + *) boost_mt=; boost_rtopt=$2;; + esac + if test $enable_static_boost = yes; then + boost_rtopt="s$boost_rtopt" + fi + # Find the proper debug variant depending on what we've been asked to find. + case $boost_rtopt in #( + *d*) boost_rt_d=$boost_rtopt;; #( + *[[sgpn]]*) # Insert the `d' at the right place (in between `sg' and `pn') + boost_rt_d=`echo "$boost_rtopt" | sed 's/\(s*g*\)\(p*n*\)/\1\2/'`;; #( + *) boost_rt_d='-d';; + esac + # If the PREFERRED-RT-OPT are not empty, prepend a `-'. + test -n "$boost_rtopt" && boost_rtopt="-$boost_rtopt" + $boost_guess_use_mt && boost_mt=-mt + # Look for the abs path the static archive. + # $libext is computed by Libtool but let's make sure it's non empty. + test -z "$libext" && + AC_MSG_ERROR([the libext variable is empty, did you invoke Libtool?]) + boost_save_ac_objext=$ac_objext + # Generate the test file. + AC_LANG_CONFTEST([AC_LANG_PROGRAM([#include <$3> +$5], [$4])]) +dnl Optimization hacks: compiling C++ is slow, especially with Boost. What +dnl we're trying to do here is guess the right combination of link flags +dnl (LIBS / LDFLAGS) to use a given library. This can take several +dnl iterations before it succeeds and is thus *very* slow. So what we do +dnl instead is that we compile the code first (and thus get an object file, +dnl typically conftest.o). Then we try various combinations of link flags +dnl until we succeed to link conftest.o in an executable. The problem is +dnl that the various TRY_LINK / COMPILE_IFELSE macros of Autoconf always +dnl remove all the temporary files including conftest.o. So the trick here +dnl is to temporarily change the value of ac_objext so that conftest.o is +dnl preserved accross tests. This is obviously fragile and I will burn in +dnl hell for not respecting Autoconf's documented interfaces, but in the +dnl mean time, it optimizes the macro by a factor of 5 to 30. +dnl Another small optimization: the first argument of AC_COMPILE_IFELSE left +dnl empty because the test file is generated only once above (before we +dnl start the for loops). + AC_COMPILE_IFELSE([], + [ac_objext=do_not_rm_me_plz], + [AC_MSG_ERROR([Cannot compile a test that uses Boost $1])]) + ac_objext=$boost_save_ac_objext + boost_failed_libs= +# Don't bother to ident the 6 nested for loops, only the 2 innermost ones +# matter. +for boost_tag_ in -$boost_cv_lib_tag ''; do +for boost_ver_ in -$boost_cv_lib_version ''; do +for boost_mt_ in $boost_mt -mt ''; do +for boost_rtopt_ in $boost_rtopt '' -d; do + for boost_lib in \ + boost_$1$boost_tag_$boost_mt_$boost_rtopt_$boost_ver_ \ + boost_$1$boost_tag_$boost_rtopt_$boost_ver_ \ + boost_$1$boost_tag_$boost_mt_$boost_ver_ \ + boost_$1$boost_tag_$boost_ver_ + do + # Avoid testing twice the same lib + case $boost_failed_libs in #( + *@$boost_lib@*) continue;; + esac + # If with_boost is empty, we'll search in /lib first, which is not quite + # right so instead we'll try to a location based on where the headers are. + boost_tmp_lib=$with_boost + test x"$with_boost" = x && boost_tmp_lib=${boost_cv_inc_path%/include} + for boost_ldpath in "$boost_tmp_lib/lib" '' \ + /opt/local/lib /usr/local/lib /opt/lib /usr/lib \ + "$with_boost" C:/Boost/lib /lib /usr/lib64 /lib64 + do + test -e "$boost_ldpath" || continue + boost_save_LDFLAGS=$LDFLAGS + # Are we looking for a static library? + case $boost_ldpath:$boost_rtopt_ in #( + *?*:*s*) # Yes (Non empty boost_ldpath + s in rt opt) + Boost_lib_LIBS="$boost_ldpath/lib$boost_lib.$libext" + test -e "$Boost_lib_LIBS" || continue;; #( + *) # No: use -lboost_foo to find the shared library. + Boost_lib_LIBS="-l$boost_lib";; + esac + boost_save_LIBS=$LIBS + LIBS="$Boost_lib_LIBS $LIBS" + test x"$boost_ldpath" != x && LDFLAGS="$LDFLAGS -L$boost_ldpath" +dnl First argument of AC_LINK_IFELSE left empty because the test file is +dnl generated only once above (before we start the for loops). + _BOOST_AC_LINK_IFELSE([], + [Boost_lib=yes], [Boost_lib=no]) + ac_objext=$boost_save_ac_objext + LDFLAGS=$boost_save_LDFLAGS + LIBS=$boost_save_LIBS + if test x"$Boost_lib" = xyes; then + Boost_lib_LDFLAGS="-L$boost_ldpath -R$boost_ldpath" + break 6 + else + boost_failed_libs="$boost_failed_libs@$boost_lib@" + fi + done + done +done +done +done +done +rm -f conftest.$ac_objext +]) +case $Boost_lib in #( + no) AC_MSG_ERROR([Could not find the flags to link with Boost $1]) + ;; +esac +AC_SUBST(AS_TR_CPP([BOOST_$1_LDFLAGS]), [$Boost_lib_LDFLAGS]) +AC_SUBST(AS_TR_CPP([BOOST_$1_LIBS]), [$Boost_lib_LIBS]) +CPPFLAGS=$boost_save_CPPFLAGS +AS_VAR_POPDEF([Boost_lib])dnl +AS_VAR_POPDEF([Boost_lib_LDFLAGS])dnl +AS_VAR_POPDEF([Boost_lib_LIBS])dnl +AC_LANG_POP([C++])dnl +])# BOOST_FIND_LIB + + +# --------------------------------------- # +# Checks for the various Boost libraries. # +# --------------------------------------- # + +# List of boost libraries: http://www.boost.org/libs/libraries.htm +# The page http://beta.boost.org/doc/libs is useful: it gives the first release +# version of each library (among other things). + + +# BOOST_ASIO() +# ------------ +# Look for Boost.Asio (new in Boost 1.35). +AC_DEFUN([BOOST_ASIO], +[AC_REQUIRE([BOOST_SYSTEM])dnl +BOOST_FIND_HEADER([boost/asio.hpp])]) + + +# BOOST_BIND() +# ------------ +# Look for Boost.Bind +AC_DEFUN([BOOST_BIND], +[BOOST_FIND_HEADER([boost/bind.hpp])]) + + +# BOOST_CONVERSION() +# ------------------ +# Look for Boost.Conversion (cast / lexical_cast) +AC_DEFUN([BOOST_CONVERSION], +[BOOST_FIND_HEADER([boost/cast.hpp]) +BOOST_FIND_HEADER([boost/lexical_cast.hpp]) +])# BOOST_CONVERSION + + +# BOOST_DATE_TIME([PREFERRED-RT-OPT]) +# ----------------------------------- +# Look for Boost.Date_Time. For the documentation of PREFERRED-RT-OPT, see the +# documentation of BOOST_FIND_LIB above. +AC_DEFUN([BOOST_DATE_TIME], +[BOOST_FIND_LIB([date_time], [$1], + [boost/date_time/posix_time/posix_time.hpp], + [boost::posix_time::ptime t;]) +])# BOOST_DATE_TIME + + +# BOOST_FILESYSTEM([PREFERRED-RT-OPT]) +# ------------------------------------ +# Look for Boost.Filesystem. For the documentation of PREFERRED-RT-OPT, see +# the documentation of BOOST_FIND_LIB above. +# Do not check for boost/filesystem.hpp because this file was introduced in +# 1.34. +AC_DEFUN([BOOST_FILESYSTEM], +[# Do we have to check for Boost.System? This link-time dependency was +# added as of 1.35.0. If we have a version <1.35, we must not attempt to +# find Boost.System as it didn't exist by then. +if test $boost_major_version -ge 135; then +BOOST_SYSTEM([$1]) +fi # end of the Boost.System check. +boost_filesystem_save_LIBS=$LIBS +boost_filesystem_save_LDFLAGS=$LDFLAGS +m4_pattern_allow([^BOOST_SYSTEM_(LIBS|LDFLAGS)$])dnl +LIBS="$LIBS $BOOST_SYSTEM_LIBS" +LDFLAGS="$LDFLAGS $BOOST_SYSTEM_LDFLAGS" +BOOST_FIND_LIB([filesystem], [$1], + [boost/filesystem/path.hpp], [boost::filesystem::path p;]) +LIBS=$boost_filesystem_save_LIBS +LDFLAGS=$boost_filesystem_save_LDFLAGS +])# BOOST_FILESYSTEM + + +# BOOST_FOREACH() +# --------------- +# Look for Boost.Foreach +AC_DEFUN([BOOST_FOREACH], +[BOOST_FIND_HEADER([boost/foreach.hpp])]) + + +# BOOST_FORMAT() +# -------------- +# Look for Boost.Format +# Note: we can't check for boost/format/format_fwd.hpp because the header isn't +# standalone. It can't be compiled because it triggers the following error: +# boost/format/detail/config_macros.hpp:88: error: 'locale' in namespace 'std' +# does not name a type +AC_DEFUN([BOOST_FORMAT], +[BOOST_FIND_HEADER([boost/format.hpp])]) + + +# BOOST_FUNCTION() +# ---------------- +# Look for Boost.Function +AC_DEFUN([BOOST_FUNCTION], +[BOOST_FIND_HEADER([boost/function.hpp])]) + + +# BOOST_FUSTION() +# ---------------- +# Look for Boost.Fusion +AC_DEFUN([BOOST_FUSION], +[BOOST_FIND_HEADER([boost/fusion/include/vector.hpp])]) + + +# BOOST_GRAPH([PREFERRED-RT-OPT]) +# ------------------------------- +# Look for Boost.Graphs. For the documentation of PREFERRED-RT-OPT, see the +# documentation of BOOST_FIND_LIB above. +AC_DEFUN([BOOST_GRAPH], +[BOOST_FIND_LIB([graph], [$1], + [boost/graph/adjacency_list.hpp], [boost::adjacency_list<> g;]) +])# BOOST_GRAPH + + +# BOOST_IOSTREAMS([PREFERRED-RT-OPT]) +# ------------------------------- +# Look for Boost.IOStreams. For the documentation of PREFERRED-RT-OPT, see the +# documentation of BOOST_FIND_LIB above. +AC_DEFUN([BOOST_IOSTREAMS], +[BOOST_FIND_LIB([iostreams], [$1], + [boost/iostreams/device/file_descriptor.hpp], + [boost::iostreams::file_descriptor fd(0); fd.close();]) +])# BOOST_IOSTREAMS + + +# BOOST_HASH() +# ------------ +# Look for Boost.Functional/Hash +AC_DEFUN([BOOST_HASH], +[BOOST_FIND_HEADER([boost/functional/hash.hpp])]) + + +# BOOST_LAMBDA() +# -------------- +# Look for Boost.Lambda +AC_DEFUN([BOOST_LAMBDA], +[BOOST_FIND_HEADER([boost/lambda/lambda.hpp])]) + +# BOOST_MPL() +# -------------- +# Look for Boost.MPL +AC_DEFUN([BOOST_MPL], +[BOOST_FIND_HEADER([boost/mpl/void_fwd.hpp])]) + + +# BOOST_OPTIONAL() +# ---------------- +# Look for Boost.Optional +AC_DEFUN([BOOST_OPTIONAL], +[BOOST_FIND_HEADER([boost/optional.hpp])]) + + +# BOOST_PREPROCESSOR() +# -------------------- +# Look for Boost.Preprocessor +AC_DEFUN([BOOST_PREPROCESSOR], +[BOOST_FIND_HEADER([boost/preprocessor/repeat.hpp])]) + + +# BOOST_PROGRAM_OPTIONS([PREFERRED-RT-OPT]) +# ----------------------------------------- +# Look for Boost.Program_options. For the documentation of PREFERRED-RT-OPT, see +# the documentation of BOOST_FIND_LIB above. +AC_DEFUN([BOOST_PROGRAM_OPTIONS], +[BOOST_FIND_LIB([program_options], [$1], + [boost/program_options.hpp], + [boost::program_options::options_description d("test");]) +])# BOOST_PROGRAM_OPTIONS + + +# BOOST_REF() +# ----------- +# Look for Boost.Ref +AC_DEFUN([BOOST_REF], +[BOOST_FIND_HEADER([boost/ref.hpp])]) + + +# BOOST_REGEX([PREFERRED-RT-OPT]) +# ------------------------------- +# Look for Boost.Regex. For the documentation of PREFERRED-RT-OPT, see the +# documentation of BOOST_FIND_LIB above. +AC_DEFUN([BOOST_REGEX], +[BOOST_FIND_LIB([regex], [$1], + [boost/regex.hpp], + [boost::regex exp("*"); boost::regex_match("foo", exp);]) +])# BOOST_REGEX + + +# BOOST_SERIALIZATION([PREFERRED-RT-OPT]) +# --------------------------------------- +# Look for Boost.Serialization. For the documentation of PREFERRED-RT-OPT, see +# the documentation of BOOST_FIND_LIB above. +AC_DEFUN([BOOST_SERIALIZATION], +[BOOST_FIND_LIB([serialization], [$1], + [boost/archive/text_oarchive.hpp], + [std::ostream* o = 0; // Cheap way to get an ostream... + boost::archive::text_oarchive t(*o);]) +])# BOOST_SIGNALS + + +# BOOST_SIGNALS([PREFERRED-RT-OPT]) +# --------------------------------- +# Look for Boost.Signals. For the documentation of PREFERRED-RT-OPT, see the +# documentation of BOOST_FIND_LIB above. +AC_DEFUN([BOOST_SIGNALS], +[BOOST_FIND_LIB([signals], [$1], + [boost/signal.hpp], + [boost::signal<void ()> s;]) +])# BOOST_SIGNALS + + +# BOOST_SMART_PTR() +# ----------------- +# Look for Boost.SmartPtr +AC_DEFUN([BOOST_SMART_PTR], +[BOOST_FIND_HEADER([boost/scoped_ptr.hpp]) +BOOST_FIND_HEADER([boost/shared_ptr.hpp]) +]) + + +# BOOST_STATICASSERT() +# -------------------- +# Look for Boost.StaticAssert +AC_DEFUN([BOOST_STATICASSERT], +[BOOST_FIND_HEADER([boost/static_assert.hpp])]) + + +# BOOST_STRING_ALGO() +# ------------------- +# Look for Boost.StringAlgo +AC_DEFUN([BOOST_STRING_ALGO], +[BOOST_FIND_HEADER([boost/algorithm/string.hpp]) +]) + + +# BOOST_SYSTEM([PREFERRED-RT-OPT]) +# -------------------------------- +# Look for Boost.System. For the documentation of PREFERRED-RT-OPT, see the +# documentation of BOOST_FIND_LIB above. This library was introduced in Boost +# 1.35.0. +AC_DEFUN([BOOST_SYSTEM], +[BOOST_FIND_LIB([system], [$1], + [boost/system/error_code.hpp], + [boost::system::error_code e; e.clear();]) +])# BOOST_SYSTEM + + +# BOOST_TEST([PREFERRED-RT-OPT]) +# ------------------------------ +# Look for Boost.Test. For the documentation of PREFERRED-RT-OPT, see the +# documentation of BOOST_FIND_LIB above. +AC_DEFUN([BOOST_TEST], +[m4_pattern_allow([^BOOST_CHECK$])dnl +BOOST_FIND_LIB([unit_test_framework], [$1], + [boost/test/unit_test.hpp], [BOOST_CHECK(2 == 2);], + [using boost::unit_test::test_suite; + test_suite* init_unit_test_suite(int argc, char ** argv) + { return NULL; }]) +])# BOOST_TEST + + +# BOOST_THREADS([PREFERRED-RT-OPT]) +# --------------------------------- +# Look for Boost.Thread. For the documentation of PREFERRED-RT-OPT, see the +# documentation of BOOST_FIND_LIB above. +# FIXME: Provide an alias "BOOST_THREAD". +AC_DEFUN([BOOST_THREADS], +[dnl Having the pthread flag is required at least on GCC3 where +dnl boost/thread.hpp would complain if we try to compile without +dnl -pthread on GNU/Linux. +AC_REQUIRE([_BOOST_PTHREAD_FLAG])dnl +boost_threads_save_LIBS=$LIBS +boost_threads_save_CPPFLAGS=$CPPFLAGS +LIBS="$LIBS $boost_cv_pthread_flag" +# Yes, we *need* to put the -pthread thing in CPPFLAGS because with GCC3, +# boost/thread.hpp will trigger a #error if -pthread isn't used: +# boost/config/requires_threads.hpp:47:5: #error "Compiler threading support +# is not turned on. Please set the correct command line options for +# threading: -pthread (Linux), -pthreads (Solaris) or -mthreads (Mingw32)" +CPPFLAGS="$CPPFLAGS $boost_cv_pthread_flag" +BOOST_FIND_LIB([thread], [$1], + [boost/thread.hpp], [boost::thread t; boost::mutex m;]) +BOOST_THREAD_LIBS="$BOOST_THREAD_LIBS $boost_cv_pthread_flag" +BOOST_CPPFLAGS="$BOOST_CPPFLAGS $boost_cv_pthread_flag" +LIBS=$boost_threads_save_LIBS +CPPFLAGS=$boost_threads_save_CPPFLAGS +])# BOOST_THREADS + + +# BOOST_TOKENIZER() +# ----------------- +# Look for Boost.Tokenizer +AC_DEFUN([BOOST_TOKENIZER], +[BOOST_FIND_HEADER([boost/tokenizer.hpp])]) + + +# BOOST_TRIBOOL() +# --------------- +# Look for Boost.Tribool +AC_DEFUN([BOOST_TRIBOOL], +[BOOST_FIND_HEADER([boost/logic/tribool_fwd.hpp]) +BOOST_FIND_HEADER([boost/logic/tribool.hpp]) +]) + + +# BOOST_TUPLE() +# ------------- +# Look for Boost.Tuple +AC_DEFUN([BOOST_TUPLE], +[BOOST_FIND_HEADER([boost/tuple/tuple.hpp])]) + + +# BOOST_TYPETRAITS() +# -------------------- +# Look for Boost.TypeTraits +AC_DEFUN([BOOST_TYPETRAITS], +[BOOST_FIND_HEADER([boost/type_traits.hpp])]) + + +# BOOST_UTILITY() +# --------------- +# Look for Boost.Utility (noncopyable, result_of, base-from-member idiom, +# etc.) +AC_DEFUN([BOOST_UTILITY], +[BOOST_FIND_HEADER([boost/utility.hpp])]) + + +# BOOST_VARIANT() +# --------------- +# Look for Boost.Variant. +AC_DEFUN([BOOST_VARIANT], +[BOOST_FIND_HEADER([boost/variant/variant_fwd.hpp]) +BOOST_FIND_HEADER([boost/variant.hpp])]) + + +# BOOST_WAVE([PREFERRED-RT-OPT]) +# ------------------------------ +# NOTE: If you intend to use Wave/Spirit with thread support, make sure you +# call BOOST_THREADS first. +# Look for Boost.Wave. For the documentation of PREFERRED-RT-OPT, see the +# documentation of BOOST_FIND_LIB above. +AC_DEFUN([BOOST_WAVE], +[AC_REQUIRE([BOOST_FILESYSTEM])dnl +AC_REQUIRE([BOOST_DATE_TIME])dnl +boost_wave_save_LIBS=$LIBS +boost_wave_save_LDFLAGS=$LDFLAGS +m4_pattern_allow([^BOOST_((FILE)?SYSTEM|DATE_TIME|THREAD)_(LIBS|LDFLAGS)$])dnl +LIBS="$LIBS $BOOST_SYSTEM_LIBS $BOOST_FILESYSTEM_LIBS $BOOST_DATE_TIME_LIBS\ +$BOOST_THREAD_LIBS" +LDFLAGS="$LDFLAGS $BOOST_SYSTEM_LDFLAGS $BOOST_FILESYSTEM_LDFLAGS\ +$BOOST_DATE_TIME_LDFLAGS $BOOST_THREAD_LDFLAGS" +BOOST_FIND_LIB([wave], [$1], + [boost/wave.hpp], + [boost::wave::token_id id; get_token_name(id);]) +LIBS=$boost_wave_save_LIBS +LDFLAGS=$boost_wave_save_LDFLAGS +])# BOOST_WAVE + + +# BOOST_XPRESSIVE() +# ----------------- +# Look for Boost.Xpressive (new since 1.36.0). +AC_DEFUN([BOOST_XPRESSIVE], +[BOOST_FIND_HEADER([boost/xpressive/xpressive.hpp])]) + + +# ----------------- # +# Internal helpers. # +# ----------------- # + + +# _BOOST_PTHREAD_FLAG() +# --------------------- +# Internal helper for BOOST_THREADS. Based on ACX_PTHREAD: +# http://autoconf-archive.cryp.to/acx_pthread.html +AC_DEFUN([_BOOST_PTHREAD_FLAG], +[AC_REQUIRE([AC_PROG_CXX])dnl +AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_LANG_PUSH([C++])dnl +AC_CACHE_CHECK([for the flags needed to use pthreads], [boost_cv_pthread_flag], +[ boost_cv_pthread_flag= + # The ordering *is* (sometimes) important. Some notes on the + # individual items follow: + # (none): in case threads are in libc; should be tried before -Kthread and + # other compiler flags to prevent continual compiler warnings + # -lpthreads: AIX (must check this before -lpthread) + # -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h) + # -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able) + # -llthread: LinuxThreads port on FreeBSD (also preferred to -pthread) + # -pthread: GNU Linux/GCC (kernel threads), BSD/GCC (userland threads) + # -pthreads: Solaris/GCC + # -mthreads: MinGW32/GCC, Lynx/GCC + # -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it + # doesn't hurt to check since this sometimes defines pthreads too; + # also defines -D_REENTRANT) + # ... -mt is also the pthreads flag for HP/aCC + # -lpthread: GNU Linux, etc. + # --thread-safe: KAI C++ + case $host_os in #( + *solaris*) + # On Solaris (at least, for some versions), libc contains stubbed + # (non-functional) versions of the pthreads routines, so link-based + # tests will erroneously succeed. (We need to link with -pthreads/-mt/ + # -lpthread.) (The stubs are missing pthread_cleanup_push, or rather + # a function called by this macro, so we could check for that, but + # who knows whether they'll stub that too in a future libc.) So, + # we'll just look for -pthreads and -lpthread first: + boost_pthread_flags="-pthreads -lpthread -mt -pthread";; #( + *) + boost_pthread_flags="-lpthreads -Kthread -kthread -llthread -pthread \ + -pthreads -mthreads -lpthread --thread-safe -mt";; + esac + # Generate the test file. + AC_LANG_CONFTEST([AC_LANG_PROGRAM([#include <pthread.h>], + [pthread_t th; pthread_join(th, 0); + pthread_attr_init(0); pthread_cleanup_push(0, 0); + pthread_create(0,0,0,0); pthread_cleanup_pop(0);])]) + for boost_pthread_flag in '' $boost_pthread_flags; do + boost_pthread_ok=false +dnl Re-use the test file already generated. + boost_pthreads__save_LIBS=$LIBS + LIBS="$LIBS $boost_pthread_flag" + AC_LINK_IFELSE([], + [if grep ".*$boost_pthread_flag" conftest.err; then + echo "This flag seems to have triggered warnings" >&AS_MESSAGE_LOG_FD + else + boost_pthread_ok=:; boost_cv_pthread_flag=$boost_pthread_flag + fi]) + LIBS=$boost_pthreads__save_LIBS + $boost_pthread_ok && break + done +]) +AC_LANG_POP([C++])dnl +])# _BOOST_PTHREAD_FLAG + + +# _BOOST_gcc_test(MAJOR, MINOR) +# ----------------------------- +# Internal helper for _BOOST_FIND_COMPILER_TAG. +m4_define([_BOOST_gcc_test], +["defined __GNUC__ && __GNUC__ == $1 && __GNUC_MINOR__ == $2 && !defined __ICC @ gcc$1$2"])dnl + + +# _BOOST_FIND_COMPILER_TAG() +# -------------------------- +# Internal. When Boost is installed without --layout=system, each library +# filename will hold a suffix that encodes the compiler used during the +# build. The Boost build system seems to call this a `tag'. +AC_DEFUN([_BOOST_FIND_COMPILER_TAG], +[AC_REQUIRE([AC_PROG_CXX])dnl +AC_CACHE_CHECK([for the toolset name used by Boost for $CXX], [boost_cv_lib_tag], +[AC_LANG_PUSH([C++])dnl + boost_cv_lib_tag=unknown + # The following tests are mostly inspired by boost/config/auto_link.hpp + # The list is sorted to most recent/common to oldest compiler (in order + # to increase the likelihood of finding the right compiler with the + # least number of compilation attempt). + # Beware that some tests are sensible to the order (for instance, we must + # look for MinGW before looking for GCC3). + # I used one compilation test per compiler with a #error to recognize + # each compiler so that it works even when cross-compiling (let me know + # if you know a better approach). + # Known missing tags (known from Boost's tools/build/v2/tools/common.jam): + # como, edg, kcc, bck, mp, sw, tru, xlc + # I'm not sure about my test for `il' (be careful: Intel's ICC pre-defines + # the same defines as GCC's). + # TODO: Move the test on GCC 4.4 up once it's released. + for i in \ + _BOOST_gcc_test(4, 3) \ + _BOOST_gcc_test(4, 2) \ + _BOOST_gcc_test(4, 1) \ + _BOOST_gcc_test(4, 0) \ + "defined __GNUC__ && __GNUC__ == 3 && !defined __ICC \ + && (defined WIN32 || defined WINNT || defined _WIN32 || defined __WIN32 \ + || defined __WIN32__ || defined __WINNT || defined __WINNT__) @ mgw" \ + _BOOST_gcc_test(3, 4) \ + _BOOST_gcc_test(3, 3) \ + "defined _MSC_VER && _MSC_VER >= 1400 @ vc80" \ + _BOOST_gcc_test(3, 2) \ + "defined _MSC_VER && _MSC_VER == 1310 @ vc71" \ + _BOOST_gcc_test(3, 1) \ + _BOOST_gcc_test(3, 0) \ + "defined __BORLANDC__ @ bcb" \ + "defined __ICC && (defined __unix || defined __unix__) @ il" \ + "defined __ICL @ iw" \ + "defined _MSC_VER && _MSC_VER == 1300 @ vc7" \ + _BOOST_gcc_test(4, 4) \ + _BOOST_gcc_test(2, 95) \ + "defined __MWERKS__ && __MWERKS__ <= 0x32FF @ cw9" \ + "defined _MSC_VER && _MSC_VER < 1300 && !defined UNDER_CE @ vc6" \ + "defined _MSC_VER && _MSC_VER < 1300 && defined UNDER_CE @ evc4" \ + "defined __MWERKS__ && __MWERKS__ <= 0x31FF @ cw8" + do + boost_tag_test=`expr "X$i" : 'X\([[^@]]*\) @ '` + boost_tag=`expr "X$i" : 'X[[^@]]* @ \(.*\)'` + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ +#if $boost_tag_test +/* OK */ +#else +# error $boost_tag_test +#endif +]])], [boost_cv_lib_tag=$boost_tag; break], []) + done +AC_LANG_POP([C++])dnl + case $boost_cv_lib_tag in #( + # Some newer (>= 1.35?) versions of Boost seem to only use "gcc" as opposed + # to "gcc41" for instance. + *-gcc | *'-gcc ') :;; #( Don't re-add -gcc: it's already in there. + gcc*) + # We can specify multiple tags in this variable because it's used by + # BOOST_FIND_LIB that does a `for tag in -$boost_cv_lib_tag' ... + boost_cv_lib_tag="$boost_cv_lib_tag -gcc" + ;; #( + unknown) + AC_MSG_WARN([[could not figure out which toolset name to use for $CXX]]) + boost_cv_lib_tag= + ;; + esac +])dnl end of AC_CACHE_CHECK +])# _BOOST_FIND_COMPILER_TAG + + +# _BOOST_GUESS_WHETHER_TO_USE_MT() +# -------------------------------- +# Compile a small test to try to guess whether we should favor MT (Multi +# Thread) flavors of Boost. Sets boost_guess_use_mt accordingly. +AC_DEFUN([_BOOST_GUESS_WHETHER_TO_USE_MT], +[# Check whether we do better use `mt' even though we weren't ask to. +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ +#if defined _REENTRANT || defined _MT || defined __MT__ +/* use -mt */ +#else +# error MT not needed +#endif +]])], [boost_guess_use_mt=:], [boost_guess_use_mt=false]) +]) + +# _BOOST_AC_LINK_IFELSE(PROGRAM, [ACTION-IF-TRUE], [ACTION-IF-FALSE]) +# ------------------------------------------------------------------- +# Fork of _AC_LINK_IFELSE that preserves conftest.o across calls. Fragile, +# will break when Autoconf changes its internals. Requires that you manually +# rm -f conftest.$ac_objext in between to really different tests, otherwise +# you will try to link a conftest.o left behind by a previous test. +# Used to aggressively optimize BOOST_FIND_LIB (see the big comment in this +# macro) +m4_define([_BOOST_AC_LINK_IFELSE], +[m4_ifvaln([$1], [AC_LANG_CONFTEST([$1])])dnl +rm -f conftest$ac_exeext +boost_ac_ext_save=$ac_ext +boost_use_source=: +# If we already have a .o, re-use it. We change $ac_ext so that $ac_link +# tries to link the existing object file instead of compiling from source. +test -f conftest.$ac_objext && ac_ext=$ac_objext && boost_use_source=false && + _AS_ECHO_LOG([re-using the existing conftest.$ac_objext]) +AS_IF([_AC_DO_STDERR($ac_link) && { + test -z "$ac_[]_AC_LANG_ABBREV[]_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_executable_p conftest$ac_exeext +dnl FIXME: use AS_TEST_X instead when 2.61 is widespread enough. + }], + [$2], + [if $boost_use_source; then + _AC_MSG_LOG_CONFTEST + fi + $3]) +dnl Delete also the IPA/IPO (Inter Procedural Analysis/Optimization) +dnl information created by the PGI compiler (conftest_ipa8_conftest.oo), +dnl as it would interfere with the next link command. +rm -f core conftest.err conftest_ipa8_conftest.oo \ + conftest$ac_exeext m4_ifval([$1], [conftest.$ac_ext])[]dnl +])# _BOOST_AC_LINK_IFELSE + +# Local Variables: +# mode: autoconf +# End: diff --git a/build-aux/deb.mk b/build-aux/deb.mk new file mode 100644 index 0000000..74adbe4 --- /dev/null +++ b/build-aux/deb.mk @@ -0,0 +1,32 @@ +include $(top_srcdir)/build-aux/init.mk + +DPKG_BUILDPACKAGE = dpkg-buildpackage -rfakeroot -E -W -d +distdir = $(PACKAGE)-$(VERSION) +DIST_ARCHIVE = $(distdir).tar.gz + +EXTRA_DIST += \ + changelog \ + compat \ + control \ + copyright \ + docs \ + rules + +.PHONY: deb deb-prepare + +clean-local: + rm -rf $(PACKAGE)-$(VERSION) + rm -f $(DIST_ARCHIVE) + rm -f $(PACKAGE)_$(VERSION)-*.tar.gz + rm -f $(PACKAGE)_$(VERSION)-*.dsc + rm -f $(PACKAGE)_$(VERSION)-*.changes + rm -f $(PACKAGE)_$(VERSION)-*.deb + +deb-prepare: + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) dist-gzip + rm -rf $(distdir) + tar xzf $(top_builddir)/$(DIST_ARCHIVE) + ln -s packages/debian $(distdir) + +deb: deb-prepare + cd $(distdir) && $(DPKG_BUILDPACKAGE) diff --git a/build-aux/doxygen.m4 b/build-aux/doxygen.m4 new file mode 100644 index 0000000..eefbf3f --- /dev/null +++ b/build-aux/doxygen.m4 @@ -0,0 +1,63 @@ +# -*-Autoconf-*- +# Copyright (C) 2009 by Thomas Moulard, FIXME. +# This file is part of the roboptim. +# +# roboptim is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# Additional permission under section 7 of the GNU General Public +# License, version 3 ("GPLv3"): +# +# If you convey this file as part of a work that contains a +# configuration script generated by Autoconf, you may do so under +# terms of your choice. +# +# roboptim is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with roboptim. If not, see <http://www.gnu.org/licenses/>. + +# serial 1 + +# ------ # +# README # +# ------ # + +# This m4 file can be used to search for Doxygen and its dependencies. + +m4_pattern_forbid([^JRL]) + +# JRL_PROG_DOXYGEN([REQUIRED_VERSION]) +# -------------------------------------------- +# Search for Doxygen and related tools (perl and dot). +AC_DEFUN([JRL_PROG_DOXYGEN], +[# Search for Doxygen and its related tools. +# Search for Doxygen. +AC_ARG_VAR([DOXYGEN], [the Doxygen documentation generation program]) +AC_CHECK_PROGS([DOXYGEN], [doxygen]) + + +# Search for Perl. +AC_ARG_VAR([PERL], [the perl interpreter]) +AC_CHECK_PROGS([PERL], [perl]) + +if test x"$PERL" = x; then + AC_MSG_FAILURE([Perl not found.]) +fi + + +# Search for Dot. +AC_ARG_VAR([DOT], [the dot graphic tool]) +AC_CHECK_PROGS([DOT], [dot]) + +if test x"$DOT" = x; then + AC_SUBST([HAVE_DOT], [NO]) +else + AC_SUBST([HAVE_DOT], [YES]) +fi +]) # JRL_PROG_DOXYGEN diff --git a/build-aux/ebuild.mk b/build-aux/ebuild.mk new file mode 100644 index 0000000..e02d5cd --- /dev/null +++ b/build-aux/ebuild.mk @@ -0,0 +1,32 @@ +include $(top_srcdir)/build-aux/init.mk + +# Distribute the files required to build the ebuilds. +EXTRA_DIST += \ + ChangeLog \ + metadata.xml \ + $(PACKAGE)-$(PACKAGE_VERSION).ebuild \ + $(PACKAGE)-9999.ebuild + + +.PHONY: check-ebuild install-ebuild + +# Install the ebuild into a local portage tree. +# For testing purpose only, this rule has to be called manually. +install-ebuild: + if test "x$$PORTAGE_ROOT" = "x"; then \ + echo -n "Please define PORTAGE_ROOT "; \ + echo "to the portage root you want to install the ebuild into.";\ + else \ + DIR="$$PORTAGE_ROOT/$(EBUILD_CATEGORY)/$(PACKAGE)"; \ + $(mkdir_p) $$DIR/files; \ + for i in `echo "$(EXTRA_DIST)" | sed 's/ /\n/g'`; do \ + cp "$(srcdir)/$$i" "$$DIR"; \ + if test x`echo "$$i" | grep "\.ebuild$$"` = "x$$i"; then \ + ebuild $$DIR/$$i manifest; \ + fi \ + done \ + fi + +# Check that the metadata.xml file is valid. +check-ebuild: + xmllint --valid "$(srcdir)/metadata.xml" > /dev/null diff --git a/build-aux/init.mk b/build-aux/init.mk index 5e559df..f7218a7 100644 --- a/build-aux/init.mk +++ b/build-aux/init.mk @@ -19,8 +19,5 @@ AM_CPPFLAGS += -I$(top_builddir)/src -I$(top_srcdir)/src # ...then search in distributed headers. AM_CPPFLAGS += -I$(top_srcdir)/include -# Add pthreads CXXFLAGS. -AM_CXXFLAGS += $(PTHREAD_CFLAGS) - -# Include roboptim-core headers. -AM_CPPFLAGS += $(ROBOPTIMCORE_CFLAGS) +# Add boost include dir +AM_CPPFLAGS += $(BOOST_CPPFLAGS) diff --git a/build-aux/move-if-change b/build-aux/move-if-change new file mode 100755 index 0000000..5df5330 --- /dev/null +++ b/build-aux/move-if-change @@ -0,0 +1,14 @@ +#!/bin/sh +# Like mv $1 $2, but if the files are the same, just delete $1. +# Status is 0 if $2 is changed, 1 otherwise. + +if test -r "$2"; then + if cmp -s "$1" "$2"; then + echo >&2 "$2 is unchanged" + rm -f "$1" + else + mv -f "$1" "$2" + fi +else + mv -f "$1" "$2" +fi diff --git a/build-aux/pkg-config.mk b/build-aux/pkg-config.mk new file mode 100644 index 0000000..5dc23aa --- /dev/null +++ b/build-aux/pkg-config.mk @@ -0,0 +1,83 @@ +# -*-Automake-*- +# Copyright (C) 2009 by Thomas Moulard, AIST, CNRS, INRIA. +# This file is part of the roboptim. +# +# roboptim is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# Additional permission under section 7 of the GNU General Public +# License, version 3 ("GPLv3"): +# +# If you convey this file as part of a work that contains a +# configuration script generated by Autoconf, you may do so under +# terms of your choice. +# +# roboptim is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with roboptim. If not, see <http://www.gnu.org/licenses/>. + +# -------# +# README # +# -------# + +# This file contains pkg-config generation rules for Automake. +# +# This file assumes that: +# +# - you include *before* this file init.mk or make sure that any global +# variable can be used with the += syntax. +# - there is no other rule using install-data-local and uninstall-data-local. +# +# The generate pkg-config files can be customized using three Autoconf +# variables: +# - PKGCONFIG_REQUIRES: package dependencies, +# - PKGCONFIG_LIBS: package LDFLAGS, +# - PKGCONFIG_CFLAGS: package CFLAGS/CPPFLAGS/CXXFLAGS. + + +# Variables +pkg_config_file = '@PACKAGE_TARNAME@.pc' +pkgdir = "$(DESTDIR)$(libdir)/pkgconfig/" + +edit = $(SED) -e "s|@prefix\@|$(prefix)|" \ + -e 's,@exec_prefix\@,$(exec_prefix),g' \ + -e 's,@libdir\@,$(libdir),g' \ + -e 's,@includedir\@,$(includedir),g' \ + -e 's,@datarootdir\@,$(datarootdir),g' \ + -e 's,@PACKAGE\@,$(PACKAGE),g' \ + -e 's,@PACKAGE_TARNAME\@,$(PACKAGE_TARNAME),g' \ + -e 's,@VERSION\@,$(PACKAGE_VERSION),g' + +EXTRA_DIST += build-aux/pkg-config.pc.in +CLEANFILES += $(PKG_CONFIG_FILE) + +# pkg-config generation. +@PACKAGE_TARNAME@.pc: $(srcdir)/build-aux/pkg-config.pc.in + $(top_builddir)/config.status \ + --file="$@":"$(srcdir)/build-aux/pkg-config.pc.in" + +# Install, uninstall rules. +install-data-local: install-pkg-config +uninstall-local: uninstall-pkg-config + +install-pkg-config: $(PACKAGE_TARNAME).pc + $(mkdir_p) $(PKG_DIR) + $(install_sh_DATA) "$(PKG_CONFIG_FILE)" $(PKG_DIR) + +uninstall-pkg-config: + -rm -f "$(PKG_DIR)$(PKG_CONFIG_FILE)" + +# Check that the pkg-config file is generated. +check-local: @PACKAGE_TARNAME@.pc + @if ! test -f $(pkg_config_file); then \ + echo 'pkg-config file missing: failing...'; \ + return 1; \ + else \ + echo 'pkg-config file has been generated: ok.'; \ + fi diff --git a/build-aux/pkg-config.pc.in b/build-aux/pkg-config.pc.in new file mode 100644 index 0000000..0670c39 --- /dev/null +++ b/build-aux/pkg-config.pc.in @@ -0,0 +1,16 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ +datarootdir=@datarootdir@ +docdir=@datarootdir@/doc/@PACKAGE_TARNAME@ + +Name: @PACKAGE@ +Description: @PKGCONFIG_DESCRIPTION@ +URL: http://roboptim.sourceforge.net/ +Version: @VERSION@ +Requires: @PKGCONFIG_REQUIRES@ +Conflicts: @PKGCONFIG_CONFLICTS@ +Libs: -L${libdir} @PKGCONFIG_LIBS@ +Libs.private: +Cflags: -I${includedir} @PKGCONFIG_CFLAGS@ diff --git a/build-aux/rpm.mk b/build-aux/rpm.mk new file mode 100644 index 0000000..1a7160d --- /dev/null +++ b/build-aux/rpm.mk @@ -0,0 +1,53 @@ +include $(top_srcdir)/build-aux/init.mk + +# ------- # +# CAUTION # +# ------- # + +# Currently, I do not know how to build rpms *locally*. +# You will have to know what is your RPM building directory +# (see rpmbuild documentation). +# Set RPM_TREE to this directory. You will need write access +# to this directory. +# Hint: on Gentoo RPM_TREE is ``/usrc/src/rpm'' and on Red Hat +# ``/usr/src/redhat''. + +RPMBUILD = rpmbuild + +SPECFILE = $(PACKAGE).spec +EXTRA_DIST += $(SPECFILE) + +.PHONY: install-rpm install-rpm-tree install-rpm-tarball src-rpm rpm + +# Do nothing by default. +all: + +install-rpm: install-rpm-tree install-rpm-tarball + +# Prepare tree. +install-rpm-tree: + @if test "x$$RPM_TREE" = "x"; then \ + echo "Please define RPM_TREE."; \ + exit 1; \ + fi + $(mkdir_p) $$RPM_TREE/BUILD + $(mkdir_p) $$RPM_TREE/RPMS + $(mkdir_p) $$RPM_TREE/SOURCES + $(mkdir_p) $$RPM_TREE/SPECS + $(mkdir_p) $$RPM_TREE/SRPMS + +install-rpm-tarball: + @if test "x$$RPM_TREE" = "x"; then \ + echo "Please define RPM_TREE."; \ + exit 1; \ + fi + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) dist-gzip + cp $(top_builddir)/$(PACKAGE)-$(VERSION).tar.gz $$RPM_TREE/SOURCES + +# Build source RPM +src-rpm: install-rpm $(srcdir)/$(SPECFILE) + $(RPMBUILD) -bs $(srcdir)/$(SPECFILE) + +# Build binary RPM +rpm: install-rpm $(srcdir)/$(SPECFILE) + $(RPMBUILD) -bb $(srcdir)/$(SPECFILE) diff --git a/configure.ac b/configure.ac index 7368775..80ed450 100644 --- a/configure.ac +++ b/configure.ac @@ -52,8 +52,7 @@ AC_PROG_MKDIR_P AC_PROG_SED # Search for Doxygen. -AC_ARG_VAR([DOXYGEN], [the Doxygen documentation generation program]) -AC_CHECK_PROGS([DOXYGEN], [doxygen]) +JRL_PROG_DOXYGEN # Search for Libtool. LT_INIT([dlopen]) diff --git a/doc/Doxyfile.in b/doc/Doxyfile.in index ec4e3b0..fd90e82 100644 --- a/doc/Doxyfile.in +++ b/doc/Doxyfile.in @@ -1,4 +1,4 @@ -# Doxyfile 1.5.4 +# Doxyfile 1.5.8 # This file describes the settings to be used by the documentation system # doxygen (www.doxygen.org) for a project @@ -14,11 +14,11 @@ # Project related configuration options #--------------------------------------------------------------------------- -# This tag specifies the encoding used for all characters in the config file that -# follow. The default is UTF-8 which is also the encoding used for all text before -# the first occurrence of this tag. Doxygen uses libiconv (or the iconv built into -# libc) for the transcoding. See http://www.gnu.org/software/libiconv for the list of -# possible encodings. +# This tag specifies the encoding used for all characters in the config file +# that follow. The default is UTF-8 which is also the encoding used for all +# text before the first occurrence of this tag. Doxygen uses libiconv (or the +# iconv built into libc) for the transcoding. See +# http://www.gnu.org/software/libiconv for the list of possible encodings. DOXYFILE_ENCODING = UTF-8 @@ -54,10 +54,11 @@ CREATE_SUBDIRS = NO # information to generate all constant output in the proper language. # The default language is English, other supported languages are: # Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, -# Croatian, Czech, Danish, Dutch, Finnish, French, German, Greek, Hungarian, -# Italian, Japanese, Japanese-en (Japanese with English messages), Korean, -# Korean-en, Lithuanian, Norwegian, Polish, Portuguese, Romanian, Russian, -# Serbian, Slovak, Slovene, Spanish, Swedish, and Ukrainian. +# Croatian, Czech, Danish, Dutch, Farsi, Finnish, French, German, Greek, +# Hungarian, Italian, Japanese, Japanese-en (Japanese with English messages), +# Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, Polish, +# Portuguese, Romanian, Russian, Serbian, Serbian-Cyrilic, Slovak, Slovene, +# Spanish, Swedish, and Ukrainian. OUTPUT_LANGUAGE = English @@ -154,13 +155,6 @@ QT_AUTOBRIEF = NO MULTILINE_CPP_IS_BRIEF = NO -# If the DETAILS_AT_TOP tag is set to YES then Doxygen -# will output the detailed description near the top, like JavaDoc. -# If set to NO, the detailed description appears after the member -# documentation. - -DETAILS_AT_TOP = NO - # If the INHERIT_DOCS tag is set to YES (the default) then an undocumented # member inherits the documentation from any documented member that it # re-implements. @@ -195,14 +189,37 @@ ALIASES = OPTIMIZE_OUTPUT_FOR_C = NO # Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java -# sources only. Doxygen will then generate output that is more tailored for Java. -# For instance, namespaces will be presented as packages, qualified scopes -# will look different, etc. +# sources only. Doxygen will then generate output that is more tailored for +# Java. For instance, namespaces will be presented as packages, qualified +# scopes will look different, etc. OPTIMIZE_OUTPUT_JAVA = NO -# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want to -# include (a tag file for) the STL sources as input, then you should +# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran +# sources only. Doxygen will then generate output that is more tailored for +# Fortran. + +OPTIMIZE_FOR_FORTRAN = NO + +# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL +# sources. Doxygen will then generate output that is tailored for +# VHDL. + +OPTIMIZE_OUTPUT_VHDL = NO + +# Doxygen selects the parser to use depending on the extension of the files it parses. +# With this tag you can assign which parser to use for a given extension. +# Doxygen has a built-in mapping, but you can override or extend it using this tag. +# The format is ext=language, where ext is a file extension, and language is one of +# the parsers supported by doxygen: IDL, Java, Javascript, C#, C, C++, D, PHP, +# Objective-C, Python, Fortran, VHDL, C, C++. For instance to make doxygen treat +# .inc files as Fortran files (default is PHP), and .f files as C (default is Fortran), +# use: inc=Fortran f=C + +EXTENSION_MAPPING = + +# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want +# to include (a tag file for) the STL sources as input, then you should # set this tag to YES in order to let doxygen match functions declarations and # definitions whose arguments contain STL classes (e.g. func(std::string); v.s. # func(std::string) {}). This also make the inheritance and collaboration @@ -221,6 +238,15 @@ CPP_CLI_SUPPORT = NO SIP_SUPPORT = NO +# For Microsoft's IDL there are propget and propput attributes to indicate getter +# and setter methods for a property. Setting this option to YES (the default) +# will make doxygen to replace the get and set methods by a property in the +# documentation. This will only work if the methods are indeed getting or +# setting a simple type. If this is not the case, or you want to show the +# methods anyway, you should set this option to NO. + +IDL_PROPERTY_SUPPORT = YES + # If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC # tag is set to YES, then doxygen will reuse the documentation of the first # member in the group (if any) for the other members of the group. By default @@ -236,16 +262,32 @@ DISTRIBUTE_GROUP_DOC = NO SUBGROUPING = YES -# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct (or union) is -# documented as struct with the name of the typedef. So +# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum +# is documented as struct, union, or enum with the name of the typedef. So # typedef struct TypeS {} TypeT, will appear in the documentation as a struct # with name TypeT. When disabled the typedef will appear as a member of a file, # namespace, or class. And the struct will be named TypeS. This can typically -# be useful for C code where the coding convention is that all structs are -# typedef'ed and only the typedef is referenced never the struct's name. +# be useful for C code in case the coding convention dictates that all compound +# types are typedef'ed and only the typedef is referenced, never the tag name. TYPEDEF_HIDES_STRUCT = NO +# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to +# determine which symbols to keep in memory and which to flush to disk. +# When the cache is full, less often used symbols will be written to disk. +# For small to medium size projects (<1000 input files) the default value is +# probably good enough. For larger projects a too small cache size can cause +# doxygen to be busy swapping symbols to and from disk most of the time +# causing a significant performance penality. +# If the system has enough physical memory increasing the cache will improve the +# performance by keeping more symbols in memory. Note that the value works on +# a logarithmic scale so increasing the size by one will rougly double the +# memory usage. The cache size is given by this formula: +# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0, +# corresponding to a cache size of 2^16 = 65536 symbols + +SYMBOL_CACHE_SIZE = 0 + #--------------------------------------------------------------------------- # Build related configuration options #--------------------------------------------------------------------------- @@ -280,10 +322,11 @@ EXTRACT_LOCAL_CLASSES = YES EXTRACT_LOCAL_METHODS = NO -# If this flag is set to YES, the members of anonymous namespaces will be extracted -# and appear in the documentation as a namespace called 'anonymous_namespace{file}', -# where file will be replaced with the base name of the file that contains the anonymous -# namespace. By default anonymous namespace are hidden. +# If this flag is set to YES, the members of anonymous namespaces will be +# extracted and appear in the documentation as a namespace called +# 'anonymous_namespace{file}', where file will be replaced with the base +# name of the file that contains the anonymous namespace. By default +# anonymous namespace are hidden. EXTRACT_ANON_NSPACES = NO @@ -362,6 +405,12 @@ SORT_MEMBER_DOCS = YES SORT_BRIEF_DOCS = NO +# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the +# hierarchy of group names into alphabetical order. If set to NO (the default) +# the group names will appear in their defined order. + +SORT_GROUP_NAMES = NO + # If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be # sorted by fully-qualified names, including namespaces. If set to # NO (the default), the class list will be sorted only by class name, @@ -423,9 +472,22 @@ SHOW_USED_FILES = NO SHOW_DIRECTORIES = NO +# Set the SHOW_FILES tag to NO to disable the generation of the Files page. +# This will remove the Files entry from the Quick Index and from the +# Folder Tree View (if specified). The default is YES. + +SHOW_FILES = YES + +# Set the SHOW_NAMESPACES tag to NO to disable the generation of the +# Namespaces page. +# This will remove the Namespaces entry from the Quick Index +# and from the Folder Tree View (if specified). The default is YES. + +SHOW_NAMESPACES = YES + # The FILE_VERSION_FILTER tag can be used to specify a program or script that -# doxygen should invoke to get the current version for each file (typically from the -# version control system). Doxygen will invoke the program by executing (via +# doxygen should invoke to get the current version for each file (typically from +# the version control system). Doxygen will invoke the program by executing (via # popen()) the command <command> <input-file>, where <command> is the value of # the FILE_VERSION_FILTER tag, and <input-file> is the name of an input file # provided by doxygen. Whatever the program writes to standard output @@ -433,6 +495,15 @@ SHOW_DIRECTORIES = NO FILE_VERSION_FILTER = +# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed by +# doxygen. The layout file controls the global structure of the generated output files +# in an output format independent way. The create the layout file that represents +# doxygen's defaults, run doxygen with the -l option. You can optionally specify a +# file name after the option, if omitted DoxygenLayout.xml will be used as the name +# of the layout file. + +LAYOUT_FILE = + #--------------------------------------------------------------------------- # configuration options related to warning and progress messages #--------------------------------------------------------------------------- @@ -493,12 +564,14 @@ WARN_LOGFILE = # directories like "/usr/src/myproject". Separate the files or directories # with spaces. -INPUT = @top_srcdir@/include @top_srcdir@/src +INPUT = @abs_top_srcdir@/include \ + @abs_top_srcdir@/src -# This tag can be used to specify the character encoding of the source files that -# doxygen parses. Internally doxygen uses the UTF-8 encoding, which is also the default -# input encoding. Doxygen uses libiconv (or the iconv built in... [truncated message content] |
From: Thomas M. <tho...@us...> - 2009-06-10 09:54:05
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "roboptim". The branch, share has been updated via c4fa250fdaae35bf3763058ebac81633caa420b7 (commit) from e71c6d43aa3bc575d7fd05c0279702f3c0cba844 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit c4fa250fdaae35bf3763058ebac81633caa420b7 Author: Thomas Moulard <tho...@gm...> Date: Wed Jun 10 18:53:21 2009 +0900 Fix remotedir computation in SF upload script. * doc/sf-upload.sh.in: Here. Signed-off-by: Thomas Moulard <tho...@gm...> diff --git a/ChangeLog b/ChangeLog index 0aef146..e24211e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2009-06-10 Thomas Moulard <tho...@gm...> + Fix remotedir computation in SF upload script. + * doc/sf-upload.sh.in: Here. + +2009-06-10 Thomas Moulard <tho...@gm...> + Fix documentation rules. * doc/Makefile.am: Fix CLEANFILES variable. * doc/sf-upload.sh.in: Fix permissions diff --git a/doc/sf-upload.sh.in b/doc/sf-upload.sh.in index 5db289b..a54ed34 100644 --- a/doc/sf-upload.sh.in +++ b/doc/sf-upload.sh.in @@ -38,7 +38,7 @@ fi rsync_cmd="$rsync -avP -e ssh" localdir="@abs_top_builddir@/doc/html/" -remotedir="htdocs/doc/core/$VERSION" +remotedir="htdocs/doc/@PACKAGE_TARNAME@/$VERSION" rsync_loghost="$SF_USERNAME,rob...@we...:" echo "Fixing local rights."; ----------------------------------------------------------------------- Summary of changes: ChangeLog | 5 +++++ doc/sf-upload.sh.in | 2 +- 2 files changed, 6 insertions(+), 1 deletions(-) hooks/post-receive -- roboptim |