Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
asherikov committed Jan 23, 2025
1 parent f58efe0 commit 97f4d82
Show file tree
Hide file tree
Showing 9 changed files with 118 additions and 118 deletions.
72 changes: 57 additions & 15 deletions .github/workflows/master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,21 +74,6 @@ jobs:
source /opt/ros/noetic/setup.bash
make catkin_test_new ROS_DISTRO=noetic UBUNTU_DISTRO=focal
# empy compatibility issue
#prerelease:
# runs-on: ubuntu-20.04
# defaults:
# run:
# shell: bash
# steps:
# - uses: actions/checkout@v4
# with:
# fetch-depth: 0
# - run: make ros_prerelease ROS_DISTRO=noetic UBUNTU_DISTRO=focal BRANCH=`git branch --show-current`
# env:
# CCACHE_DIR: ${GITHUB_WORKSPACE}/.ccache


jammy_scanbuild:
runs-on: ubuntu-22.04

Expand Down Expand Up @@ -128,3 +113,60 @@ jobs:
cmake -D VCPKG_INSTALL_OPTIONS="--x-feature=test" -D CMAKE_TOOLCHAIN_FILE=C:\vcpkg\scripts\buildsystems\vcpkg.cmake -D QPMAD_BUILD_TESTS=ON -G "NMake Makefiles" .
nmake
- run: ctest --schedule-random --output-on-failure

jammy_ccws_static:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
repository: asherikov/ccws
- uses: actions/checkout@v4
with:
path: src/qpmad
- run: make bp_install_build BUILD_PROFILE=scan_build
- run: make bp_install_build BUILD_PROFILE=static_checks
- run: make BUILD_PROFILE=static_checks
- run: make dep_install PKG=qpmad
- run: make qpmad BUILD_PROFILE=scan_build

jammy_ccws_plain:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
repository: asherikov/ccws
- uses: actions/checkout@v4
with:
path: src/qpmad
- run: make bp_install_build BUILD_PROFILE=reldebug
- run: make dep_install PKG=qpmad
- run: make qpmad
- run: make test PKG=qpmad_tests

jammy_ccws_threadsan:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
repository: asherikov/ccws
- uses: actions/checkout@v4
with:
path: src/qpmad
- run: make bp_install_build BUILD_PROFILE=thread_sanitizer
- run: make dep_install PKG=qpmad
- run: make qpmad BUILD_PROFILE=thread_sanitizer
- run: make test PKG=qpmad BUILD_PROFILE=thread_sanitizer

jammy_ccws_asan:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
repository: asherikov/ccws
- uses: actions/checkout@v4
with:
path: src/qpmad
- run: make bp_install_build BUILD_PROFILE=addr_undef_sanitizers
- run: make dep_install PKG=qpmad
- run: make qpmad BUILD_PROFILE=addr_undef_sanitizers
- run: make test PKG=qpmad BUILD_PROFILE=addr_undef_sanitizers
53 changes: 0 additions & 53 deletions .travis.yml.disable

This file was deleted.

26 changes: 17 additions & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,23 @@ set(Eigen_INCLUDE_DIRS ${EIGEN3_INCLUDE_DIR})
# --------------
# C++ flags
# --------------
include(cmakeut_compiler_flags)
set (CMAKEUT_CPP_SANITIZERS ${QPMAD_CPP_SANITIZERS})
set (CMAKEUT_CLANG_TIDY ${QPMAD_CLANG_TIDY})
# boost test issues
set (CMAKEUT_CLANG_TIDY_EXTRA_IGNORES "-cert-err58-cpp,-cppcoreguidelines-avoid-non-const-global-variables")
# Eigen issues
set (CMAKEUT_CLANG_TIDY_EXTRA_IGNORES "${CMAKEUT_CLANG_TIDY_EXTRA_IGNORES},-clang-analyzer-core.uninitialized.Assign")
cmakeut_compiler_flags("c++14")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKEUT_CXX_FLAGS}")
if(CCWS_CLANG_TIDY)
set(CMAKE_CXX_CLANG_TIDY "${CCWS_CLANG_TIDY}" CACHE STRING "" FORCE)
endif()
if(CCWS_CXX_FLAGS)
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CCWS_CXX_FLAGS}")
set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${CCWS_LINKER_FLAGS}")
else()
include(cmakeut_compiler_flags)
set (CMAKEUT_CPP_SANITIZERS ${QPMAD_CPP_SANITIZERS})
set (CMAKEUT_CLANG_TIDY ${QPMAD_CLANG_TIDY})
# boost test issues
set (CMAKEUT_CLANG_TIDY_EXTRA_IGNORES "-cert-err58-cpp,-cppcoreguidelines-avoid-non-const-global-variables")
# Eigen issues
set (CMAKEUT_CLANG_TIDY_EXTRA_IGNORES "${CMAKEUT_CLANG_TIDY_EXTRA_IGNORES},-clang-analyzer-core.uninitialized.Assign")
cmakeut_compiler_flags("c++14")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKEUT_CXX_FLAGS}")
endif()
# --------------


