Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: roboptim/roboptim-core-plugin-cminpack
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v3.0
Choose a base ref
...
head repository: roboptim/roboptim-core-plugin-cminpack
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
  • 17 commits
  • 10 files changed
  • 2 contributors

Commits on Jul 20, 2015

  1. Use MathJax for doc

    Benjamin Chrétien committed Jul 20, 2015
    Copy the full SHA
    059ea08 View commit details

Commits on Jul 29, 2015

  1. [shared-tests] Synchronize.

    Benjamin Chrétien committed Jul 29, 2015
    Copy the full SHA
    797111a View commit details
  2. [cmake] Synchronize.

    Benjamin Chrétien committed Jul 29, 2015
    Copy the full SHA
    9b2a43b View commit details
  3. [travis] Synchronize.

    Benjamin Chrétien committed Jul 29, 2015
    Copy the full SHA
    8e657e6 View commit details
  4. Fix CMakeLists.txt

    Benjamin Chrétien committed Jul 29, 2015
    Copy the full SHA
    03122db View commit details
  5. Update for 3.1 release

    Benjamin Chrétien committed Jul 29, 2015
    Copy the full SHA
    b8cb0fe View commit details

Commits on Jan 25, 2016

  1. [travis] Synchronize

    Benjamin Chrétien committed Jan 25, 2016
    Copy the full SHA
    8ce3543 View commit details
  2. [cmake] Synchronize

    Benjamin Chrétien committed Jan 25, 2016
    Copy the full SHA
    b0d031d View commit details
  3. [shared-tests] Synchronize

    Benjamin Chrétien committed Jan 25, 2016
    Copy the full SHA
    0920609 View commit details
  4. Update for new API + use Eigen vectors

    Benjamin Chrétien committed Jan 25, 2016
    Copy the full SHA
    9438a81 View commit details
  5. Release 3.2

    Benjamin Chrétien committed Jan 25, 2016
    Copy the full SHA
    8b60101 View commit details
  6. [travis] Remove useless dependencies

    Benjamin Chrétien committed Jan 25, 2016
    Copy the full SHA
    860867e View commit details

Commits on Aug 28, 2016

  1. Copy the full SHA
    3bf35cc View commit details
  2. Copy the full SHA
    ef1f772 View commit details
  3. Copy the full SHA
    2a11099 View commit details
  4. Update for changes to core

    bchretien committed Aug 28, 2016
    Copy the full SHA
    8c2c457 View commit details
  5. Copy the full SHA
    9569671 View commit details
Showing with 160 additions and 93 deletions.
  1. +1 −1 .travis
  2. +53 −13 .travis.yml
  3. +5 −8 CMakeLists.txt
  4. +1 −1 README.md
  5. +1 −1 cmake
  6. +16 −11 include/roboptim/core/plugin/cminpack.hh
  7. +15 −9 src/CMakeLists.txt
  8. +64 −48 src/cminpack.cc
  9. +3 −0 tests/CMakeLists.txt
  10. +1 −1 tests/shared-tests
2 changes: 1 addition & 1 deletion .travis
66 changes: 53 additions & 13 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
language: cpp
compiler:
- gcc
- clang
env:
global:
- APT_DEPENDENCIES="doxygen doxygen-latex libltdl-dev libboost-all-dev liblog4cxx10-dev libeigen3-dev coinor-libipopt-dev libcminpack-dev"
- APT_DEPENDENCIES="cmake cmake-data doxygen libltdl-dev libboost-all-dev liblog4cxx10-dev libcminpack-dev"
- HOMEBREW_DEPENDENCIES="doxygen log4cxx cminpack"
- GIT_DEPENDENCIES="roboptim/roboptim-core"
- DEBSIGN_KEYID=5AE5CD75
- PPA_URI="roboptim/ppa"
@@ -19,18 +17,60 @@ notifications:
rooms:
secure: LJbgx2sjAmTUu+AV8N/PSQHFQ8E1OnHAB2oYFv1XwN2hujtswNwE9k16etaEBRZ0IP1z7mTWrabaztDPC5efEaGpi4TZLMr5P9n/ABWRvJi+tVMXG7fusxTNzOaqcr31g2VQBXJ2nMZWxawP4xzTp+sSVcVsHm5xt4UjLyVQ6+A=
email: roboptim@googlegroups.com
before_install:
- ./.travis/dependencies/eigen-3.2
- ./.travis/run before_install
script:
- export LD_LIBRARY_PATH="/tmp/_travis/install/lib/roboptim-core/":$LD_LIBRARY_PATH
- ./.travis/run build
after_success: ./.travis/run after_success
after_failure: ./.travis/run after_failure
branches:
only:
- master
- dev
- travis
- debian
script:
- if [ "${TRAVIS_OS_NAME}" == "linux" ]; then export LD_LIBRARY_PATH=`pkg-config --variable=plugindir roboptim-core`:$LD_LIBRARY_PATH; fi
- if [ "${TRAVIS_OS_NAME}" == "osx" ]; then export DYLD_LIBRARY_PATH=`pkg-config --variable=plugindir roboptim-core`:$DYLD_LIBRARY_PATH; fi
- if [ "${ENABLE_CXX11}" == "1" ]; then export CMAKE_ADDITIONAL_OPTIONS="-DUSE_CXX11:BOOL=ON -DROBOPTIM_PRECOMPILE_DENSE_SPARSE:BOOL=ON ${CMAKE_ADDITIONAL_OPTIONS}"; fi
- if [ "${COVERITY_SCAN_BRANCH}" != "1" ]; then ./.travis/run build; fi
after_success:
- ./.travis/run after_success
- codecov --gcov-root=/tmp/_ci/build
after_failure: ./.travis/run after_failure
before_install:
- pip install --user codecov
- ./.travis/dependencies/eigen-3.2
- ./.travis/run before_install

