Skip to content

Commit

Permalink
Merge pull request #49 from robotology/devel
Browse files Browse the repository at this point in the history
Merge Devel in Master
  • Loading branch information
GiulioRomualdi authored Feb 6, 2020
2 parents dbca942 + d7c39d8 commit 1839217
Show file tree
Hide file tree
Showing 9 changed files with 269 additions and 578 deletions.
4 changes: 3 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ set(CMAKE_CXX_STANDARD_REQUIRED 11)

project(OsqpEigen
LANGUAGES CXX
VERSION 0.5.2)
VERSION 0.6.0)

# add GNU dirs
include(GNUInstallDirs)
Expand Down Expand Up @@ -114,6 +114,8 @@ install_basic_package_files(${PROJECT_NAME}

## Testing
option(BUILD_TESTING "Create tests using CMake" OFF)
option(RUN_VALGRIND_TESTS "Run tests with Valgrind" FALSE)
mark_as_advanced(RUN_VALGRIND_TESTS)
include(CTest)
if(BUILD_TESTING)
add_subdirectory(tests)
Expand Down
26 changes: 26 additions & 0 deletions cmake/FindVALGRIND.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Find Valgrind.
#
# This module defines:
# VALGRIND_INCLUDE_DIR, where to find valgrind/memcheck.h, etc.
# VALGRIND_PROGRAM, the valgrind executable.
# VALGRIND_FOUND, If false, do not try to use valgrind.
#
# If you have valgrind installed in a non-standard place, you can define
# VALGRIND_ROOT to tell cmake where it is.
if (VALGRIND_FOUND)
return()
endif()

find_path(VALGRIND_INCLUDE_DIR valgrind/memcheck.h
/usr/include /usr/local/include ${VALGRIND_ROOT}/include)

# if VALGRIND_ROOT is empty, we explicitly add /bin to the search
# path, but this does not hurt...
find_program(VALGRIND_PROGRAM NAMES valgrind PATH ${VALGRIND_ROOT}/bin)

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(VALGRIND DEFAULT_MSG
VALGRIND_INCLUDE_DIR
VALGRIND_PROGRAM)

mark_as_advanced(VALGRIND_ROOT VALGRIND_INCLUDE_DIR VALGRIND_PROGRAM)
173 changes: 173 additions & 0 deletions cmake/valgrind-macos.supp
Original file line number Diff line number Diff line change
@@ -0,0 +1,173 @@
{
macOS-Sierra-10.12.5-Leak.1
Memcheck:Leak
match-leak-kinds: reachable
fun:malloc_zone_malloc
fun:NXCreateMapTableFromZone
fun:NXCreateMapTableFromZone
fun:_ZL18__sel_registerNamePKcii
fun:sel_init
fun:map_images_nolock
fun:_ZN11objc_object21sidetable_retainCountEv
fun:_ZN4dyldL18notifyBatchPartialE17dyld_image_statesbPFPKcS0_jPK15dyld_image_infoEbb
fun:_ZN4dyld21registerObjCNotifiersEPFvjPKPKcPKPK11mach_headerEPFvS1_S6_ESC_
fun:_dyld_objc_notify_register
fun:_objc_init
fun:_os_object_init
}
{
macOS-Sierra-10.12.5-Leak.2
Memcheck:Leak
match-leak-kinds: reachable
fun:malloc_zone_malloc
fun:NXCreateHashTableFromZone
fun:NXCreateHashTable
fun:NXCreateMapTableFromZone
fun:NXCreateMapTableFromZone
fun:_ZL18__sel_registerNamePKcii
fun:sel_init
fun:map_images_nolock
fun:_ZN11objc_object21sidetable_retainCountEv
fun:_ZN4dyldL18notifyBatchPartialE17dyld_image_statesbPFPKcS0_jPK15dyld_image_infoEbb
fun:_ZN4dyld21registerObjCNotifiersEPFvjPKPKcPKPK11mach_headerEPFvS1_S6_ESC_
fun:_dyld_objc_notify_register
}
{
macOS-Sierra-10.12.5-Leak.3
Memcheck:Leak
match-leak-kinds: reachable
fun:malloc_zone_malloc
fun:NXCreateHashTableFromZone
fun:NXCreateHashTable
fun:NXCreateMapTableFromZone
fun:NXCreateMapTableFromZone
fun:_ZL18__sel_registerNamePKcii
fun:sel_init
fun:map_images_nolock
fun:_ZN11objc_object21sidetable_retainCountEv
fun:_ZN4dyldL18notifyBatchPartialE17dyld_image_statesbPFPKcS0_jPK15dyld_image_infoEbb
fun:_ZN4dyld21registerObjCNotifiersEPFvjPKPKcPKPK11mach_headerEPFvS1_S6_ESC_
fun:_dyld_objc_notify_register
}
{
macOS-Sierra-10.12.5-Leak.4
Memcheck:Leak
match-leak-kinds: reachable
fun:malloc
fun:NXCreateHashTableFromZone
fun:NXCreateHashTable
fun:NXCreateMapTableFromZone
fun:NXCreateMapTableFromZone
fun:_ZL18__sel_registerNamePKcii
fun:sel_init
fun:map_images_nolock
fun:_ZN11objc_object21sidetable_retainCountEv
fun:_ZN4dyldL18notifyBatchPartialE17dyld_image_statesbPFPKcS0_jPK15dyld_image_infoEbb
fun:_ZN4dyld21registerObjCNotifiersEPFvjPKPKcPKPK11mach_headerEPFvS1_S6_ESC_
fun:_dyld_objc_notify_register
}
{
macOS-Sierra-10.12.5-Leak.5
Memcheck:Leak
match-leak-kinds: reachable
fun:malloc
fun:NXCreateMapTableFromZone
fun:NXCreateMapTableFromZone
fun:_ZL18__sel_registerNamePKcii
fun:sel_init
fun:map_images_nolock
fun:_ZN11objc_object21sidetable_retainCountEv
fun:_ZN4dyldL18notifyBatchPartialE17dyld_image_statesbPFPKcS0_jPK15dyld_image_infoEbb
fun:_ZN4dyld21registerObjCNotifiersEPFvjPKPKcPKPK11mach_headerEPFvS1_S6_ESC_
fun:_dyld_objc_notify_register
fun:_objc_init
fun:_os_object_init
}
{
macOS-Sierra-10.12.5-Leak.6
Memcheck:Leak
match-leak-kinds: reachable
fun:malloc_zone_calloc
fun:_NXHashRehashToCapacity
fun:NXHashInsert
fun:NXCreateHashTableFromZone
fun:NXCreateHashTable
fun:NXCreateMapTableFromZone
fun:NXCreateMapTableFromZone
fun:_ZL18__sel_registerNamePKcii
fun:sel_init
fun:map_images_nolock
fun:_ZN11objc_object21sidetable_retainCountEv
fun:_ZN4dyldL18notifyBatchPartialE17dyld_image_statesbPFPKcS0_jPK15dyld_image_infoEbb
}
{
macOS-Sierra-10.12.5-Leak.7
Memcheck:Leak
match-leak-kinds: possible
fun:calloc
fun:map_images_nolock
fun:_ZN11objc_object21sidetable_retainCountEv
fun:_ZN4dyldL18notifyBatchPartialE17dyld_image_statesbPFPKcS0_jPK15dyld_image_infoEbb
fun:_ZN4dyld21registerObjCNotifiersEPFvjPKPKcPKPK11mach_headerEPFvS1_S6_ESC_
fun:_dyld_objc_notify_register
fun:_objc_init
fun:_os_object_init
fun:libdispatch_init
fun:libSystem_initializer
fun:_ZN16ImageLoaderMachO18doModInitFunctionsERKN11ImageLoader11LinkContextE
fun:_ZN16ImageLoaderMachO16doInitializationERKN11ImageLoader11LinkContextE
}

{
macOS-Sierra-10.12.5-reachable.1
Memcheck:Leak
match-leak-kinds: reachable
fun:malloc_zone_calloc
fun:_NXHashRehashToCapacity
fun:NXHashInsert
fun:NXCreateHashTableFromZone
fun:NXCreateHashTable
fun:NXCreateMapTableFromZone
fun:NXCreateMapTableFromZone
fun:_ZL18__sel_registerNamePKcii
fun:sel_init
fun:map_images_nolock
fun:_ZN11objc_object21sidetable_retainCountEv
fun:_ZN4dyldL18notifyBatchPartialE17dyld_image_statesbPFPKcS0_jPK15dyld_image_infoEbb
}

{
macOS-Sierra-10.12.5-possible.1
Memcheck:Leak
match-leak-kinds: possible
fun:calloc
fun:map_images_nolock
fun:_ZN11objc_object21sidetable_retainCountEv
fun:_ZN4dyldL18notifyBatchPartialE17dyld_image_statesbPFPKcS0_jPK15dyld_image_infoEbb
fun:_ZN4dyld21registerObjCNotifiersEPFvjPKPKcPKPK11mach_headerEPFvS1_S6_ESC_
fun:_dyld_objc_notify_register
fun:_objc_init
fun:_os_object_init
fun:libdispatch_init
fun:libSystem_initializer
fun:_ZN16ImageLoaderMachO18doModInitFunctionsERKN11ImageLoader11LinkContextE
fun:_ZN16ImageLoaderMachO16doInitializationERKN11ImageLoader11LinkContextE
}

{
macOS-Sierra-10.12.5-check.1
Memcheck:Param
msg->desc.port.name
fun:mach_msg_trap
fun:mach_msg
fun:task_set_special_port
fun:_os_trace_create_debug_control_port
fun:_libtrace_init
fun:libSystem_initializer
fun:_ZN16ImageLoaderMachO18doModInitFunctionsERKN11ImageLoader11LinkContextE
fun:_ZN16ImageLoaderMachO16doInitializationERKN11ImageLoader11LinkContextE
fun:_ZN11ImageLoader23recursiveInitializationERKNS_11LinkContextEjPKcRNS_21InitializerTimingListERNS_15UninitedUpwardsE
fun:_ZN11ImageLoader23recursiveInitializationERKNS_11LinkContextEjPKcRNS_21InitializerTimingListERNS_15UninitedUpwardsE
fun:_ZN11ImageLoader19processInitializersERKNS_11LinkContextEjRNS_21InitializerTimingListERNS_15UninitedUpwardsE
fun:_ZN11ImageLoader15runInitializersERKNS_11LinkContextERNS_21InitializerTimingListE
}
56 changes: 0 additions & 56 deletions include/OsqpEigen/Data.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,16 +76,6 @@ namespace OsqpEigen
*/
void setNumberOfConstraints(int m);

/**
* Set the quadratic part of the cost function (Hessian).
* It is assumed to be a simmetric matrix.
* @param hessianMatrix is the Hessian matrix.
* @return true/false in case of success/failure.
*/
template<typename T>
[[deprecated("Use setHessianMatrix(const Eigen::SparseCompressedBase<Derived> &hessianMatrix) instead")]]
bool setHessianMatrix(const Eigen::SparseMatrix<T> &hessianMatrix);

/**
* Set the quadratic part of the cost function (Hessian).
* It is assumed to be a simmetric matrix.
Expand All @@ -95,19 +85,6 @@ namespace OsqpEigen
template<typename Derived>
bool setHessianMatrix(const Eigen::SparseCompressedBase<Derived> &hessianMatrix);


/**
* Set the linear part of the cost function (Gradient).
* @param gradientVector is the Gradient vector.
* @note the elements of the gradient are not copied inside the library.
* The user has to guarantee that the lifetime of the object passed is the same of the
* OsqpEigen object
* @return true/false in case of success/failure.
*/
template<int n>
[[deprecated("Use setGradient(Eigen::Ref<Eigen::Matrix<c_float, Eigen::Dynamic, 1>> gradientVector) instead")]]
bool setGradient(Eigen::Matrix<c_float, n, 1> &gradientVector);

/**
* Set the linear part of the cost function (Gradient).
* @param gradientVector is the Gradient vector.
Expand All @@ -118,15 +95,6 @@ namespace OsqpEigen
*/
bool setGradient(Eigen::Ref<Eigen::Matrix<c_float, Eigen::Dynamic, 1>> gradientVector);

/**
* Set the linear constraint matrix A (size m x n)
* @param linearConstraintsMatrix is the linear constraints matrix A.
* @return true/false in case of success/failure.
*/
template<typename T>
[[deprecated("Use setLinearConstraintsMatrix(const Eigen::SparseCompressedBase<Derived> &linearConstraintsMatrix) instead")]]
bool setLinearConstraintsMatrix(const Eigen::SparseMatrix<T> &linearConstraintsMatrix);

/**
* Set the linear constraint matrix A (size m x n)
* @param linearConstraintsMatrix is the linear constraints matrix A.
Expand All @@ -135,18 +103,6 @@ namespace OsqpEigen
template<typename Derived>
bool setLinearConstraintsMatrix(const Eigen::SparseCompressedBase<Derived> &linearConstraintsMatrix);

/**
* Set the array for lower bound (size m).
* @param lowerBoundVector is the lower bound constraint.
* @note the elements of the lowerBoundVector are not copied inside the library.
* The user has to guarantee that the lifetime of the object passed is the same of the
* OsqpEigen object
* @return true/false in case of success/failure.
*/
template<int m>
[[deprecated("Use setLowerBound(Eigen::Ref<Eigen::Matrix<c_float, Eigen::Dynamic, 1>> lowerBoundVector) instead")]]
bool setLowerBound(Eigen::Matrix<c_float, m, 1>& lowerBoundVector);

/**
* Set the array for lower bound (size m).
* @param lowerBoundVector is the lower bound constraint.
Expand All @@ -157,18 +113,6 @@ namespace OsqpEigen
*/
bool setLowerBound(Eigen::Ref<Eigen::Matrix<c_float, Eigen::Dynamic, 1>> lowerBoundVector);

/**
* Set the array for upper bound (size m).
* @param upperBoundVector is the upper bound constraint.
* @note the elements of the upperBoundVector are not copied inside the library.
* The user has to guarantee that the lifetime of the object passed is the same of the
* OsqpEigen object.
* @return true/false in case of success/failure.
*/
template<int m>
[[deprecated("Use setUpperBound(Eigen::Ref<Eigen::Matrix<c_float, Eigen::Dynamic, 1>> upperBoundVector) instead")]]
bool setUpperBound(Eigen::Matrix<c_float, m, 1>& upperBoundVector);

/**
* Set the array for upper bound (size m).
* @param upperBoundVector is the upper bound constraint.
Expand Down
Loading

0 comments on commit 1839217

Please sign in to comment.