Expand Down
1 change: 1 addition & 0 deletions cmake/cmakeut_compiler_flags.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ function(cmakeut_compiler_flags STANDARD)
set(CMAKE_CXX_CLANG_TIDY "${CMAKE_CXX_CLANG_TIDY},-modernize-avoid-bind")
set(CMAKE_CXX_CLANG_TIDY "${CMAKE_CXX_CLANG_TIDY},-cppcoreguidelines-explicit-virtual-functions,-hicpp-use-override,-modernize-use-override")
set(CMAKE_CXX_CLANG_TIDY "${CMAKE_CXX_CLANG_TIDY},-bugprone-reserved-identifier,-bugprone-infinite-loop,-cert-dcl51-cpp,-cert-dcl37-c,-readability-identifier-naming")
set(CMAKE_CXX_CLANG_TIDY "${CMAKE_CXX_CLANG_TIDY},-misc-include-cleaner")
set(CMAKE_CXX_CLANG_TIDY "${CMAKE_CXX_CLANG_TIDY},-abseil-*")

set(CMAKE_CXX_CLANG_TIDY "${CMAKE_CXX_CLANG_TIDY},${CMAKEUT_CLANG_TIDY_EXTRA_IGNORES}")
Expand Down
2 changes: 2 additions & 0 deletions include/qpmad/givens.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ namespace qpmad


public:
GivensRotation() = default;