matrix:
allow_failures:
- compiler: clang
- os: linux
compiler: clang
- os: osx
compiler: gcc
- env: COVERITY_SCAN_BRANCH=1
include:
- os: linux
dist: trusty
compiler: gcc
- os: linux
dist: trusty
compiler: clang
env: ENABLE_CXX11=1
- os: linux
dist: precise
compiler: gcc
env: MASTER_PPA="george-edison55/precise-backports"
- os: linux
dist: precise
compiler: clang
env: MASTER_PPA="george-edison55/precise-backports"
- os: osx
compiler: clang
- os: osx
compiler: gcc

addons:
coverity_scan:
project:
name: "roboptim/roboptim-core-plugin-cminpack"
description: "Build submitted via Travis CI"
notification_email: roboptim@googlegroups.com
build_command_prepend: ". .travis/common.sh && mkdir coverity && cd coverity && cmake .."
build_command: "make"
branch_pattern: coverity_scan
13 changes: 5 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -19,19 +19,14 @@

CMAKE_MINIMUM_REQUIRED(VERSION 2.8)

#SET(CXX_DISABLE_WERROR TRUE)
INCLUDE(cmake/base.cmake)
INCLUDE(cmake/boost.cmake)
INCLUDE(cmake/cpack.cmake)

SET(PROJECT_NAME roboptim-core-plugin-cminpack)
SET(PROJECT_DESCRIPTION
"Nonlinear least-square optimization using Levenberg Marquardt algorithm."
)
SET(PROJECT_DESCRIPTION "Nonlinear least-square optimization using Levenberg Marquardt algorithm.")
SET(PROJECT_URL "http://github.com/roboptim/roboptim-core-plugin-cminpack")

# Where to compile shared objects
SET(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib)
SET(PROJECT_DEBUG_POSTFIX "_d")

SET(PKG_CONFIG_ADDITIONAL_VARIABLES plugindir ${PKG_CONFIG_ADDITIONAL_VARIABLES})
SETUP_PROJECT()
@@ -46,12 +41,14 @@ SET(BOOST_COMPONENTS date_time filesystem system unit_test_framework)
SEARCH_FOR_BOOST()

ADD_REQUIRED_DEPENDENCY("cminpack >= 1.0")
ADD_REQUIRED_DEPENDENCY("roboptim-core >= 3.0")
ADD_REQUIRED_DEPENDENCY("roboptim-core >= 3.2")

# Add dependency toward pg-slider library in pkg-config file.
PKG_CONFIG_APPEND_LIBS("roboptim-core-plugin-cminpack")

ADD_SUBDIRECTORY(src)
ADD_SUBDIRECTORY(tests)

HEADER_INSTALL("${HEADERS}")

SETUP_PROJECT_FINALIZE()
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@ roboptim-core-plugin-cminpack
=============================