Type computeAndApply(t_Scalar &a, t_Scalar &b, const t_Scalar eps)
{
t_Scalar abs_b = std::fabs(b);
Expand Down
14 changes: 7 additions & 7 deletions test/resolve.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ class ResolveFixture
public:
ResolveFixture()
{
qpmad::MatrixIndex size = 20;
qpmad::MatrixIndex num_general_ctr = 1;
const qpmad::MatrixIndex size = 20;
const qpmad::MatrixIndex num_general_ctr = 1;

xH.initRandomHessian(size);
H_copy = xH.H;
Expand Down Expand Up @@ -107,7 +107,7 @@ BOOST_FIXTURE_TEST_CASE_TEMPLATE(resolve_with_cholesky, t_Solver, TypeListResolv

// next iteration
this->H_copy = this->xH.H;
Eigen::VectorXd x_copy = this->xH.x;
const Eigen::VectorXd x_copy = this->xH.x;
this->param.hessian_type_ = this->solver.getHessianType();
BOOST_CHECK_EQUAL(this->param.hessian_type_, qpmad::SolverParameters::HESSIAN_CHOLESKY_FACTOR);

Expand All @@ -128,7 +128,7 @@ BOOST_FIXTURE_TEST_CASE_TEMPLATE(resolve_with_inverted_cholesky, t_Solver, TypeL

// next iteration
this->H_copy = this->xH.H;
Eigen::VectorXd x_copy = this->xH.x;
const Eigen::VectorXd x_copy = this->xH.x;
this->param.hessian_type_ = this->solver.getHessianType();
BOOST_CHECK_EQUAL(this->param.hessian_type_, qpmad::SolverParameters::HESSIAN_INVERTED_CHOLESKY_FACTOR);

Expand Down Expand Up @@ -164,7 +164,7 @@ class ResolveUnconstrainedFixture
public:
ResolveUnconstrainedFixture()
{
qpmad::MatrixIndex size = 20;
const qpmad::MatrixIndex size = 20;

qpmad_utils::getRandomPositiveDefiniteMatrix(xH.H, size);
H_copy = xH.H;
Expand Down Expand Up @@ -214,7 +214,7 @@ BOOST_FIXTURE_TEST_CASE_TEMPLATE(

// next iteration
this->H_copy = this->xH.H;
Eigen::VectorXd x_copy = this->xH.x;
const Eigen::VectorXd x_copy = this->xH.x;
this->param.hessian_type_ = this->solver.getHessianType();
BOOST_CHECK_EQUAL(this->param.hessian_type_, qpmad::SolverParameters::HESSIAN_CHOLESKY_FACTOR);

Expand All @@ -239,7 +239,7 @@ BOOST_FIXTURE_TEST_CASE_TEMPLATE(

// next iteration
this->H_copy = this->xH.H;
Eigen::VectorXd x_copy = this->xH.x;
const Eigen::VectorXd x_copy = this->xH.x;
this->param.hessian_type_ = this->solver.getHessianType();
BOOST_CHECK_EQUAL(this->param.hessian_type_, qpmad::SolverParameters::HESSIAN_INVERTED_CHOLESKY_FACTOR);

Expand Down
20 changes: 10 additions & 10 deletions test/solver_geneq.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ BOOST_FIXTURE_TEST_CASE_TEMPLATE(
TypeListGeneralEqualities<20>,
SolverGeneralEqualitiesFixture<t_Solver>)
{
qpmad::MatrixIndex size = 50;
qpmad::MatrixIndex num_ctr = 20;
const qpmad::MatrixIndex size = 50;
const qpmad::MatrixIndex num_ctr = 20;

this->initRandomHessian(size);
this->h.setRandom(size);
Expand All @@ -44,8 +44,8 @@ BOOST_FIXTURE_TEST_CASE_TEMPLATE(
TypeListGeneralEqualities<20>,
SolverGeneralEqualitiesFixture<t_Solver>)
{
qpmad::MatrixIndex size = 50;
qpmad::MatrixIndex num_ctr = 20;
const qpmad::MatrixIndex size = 50;
const qpmad::MatrixIndex num_ctr = 20;

this->initRandomHessian(size);

Expand All @@ -63,8 +63,8 @@ BOOST_FIXTURE_TEST_CASE_TEMPLATE(
TypeListGeneralEqualities<50>,
SolverGeneralEqualitiesFixture<t_Solver>)
{
qpmad::MatrixIndex size = 50;
qpmad::MatrixIndex num_ctr = 50;
const qpmad::MatrixIndex size = 50;
const qpmad::MatrixIndex num_ctr = 50;

this->initRandomHessian(size);
this->h.setRandom(size);
Expand All @@ -83,8 +83,8 @@ BOOST_FIXTURE_TEST_CASE_TEMPLATE(
TypeListGeneralEqualities<51>,
SolverGeneralEqualitiesFixture<t_Solver>)
{
qpmad::MatrixIndex size = 50;
qpmad::MatrixIndex num_ctr = 51;
const qpmad::MatrixIndex size = 50;
const qpmad::MatrixIndex num_ctr = 51;

this->initRandomHessian(size);
this->h.setRandom(size);
Expand All @@ -106,8 +106,8 @@ BOOST_FIXTURE_TEST_CASE_TEMPLATE(
TypeListGeneralEqualities<51>,
SolverGeneralEqualitiesFixture<t_Solver>)
{
qpmad::MatrixIndex size = 50;
qpmad::MatrixIndex num_ctr = 51;
const qpmad::MatrixIndex size = 50;
const qpmad::MatrixIndex num_ctr = 51;

this->initRandomHessian(size);
this->h.setRandom(size);
Expand Down
Loading

0 comments on commit 97f4d82

Please sign in to comment.