[![Build Status](https://travis-ci.org/roboptim/roboptim-core-plugin-cminpack.png?branch=master)](https://travis-ci.org/roboptim/roboptim-core-plugin-cminpack)
[![Coverage Status](https://coveralls.io/repos/roboptim/roboptim-core-plugin-cminpack/badge.png)](https://coveralls.io/r/roboptim/roboptim-core-plugin-cminpack)
[![Coverage Status](https://codecov.io/gh/roboptim/roboptim-core-plugin-cminpack/branch/master/graph/badge.svg)](https://codecov.io/gh/roboptim/roboptim-core-plugin-cminpack)

This package wraps cminpack implementation of Levenberg Marquardt algorithm.

2 changes: 1 addition & 1 deletion cmake
Submodule cmake updated 224 files
27 changes: 16 additions & 11 deletions include/roboptim/core/plugin/cminpack.hh
Original file line number Diff line number Diff line change
@@ -32,14 +32,14 @@ namespace roboptim {
/// This solver tries to minimize the euclidean norm of a vector valued
/// function.
class SolverWithJacobian :
public Solver<SumOfC1Squares, boost::mpl::vector<> >
public Solver<EigenMatrixDense>
{
public:
/// \brief Parent type
typedef Solver<SumOfC1Squares, boost::mpl::vector<> > parent_t;
typedef Solver<EigenMatrixDense> parent_t;

/// \brief Cost function type
typedef problem_t::function_t function_t;
typedef SumOfC1Squares function_t;

/// \brief Type of result
typedef function_t::argument_t argument_t;
@@ -88,34 +88,39 @@ namespace roboptim {
/// Get value
const argument_t& value () const
{
(*cost_)(value_, parameter_);
(*baseCost_)(value_, parameter_);
return value_;
}

/// Get Jacobian
const gradient_t& jacobianRow (size_type iRow) const
{
(*cost_).gradient (jacobianRow_, parameter_, iRow);
(*baseCost_).gradient (jacobianRow_, parameter_, iRow);
return jacobianRow_;
}

const boost::shared_ptr<const DifferentiableFunction> baseCost () const
{
return baseCost_;
}

private:
/// Number of variables
size_type n_;
/// Dimension of the cost function
size_type m_;
/// Array of double to store variable of optimization problem
double* x_;
vector_t x_;
/// Array of double to store value of optimization problem
double* fvec_;
vector_t fvec_;
/// Array of double to store one line of Jacobian
double* fjac_;
vector_t fjac_;
/// Array of int used by the optimizer
int* ipvt_;
Eigen::VectorXi ipvt_;
/// Positive integer not less than 5*n_+m_
int lwa_;
/// array of double of size lwa_;
double* wa_;
vector_t wa_;

/// Parameter of the function
argument_t parameter_;
@@ -124,7 +129,7 @@ namespace roboptim {
/// Jacobian of the cost function
mutable gradient_t jacobianRow_;
/// Reference to cost function
boost::shared_ptr <const DifferentiableFunction> cost_;
boost::shared_ptr <const DifferentiableFunction> baseCost_;
}; // class Solver
} // namespace cminpack
} // namespace roboptim
24 changes: 15 additions & 9 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -17,20 +17,26 @@
# roboptim-core-plugin-cminpack If not, see
# <http://www.gnu.org/licenses/>.

# Define the directory where plug-ins will be installed.
SET(PLUGIN_NAME ${PROJECT_NAME})

ADD_DEFINITIONS(-DPLUGIN_PATH="${LIBRARY_OUTPUT_PATH}")
# Define the directory where plug-ins will be installed.
IF(ROBOPTIM_CORE_FOUND)
GET_FILENAME_COMPONENT(RELPLUGINDIR ${ROBOPTIM_CORE_PLUGINDIR} NAME)
ELSE()
GET_FILENAME_COMPONENT(RELPLUGINDIR ${ROBOPTIM_CORE_DEBUG_PLUGINDIR} NAME)
ENDIF(ROBOPTIM_CORE_FOUND)
SET(PLUGINDIR ${CMAKE_INSTALL_LIBDIR}/${RELPLUGINDIR})

ADD_LIBRARY(${PLUGIN_NAME}
MODULE
cminpack.cc
)
ADD_LIBRARY(${PLUGIN_NAME} MODULE cminpack.cc)
SET_TARGET_PROPERTIES(${PLUGIN_NAME} PROPERTIES
PREFIX ""
SOVERSION 3.0.0)
COMPILE_FLAGS "-Droboptim_core_plugin_cminpack_EXPORTS"
PREFIX "")
IF(NOT APPLE)
SET_TARGET_PROPERTIES(${PLUGIN_NAME}
PROPERTIES VERSION 3.2.0 SOVERSION 3)
ENDIF()

PKG_CONFIG_USE_DEPENDENCY(${PLUGIN_NAME} roboptim-core)
PKG_CONFIG_USE_DEPENDENCY(${PLUGIN_NAME} cminpack)

INSTALL(TARGETS ${PLUGIN_NAME} DESTINATION ${ROBOPTIM_CORE_PLUGINDIR})
INSTALL(TARGETS ${PLUGIN_NAME} DESTINATION ${PLUGINDIR})
Loading