From 64c17d47a28f1cc5b7e3c4813e261a5d633ac66a Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 14 Mar 2024 19:45:43 +0100 Subject: [PATCH] [pre-commit.ci] pre-commit autoupdate (#309) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [pre-commit.ci] pre-commit autoupdate updates: - [github.com/pre-commit/mirrors-clang-format: v17.0.6 → v18.1.1](https://github.com/pre-commit/mirrors-clang-format/compare/v17.0.6...v18.1.1) * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 2 +- include/proxsuite/linalg/dense/core.hpp | 121 ++++++++++-------- include/proxsuite/linalg/dense/factorize.hpp | 4 +- include/proxsuite/linalg/dense/ldlt.hpp | 24 ++-- include/proxsuite/linalg/sparse/factorize.hpp | 13 +- .../linalg/veg/internal/dyn_index.hpp | 13 +- .../veg/internal/external/hedley.ext.hpp | 5 +- .../linalg/veg/internal/fix_index.hpp | 18 +-- .../linalg/veg/internal/integer_seq.hpp | 4 +- .../proxsuite/linalg/veg/internal/macros.hpp | 28 ++-- .../linalg/veg/internal/prologue.hpp | 8 +- .../proxsuite/linalg/veg/memory/address.hpp | 4 +- .../linalg/veg/memory/dynamic_stack.hpp | 20 +-- .../linalg/veg/memory/stack_alloc.hpp | 16 +-- include/proxsuite/linalg/veg/slice.hpp | 18 +-- include/proxsuite/linalg/veg/tuple.hpp | 77 +++++------ .../linalg/veg/type_traits/constructible.hpp | 2 +- include/proxsuite/linalg/veg/util/get.hpp | 2 +- include/proxsuite/linalg/veg/vec.hpp | 20 +-- include/proxsuite/proxqp/dense/solver.hpp | 20 ++- include/proxsuite/proxqp/dense/views.hpp | 33 ++--- include/proxsuite/proxqp/sparse/solver.hpp | 20 ++- include/proxsuite/proxqp/sparse/utils.hpp | 43 +++---- .../proxqp/utils/random_qp_problems.hpp | 25 ++-- test/doctest/doctest.hpp | 2 +- 25 files changed, 278 insertions(+), 264 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 0f15258eb..52925b6c4 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -2,7 +2,7 @@ ci: autoupdate_branch: 'devel' repos: - repo: https://github.com/pre-commit/mirrors-clang-format - rev: v17.0.6 + rev: v18.1.1 hooks: - id: clang-format args: ['--style={BasedOnStyle: Mozilla, SortIncludes: false}'] diff --git a/include/proxsuite/linalg/dense/core.hpp b/include/proxsuite/linalg/dense/core.hpp index 5c43d5005..a5f1dffc2 100644 --- a/include/proxsuite/linalg/dense/core.hpp +++ b/include/proxsuite/linalg/dense/core.hpp @@ -117,8 +117,8 @@ static_assert(sizeof(f64) == 8, "f64 should be 64 bits"); LDLT_FN_IMPL3(fnmadd, Prefix, Suffix); /* (-a * b + c) */ #define LDLT_LOAD_STORE(Prefix, Suffix) \ - VEG_INLINE static auto load_unaligned(ScalarType const* ptr) noexcept \ - -> Pack \ + VEG_INLINE static auto load_unaligned( \ + ScalarType const* ptr) noexcept -> Pack \ { \ return Pack{ simde_mm##Prefix##_loadu_##Suffix(ptr) }; \ } \ @@ -560,8 +560,9 @@ elem_addr(T* ptr, template auto -matrix_elem_addr(Mat&& mat, isize row, isize col) noexcept - -> decltype(mat.data()) +matrix_elem_addr(Mat&& mat, + isize row, + isize col) noexcept -> decltype(mat.data()) { return util::elem_addr::IsRowMajor)>( // @@ -574,16 +575,18 @@ matrix_elem_addr(Mat&& mat, isize row, isize col) noexcept template auto -col(T&& mat, isize col_idx) noexcept -> typename _detail::RowColAccessImpl< - !bool(proxsuite::linalg::veg::uncvref_t::IsRowMajor)>::template Col +col(T&& mat, isize col_idx) noexcept -> + typename _detail::RowColAccessImpl< + !bool(proxsuite::linalg::veg::uncvref_t::IsRowMajor)>::template Col { return _detail::RowColAccessImpl::IsRowMajor)>::col(mat, col_idx); } template auto -row(T&& mat, isize row_idx) noexcept -> typename _detail::RowColAccessImpl< - !bool(proxsuite::linalg::veg::uncvref_t::IsRowMajor)>::template Row +row(T&& mat, isize row_idx) noexcept -> + typename _detail::RowColAccessImpl< + !bool(proxsuite::linalg::veg::uncvref_t::IsRowMajor)>::template Row { return _detail::RowColAccessImpl::IsRowMajor)>::row(mat, row_idx); @@ -591,17 +594,19 @@ row(T&& mat, isize row_idx) noexcept -> typename _detail::RowColAccessImpl< template auto -trans(Mat&& mat) noexcept -> Eigen::Map< // - _detail::const_if<_detail::ptr_is_const::value, - Eigen::Matrix< // - typename proxsuite::linalg::veg::uncvref_t::Scalar, - proxsuite::linalg::veg::uncvref_t::ColsAtCompileTime, - proxsuite::linalg::veg::uncvref_t::RowsAtCompileTime, - bool(proxsuite::linalg::veg::uncvref_t::IsRowMajor) - ? Eigen::ColMajor - : Eigen::RowMajor>>, - Eigen::Unaligned, - _detail::StrideOf>> +trans(Mat&& mat) noexcept + -> Eigen::Map< // + _detail::const_if< + _detail::ptr_is_const::value, + Eigen::Matrix< // + typename proxsuite::linalg::veg::uncvref_t::Scalar, + proxsuite::linalg::veg::uncvref_t::ColsAtCompileTime, + proxsuite::linalg::veg::uncvref_t::RowsAtCompileTime, + bool(proxsuite::linalg::veg::uncvref_t::IsRowMajor) + ? Eigen::ColMajor + : Eigen::RowMajor>>, + Eigen::Unaligned, + _detail::StrideOf>> { return { mat.data(), @@ -616,15 +621,16 @@ trans(Mat&& mat) noexcept -> Eigen::Map< // template auto -diagonal(Mat&& mat) noexcept -> Eigen::Map< // - _detail::const_if<_detail::ptr_is_const::value, - Eigen::Matrix< // - typename proxsuite::linalg::veg::uncvref_t::Scalar, - Eigen::Dynamic, - 1, - Eigen::ColMajor>>, - Eigen::Unaligned, - Eigen::InnerStride> +diagonal(Mat&& mat) noexcept + -> Eigen::Map< // + _detail::const_if<_detail::ptr_is_const::value, + Eigen::Matrix< // + typename proxsuite::linalg::veg::uncvref_t::Scalar, + Eigen::Dynamic, + 1, + Eigen::ColMajor>>, + Eigen::Unaligned, + Eigen::InnerStride> { VEG_DEBUG_ASSERT( // mat.rows() == mat.cols()); @@ -661,11 +667,12 @@ submatrix(Mat&& mat, template auto -to_view(Mat&& mat) noexcept -> Eigen::Map< - _detail::const_if<_detail::ptr_is_const::value, - _detail::OwnedAll>>, - Eigen::Unaligned, - _detail::StrideOf>> +to_view(Mat&& mat) noexcept + -> Eigen::Map<_detail::const_if< + _detail::ptr_is_const::value, + _detail::OwnedAll>>, + Eigen::Unaligned, + _detail::StrideOf>> { return { mat.data(), @@ -680,11 +687,12 @@ to_view(Mat&& mat) noexcept -> Eigen::Map< template auto -to_view_dyn_rows(Mat&& mat) noexcept -> Eigen::Map< - _detail::const_if<_detail::ptr_is_const::value, - _detail::OwnedRows>>, - Eigen::Unaligned, - _detail::StrideOf>> +to_view_dyn_rows(Mat&& mat) noexcept + -> Eigen::Map<_detail::const_if< + _detail::ptr_is_const::value, + _detail::OwnedRows>>, + Eigen::Unaligned, + _detail::StrideOf>> { return { mat.data(), @@ -699,11 +707,12 @@ to_view_dyn_rows(Mat&& mat) noexcept -> Eigen::Map< template auto -to_view_dyn_cols(Mat&& mat) noexcept -> Eigen::Map< - _detail::const_if<_detail::ptr_is_const::value, - _detail::OwnedCols>>, - Eigen::Unaligned, - _detail::StrideOf>> +to_view_dyn_cols(Mat&& mat) noexcept + -> Eigen::Map<_detail::const_if< + _detail::ptr_is_const::value, + _detail::OwnedCols>>, + Eigen::Unaligned, + _detail::StrideOf>> { return { mat.data(), @@ -738,11 +747,12 @@ to_view_dyn(Mat&& mat) noexcept template auto -subrows(Mat&& mat, isize row_start, isize nrows) noexcept -> Eigen::Map< - _detail::const_if<_detail::ptr_is_const::value, - _detail::OwnedRows>>, - Eigen::Unaligned, - _detail::StrideOf>> +subrows(Mat&& mat, isize row_start, isize nrows) noexcept + -> Eigen::Map<_detail::const_if< + _detail::ptr_is_const::value, + _detail::OwnedRows>>, + Eigen::Unaligned, + _detail::StrideOf>> { return { util::elem_addr::IsRowMajor)>( @@ -758,11 +768,12 @@ subrows(Mat&& mat, isize row_start, isize nrows) noexcept -> Eigen::Map< template auto -subcols(Mat&& mat, isize col_start, isize ncols) noexcept -> Eigen::Map< - _detail::const_if<_detail::ptr_is_const::value, - _detail::OwnedCols>>, - Eigen::Unaligned, - _detail::StrideOf>> +subcols(Mat&& mat, isize col_start, isize ncols) noexcept + -> Eigen::Map<_detail::const_if< + _detail::ptr_is_const::value, + _detail::OwnedCols>>, + Eigen::Unaligned, + _detail::StrideOf>> { return { util::elem_addr::IsRowMajor)>( @@ -848,8 +859,8 @@ temp_mat_req(proxsuite::linalg::veg::Tag /*tag*/, template auto -temp_vec_req(proxsuite::linalg::veg::Tag /*tag*/, isize rows) noexcept - -> proxsuite::linalg::veg::dynstack::StackReq +temp_vec_req(proxsuite::linalg::veg::Tag /*tag*/, + isize rows) noexcept -> proxsuite::linalg::veg::dynstack::StackReq { return { rows * isize{ sizeof(T) }, diff --git a/include/proxsuite/linalg/dense/factorize.hpp b/include/proxsuite/linalg/dense/factorize.hpp index 1f3c20e3f..c11f2368b 100644 --- a/include/proxsuite/linalg/dense/factorize.hpp +++ b/include/proxsuite/linalg/dense/factorize.hpp @@ -350,8 +350,8 @@ factorize_recursive(Mat&& mat, template auto -factorize_req(proxsuite::linalg::veg::Tag tag, isize n) noexcept - -> proxsuite::linalg::veg::dynstack::StackReq +factorize_req(proxsuite::linalg::veg::Tag tag, + isize n) noexcept -> proxsuite::linalg::veg::dynstack::StackReq { return proxsuite::linalg::dense::factorize_blocked_req(tag, n, 128) | proxsuite::linalg::dense::factorize_recursive_req(tag, n); diff --git a/include/proxsuite/linalg/dense/ldlt.hpp b/include/proxsuite/linalg/dense/ldlt.hpp index b74bde51a..1a64dfd23 100644 --- a/include/proxsuite/linalg/dense/ldlt.hpp +++ b/include/proxsuite/linalg/dense/ldlt.hpp @@ -614,23 +614,23 @@ struct Ldlt auto dim() const noexcept -> isize { return perm.len(); } auto ld_col() const noexcept -> Eigen::Map< // - ColMat const, - Eigen::Unaligned, - Eigen::OuterStride> + ColMat const, + Eigen::Unaligned, + Eigen::OuterStride> { return { ld_storage.ptr(), dim(), dim(), stride }; } auto ld_col_mut() noexcept -> Eigen::Map< // - ColMat, - Eigen::Unaligned, - Eigen::OuterStride> + ColMat, + Eigen::Unaligned, + Eigen::OuterStride> { return { ld_storage.ptr_mut(), dim(), dim(), stride }; } auto ld_row() const noexcept -> Eigen::Map< // - RowMat const, - Eigen::Unaligned, - Eigen::OuterStride> + RowMat const, + Eigen::Unaligned, + Eigen::OuterStride> { return { ld_storage.ptr(), @@ -640,9 +640,9 @@ struct Ldlt }; } auto ld_row_mut() noexcept -> Eigen::Map< // - RowMat, - Eigen::Unaligned, - Eigen::OuterStride> + RowMat, + Eigen::Unaligned, + Eigen::OuterStride> { return { ld_storage.ptr_mut(), diff --git a/include/proxsuite/linalg/sparse/factorize.hpp b/include/proxsuite/linalg/sparse/factorize.hpp index 225a82f7b..46451dd1c 100644 --- a/include/proxsuite/linalg/sparse/factorize.hpp +++ b/include/proxsuite/linalg/sparse/factorize.hpp @@ -249,8 +249,8 @@ dense_ltsolve(DenseVecMut x, MatRef l) noexcept(false) */ template auto -etree_req(proxsuite::linalg::veg::Tag /*tag*/, isize n) noexcept - -> proxsuite::linalg::veg::dynstack::StackReq +etree_req(proxsuite::linalg::veg::Tag /*tag*/, + isize n) noexcept -> proxsuite::linalg::veg::dynstack::StackReq { return { n * isize{ sizeof(I) }, alignof(I) }; } @@ -456,8 +456,8 @@ postorder_depth_first_search( // */ template auto -postorder_req(proxsuite::linalg::veg::Tag /*tag*/, isize n) noexcept - -> proxsuite::linalg::veg::dynstack::StackReq +postorder_req(proxsuite::linalg::veg::Tag /*tag*/, + isize n) noexcept -> proxsuite::linalg::veg::dynstack::StackReq { return { (3 * n) * isize(sizeof(I)), alignof(I) }; } @@ -716,8 +716,9 @@ column_counts(I* counts, template auto -amd_req(proxsuite::linalg::veg::Tag /*tag*/, isize /*n*/, isize nnz) noexcept - -> proxsuite::linalg::veg::dynstack::StackReq +amd_req(proxsuite::linalg::veg::Tag /*tag*/, + isize /*n*/, + isize nnz) noexcept -> proxsuite::linalg::veg::dynstack::StackReq { return { nnz * isize{ sizeof(char) }, alignof(char) }; } diff --git a/include/proxsuite/linalg/veg/internal/dyn_index.hpp b/include/proxsuite/linalg/veg/internal/dyn_index.hpp index 7db53d0ef..ce3c4050b 100644 --- a/include/proxsuite/linalg/veg/internal/dyn_index.hpp +++ b/include/proxsuite/linalg/veg/internal/dyn_index.hpp @@ -198,12 +198,12 @@ struct binary_traits using Div = Dyn; using Mod = Dyn; - VEG_NODISCARD static constexpr auto div_fn(Dyn a, Dyn b) VEG_NOEXCEPT->Div + VEG_NODISCARD static constexpr auto div_fn(Dyn a, Dyn b) VEG_NOEXCEPT -> Div { return VEG_INTERNAL_ASSERT_PRECONDITION(isize(b) != isize(0)), isize(a) / isize(b); } - VEG_NODISCARD static constexpr auto mod_fn(Dyn a, Dyn b) VEG_NOEXCEPT->Mod + VEG_NODISCARD static constexpr auto mod_fn(Dyn a, Dyn b) VEG_NOEXCEPT -> Mod { return VEG_INTERNAL_ASSERT_PRECONDITION(isize(b) != isize(0)), @@ -224,7 +224,7 @@ struct binary_traits, Dyn> : binary_traits using Mul = Fix<0>; VEG_NODISCARD constexpr VEG_INLINE static auto mul_fn(Fix<0> /*a*/, - Dyn /*b*/) VEG_NOEXCEPT->Mul + Dyn /*b*/) VEG_NOEXCEPT -> Mul { return {}; } @@ -234,7 +234,8 @@ template struct binary_traits> : binary_traits { using Mul = typename binary_traits, Dyn>::Mul; - VEG_INLINE static constexpr auto mul_fn(Dyn a, Fix /*b*/) VEG_NOEXCEPT->Mul + VEG_INLINE static constexpr auto mul_fn(Dyn a, + Fix /*b*/) VEG_NOEXCEPT -> Mul { return binary_traits, Dyn>::mul_fn({}, a); } @@ -243,12 +244,12 @@ struct binary_traits> : binary_traits using Mod = meta::if_t; VEG_NODISCARD VEG_INLINE static constexpr auto div_fn(Dyn a, Fix /*b*/) - VEG_NOEXCEPT->Div + VEG_NOEXCEPT -> Div { return Div(isize(a) / N); } VEG_NODISCARD VEG_INLINE static constexpr auto mod_fn(Dyn a, Fix /*b*/) - VEG_NOEXCEPT->Mod + VEG_NOEXCEPT -> Mod { return Mod(isize(a) % N); } diff --git a/include/proxsuite/linalg/veg/internal/external/hedley.ext.hpp b/include/proxsuite/linalg/veg/internal/external/hedley.ext.hpp index a252e4127..91a3edf63 100644 --- a/include/proxsuite/linalg/veg/internal/external/hedley.ext.hpp +++ b/include/proxsuite/linalg/veg/internal/external/hedley.ext.hpp @@ -1971,9 +1971,8 @@ HEDLEY_DIAGNOSTIC_POP #if HEDLEY_HAS_WARNING("-Wgcc-compat") #define HEDLEY_REQUIRE(expr) \ HEDLEY_DIAGNOSTIC_PUSH \ - _Pragma("clang diagnostic ignored \"-Wgcc-compat\"") \ - __attribute__((diagnose_if(!(expr), #expr, "error"))) \ - HEDLEY_DIAGNOSTIC_POP + _Pragma("clang diagnostic ignored \"-Wgcc-compat\"") __attribute__(( \ + diagnose_if(!(expr), #expr, "error"))) HEDLEY_DIAGNOSTIC_POP #define HEDLEY_REQUIRE_MSG(expr, msg) \ HEDLEY_DIAGNOSTIC_PUSH \ _Pragma("clang diagnostic ignored \"-Wgcc-compat\"") \ diff --git a/include/proxsuite/linalg/veg/internal/fix_index.hpp b/include/proxsuite/linalg/veg/internal/fix_index.hpp index 2d83df45e..7ee0a2f85 100644 --- a/include/proxsuite/linalg/veg/internal/fix_index.hpp +++ b/include/proxsuite/linalg/veg/internal/fix_index.hpp @@ -197,22 +197,22 @@ struct Error using parser = auto (*)(char, Error) -> u64; constexpr auto -parse_digit_2(char c, Error e) VEG_NOEXCEPT->u64 +parse_digit_2(char c, Error e) VEG_NOEXCEPT -> u64 { return (c == '0') ? 0 : (c == '1' ? 1 : e()); } constexpr auto -parse_digit_8(char c, Error e) VEG_NOEXCEPT->u64 +parse_digit_8(char c, Error e) VEG_NOEXCEPT -> u64 { return (c >= '0' && c <= '7') ? u64(c - '0') : e(); } constexpr auto -parse_digit_10(char c, Error e) VEG_NOEXCEPT->u64 +parse_digit_10(char c, Error e) VEG_NOEXCEPT -> u64 { return (c >= '0' && c <= '9') ? u64(c - '0') : e(); } constexpr auto -parse_digit_16(char c, Error e) VEG_NOEXCEPT->u64 +parse_digit_16(char c, Error e) VEG_NOEXCEPT -> u64 { return (c >= '0' && c <= '9') // ? u64(c - '0') @@ -224,7 +224,7 @@ parse_digit_16(char c, Error e) VEG_NOEXCEPT->u64 } constexpr auto -parse_digit(u64 radix) VEG_NOEXCEPT->parser +parse_digit(u64 radix) VEG_NOEXCEPT -> parser { return radix == 2 ? parse_digit_2 @@ -235,7 +235,7 @@ parse_digit(u64 radix) VEG_NOEXCEPT->parser } constexpr auto -parse_num(char const* str, u64 len, u64 radix, Error e) VEG_NOEXCEPT->u64 +parse_num(char const* str, u64 len, u64 radix, Error e) VEG_NOEXCEPT -> u64 { return (len == 0) ? 0 : radix * parse_num(str, len - 1, radix, e) + @@ -243,7 +243,7 @@ parse_num(char const* str, u64 len, u64 radix, Error e) VEG_NOEXCEPT->u64 } constexpr auto -parse_int(char const* str, u64 len, Error e) VEG_NOEXCEPT->u64 +parse_int(char const* str, u64 len, Error e) VEG_NOEXCEPT -> u64 { return (len == 0) // ? e() @@ -303,13 +303,13 @@ struct binary_traits, Fix> VEG_NODISCARD VEG_INLINE static constexpr auto div_fn(Fix /*a*/, Fix /*b*/) - VEG_NOEXCEPT->Div + VEG_NOEXCEPT -> Div { return Div(); } VEG_NODISCARD VEG_INLINE static constexpr auto mod_fn(Fix /*a*/, Fix /*b*/) - VEG_NOEXCEPT->Mod + VEG_NOEXCEPT -> Mod { return Mod(); } diff --git a/include/proxsuite/linalg/veg/internal/integer_seq.hpp b/include/proxsuite/linalg/veg/internal/integer_seq.hpp index ce5dc2069..a653736af 100644 --- a/include/proxsuite/linalg/veg/internal/integer_seq.hpp +++ b/include/proxsuite/linalg/veg/internal/integer_seq.hpp @@ -204,10 +204,10 @@ struct HollowIndexedTuple, Ts...> template auto -get_type(HollowLeaf const*) VEG_NOEXCEPT->T; +get_type(HollowLeaf const*) VEG_NOEXCEPT -> T; template auto -get_idx(HollowLeaf const*) VEG_NOEXCEPT->meta::constant; +get_idx(HollowLeaf const*) VEG_NOEXCEPT -> meta::constant; template struct pack_ith_elem diff --git a/include/proxsuite/linalg/veg/internal/macros.hpp b/include/proxsuite/linalg/veg/internal/macros.hpp index cbb59a767..eed6354a3 100644 --- a/include/proxsuite/linalg/veg/internal/macros.hpp +++ b/include/proxsuite/linalg/veg/internal/macros.hpp @@ -324,11 +324,11 @@ Name, \ (__VA_ARGS__), \ ::proxsuite::linalg::veg::meta::bool_constant<__VA_ARGS__>); \ - VEG_TEMPLATE(Tpl, \ - requires(__VA_ARGS__), \ - constexpr auto check_##Name, \ - (_ = 0, int)) noexcept \ - -> ::proxsuite::linalg::veg::meta::true_type + VEG_TEMPLATE( \ + Tpl, \ + requires(__VA_ARGS__), \ + constexpr auto check_##Name, \ + (_ = 0, int)) noexcept -> ::proxsuite::linalg::veg::meta::true_type #define __VEG_IMPL_SFINAE(_, Param) \ , ::proxsuite::linalg::veg::meta:: \ @@ -844,14 +844,14 @@ struct mem_ptr_type }; constexpr auto -all_of_slice(bool const* arr, usize size) VEG_NOEXCEPT->bool +all_of_slice(bool const* arr, usize size) VEG_NOEXCEPT -> bool { return size == 0 ? true : (arr[0] && _detail::all_of_slice(arr + 1, size - 1)); } template inline constexpr auto -all_of(bool const (&lst)[N]) VEG_NOEXCEPT->bool +all_of(bool const (&lst)[N]) VEG_NOEXCEPT -> bool { return _detail::all_of_slice(lst, N); } @@ -1195,18 +1195,20 @@ struct ExtractCharsImplExpr> template auto -extract_chars(LiteralType /*unused*/) -> typename ExtractCharsImpl< - LiteralType, - _meta::make_index_sequence>::Type +extract_chars(LiteralType /*unused*/) -> + typename ExtractCharsImpl< + LiteralType, + _meta::make_index_sequence>::Type { return {}; } template auto -extract_chars_expr(LiteralType /*unused*/) -> typename ExtractCharsImplExpr< - LiteralType, - _meta::make_index_sequence>::Type +extract_chars_expr(LiteralType /*unused*/) -> + typename ExtractCharsImplExpr< + LiteralType, + _meta::make_index_sequence>::Type { return {}; } diff --git a/include/proxsuite/linalg/veg/internal/prologue.hpp b/include/proxsuite/linalg/veg/internal/prologue.hpp index 9647d76b1..f9314d060 100644 --- a/include/proxsuite/linalg/veg/internal/prologue.hpp +++ b/include/proxsuite/linalg/veg/internal/prologue.hpp @@ -55,15 +55,15 @@ ~Class() = default; \ Class(Class&&) = default; \ explicit Class(Class const&) = default; \ - auto operator=(Class&&)& -> Class& = default; \ - auto operator=(Class const&)& -> Class& = default + auto operator=(Class&&)&->Class& = default; \ + auto operator=(Class const&)&->Class& = default #define VEG_NO_COPY(Class) \ ~Class() = default; \ Class(Class&&) = default; \ Class(Class const&) = delete; \ - auto operator=(Class&&)& -> Class& = default; \ - auto operator=(Class const&)& -> Class& = delete + auto operator=(Class&&)&->Class& = default; \ + auto operator=(Class const&)&->Class& = delete #ifdef VEG_WITH_CXX14_SUPPORT #define VEG_CPP14(...) __VA_ARGS__ diff --git a/include/proxsuite/linalg/veg/memory/address.hpp b/include/proxsuite/linalg/veg/memory/address.hpp index 3acb8d331..acbedf52a 100644 --- a/include/proxsuite/linalg/veg/memory/address.hpp +++ b/include/proxsuite/linalg/veg/memory/address.hpp @@ -29,7 +29,7 @@ struct member_addr using type = decltype(void(VEG_DECLVAL(T&).operator&())); template - VEG_INLINE static auto apply(T& var) VEG_NOEXCEPT->T* + VEG_INLINE static auto apply(T& var) VEG_NOEXCEPT -> T* { using char_ref = char&; return static_cast(static_cast(&char_ref(var))); @@ -43,7 +43,7 @@ struct adl_addr : member_addr struct builtin_addr : meta::true_type { template - VEG_INLINE static constexpr auto apply(T& var) VEG_NOEXCEPT->T* + VEG_INLINE static constexpr auto apply(T& var) VEG_NOEXCEPT -> T* { return &var; } diff --git a/include/proxsuite/linalg/veg/memory/dynamic_stack.hpp b/include/proxsuite/linalg/veg/memory/dynamic_stack.hpp index 48e38a9cf..b6110d1ed 100644 --- a/include/proxsuite/linalg/veg/memory/dynamic_stack.hpp +++ b/include/proxsuite/linalg/veg/memory/dynamic_stack.hpp @@ -117,7 +117,7 @@ namespace _detail { // pointer, returns nullptr and the values are left unmodified inline auto align_next(isize alignment, isize size, void*& ptr, isize& space) - VEG_ALWAYS_NOEXCEPT->void* + VEG_ALWAYS_NOEXCEPT -> void* { static_assert(sizeof(std::uintptr_t) >= sizeof(void*), "std::uintptr_t can't hold a pointer value"); @@ -226,14 +226,14 @@ struct DynStackMut } VEG_NODISCARD - auto remaining_bytes() const VEG_NOEXCEPT->isize + auto remaining_bytes() const VEG_NOEXCEPT -> isize { return isize(stack_bytes); } VEG_NODISCARD - auto ptr_mut() const VEG_NOEXCEPT->void* { return stack_data; } + auto ptr_mut() const VEG_NOEXCEPT -> void* { return stack_data; } VEG_NODISCARD - auto ptr() const VEG_NOEXCEPT->void const* { return stack_data; } + auto ptr() const VEG_NOEXCEPT -> void const* { return stack_data; } private: VEG_INLINE void assert_valid_len(PROXSUITE_MAYBE_UNUSED isize len) @@ -280,7 +280,7 @@ struct DynStackMut VEG_NODISCARD auto make_alloc(Tag /*unused*/, isize len, isize align = alignof(T)) - VEG_NOEXCEPT->DynStackAlloc + VEG_NOEXCEPT -> DynStackAlloc { assert_valid_len(len); DynStackAlloc get{ @@ -385,7 +385,7 @@ struct DynStackAlloc : _detail::_dynstack::DynAllocBase return *this; } - VEG_NODISCARD auto as_mut() VEG_NOEXCEPT->SliceMut + VEG_NODISCARD auto as_mut() VEG_NOEXCEPT -> SliceMut { return { unsafe, @@ -395,7 +395,7 @@ struct DynStackAlloc : _detail::_dynstack::DynAllocBase }; } - VEG_NODISCARD auto as_ref() const VEG_NOEXCEPT->Slice + VEG_NODISCARD auto as_ref() const VEG_NOEXCEPT -> Slice { return { unsafe, @@ -405,17 +405,17 @@ struct DynStackAlloc : _detail::_dynstack::DynAllocBase }; } - VEG_NODISCARD auto ptr_mut() VEG_NOEXCEPT->T* + VEG_NODISCARD auto ptr_mut() VEG_NOEXCEPT -> T* { return /* NOLINT(clang-analyzer-linalg.uninitialized.UndefReturn) */ static_cast(const_cast(Base::data)); } - VEG_NODISCARD auto ptr() const VEG_NOEXCEPT->T const* + VEG_NODISCARD auto ptr() const VEG_NOEXCEPT -> T const* { return /* NOLINT(clang-analyzer-linalg.uninitialized.UndefReturn) */ static_cast(const_cast(Base::data)); } - VEG_NODISCARD auto len() const VEG_NOEXCEPT->isize + VEG_NODISCARD auto len() const VEG_NOEXCEPT -> isize { return isize(Base::len); } diff --git a/include/proxsuite/linalg/veg/memory/stack_alloc.hpp b/include/proxsuite/linalg/veg/memory/stack_alloc.hpp index becb39cb6..a0affffb9 100644 --- a/include/proxsuite/linalg/veg/memory/stack_alloc.hpp +++ b/include/proxsuite/linalg/veg/memory/stack_alloc.hpp @@ -76,8 +76,8 @@ struct BumpAllocLayout return blk; } - auto _grow_last_unchecked(void* ptr, usize new_byte_size) noexcept - -> mem::AllocBlock + auto _grow_last_unchecked(void* ptr, + usize new_byte_size) noexcept -> mem::AllocBlock { auto rem_bytes = usize(end_ptr - static_cast(ptr)); auto given_bytes = _align(new_byte_size); @@ -157,8 +157,8 @@ struct Alloc> using ImplMut = _detail::_mem::BumpAllocLayout&; using RefMut = proxsuite::linalg::veg::RefMut>; - VEG_INLINE static auto alloc(RefMut ref, mem::Layout layout) noexcept - -> AllocBlock + VEG_INLINE static auto alloc(RefMut ref, + mem::Layout layout) noexcept -> AllocBlock { return ImplMut(ref.get())._alloc(layout); } @@ -184,8 +184,8 @@ struct Alloc> using ImplMut = _detail::_mem::BumpAllocLayout&; using RefMut = proxsuite::linalg::veg::RefMut>; - VEG_INLINE static auto alloc(RefMut ref, mem::Layout layout) noexcept - -> AllocBlock + VEG_INLINE static auto alloc(RefMut ref, + mem::Layout layout) noexcept -> AllocBlock { return ImplMut(ref.get())._alloc(layout); } @@ -211,8 +211,8 @@ struct Alloc> using ImplMut = _detail::_mem::BumpAllocLayout&; using RefMut = proxsuite::linalg::veg::RefMut>; - VEG_INLINE static auto alloc(RefMut ref, mem::Layout layout) noexcept - -> AllocBlock + VEG_INLINE static auto alloc(RefMut ref, + mem::Layout layout) noexcept -> AllocBlock { return ImplMut(ref.get())._alloc(layout); } diff --git a/include/proxsuite/linalg/veg/slice.hpp b/include/proxsuite/linalg/veg/slice.hpp index 7f8ff0ffb..965875619 100644 --- a/include/proxsuite/linalg/veg/slice.hpp +++ b/include/proxsuite/linalg/veg/slice.hpp @@ -46,10 +46,10 @@ struct Slice : _detail::_slice::adl::AdlBase VEG_NODISCARD VEG_INLINE - constexpr auto ptr() const VEG_NOEXCEPT->T const* { return data; } + constexpr auto ptr() const VEG_NOEXCEPT -> T const* { return data; } VEG_NODISCARD VEG_INLINE - constexpr auto len() const VEG_NOEXCEPT->isize { return size; } + constexpr auto len() const VEG_NOEXCEPT -> isize { return size; } VEG_NODISCARD VEG_INLINE @@ -61,13 +61,13 @@ struct Slice : _detail::_slice::adl::AdlBase VEG_NODISCARD VEG_INLINE constexpr auto get_unchecked(Unsafe /*tag*/, - isize idx) const VEG_NOEXCEPT->Ref + isize idx) const VEG_NOEXCEPT -> Ref { return ref(*(data + idx)); } - VEG_NODISCARD VEG_INLINE constexpr auto split_at(isize idx) const - VEG_NOEXCEPT->Tuple, Slice> + VEG_NODISCARD VEG_INLINE constexpr auto split_at(isize idx) const VEG_NOEXCEPT + -> Tuple, Slice> { return VEG_INTERNAL_ASSERT_PRECONDITION(usize(idx) <= usize(len())), Tuple, Slice>{ @@ -87,8 +87,8 @@ struct Slice : _detail::_slice::adl::AdlBase }; } - VEG_NODISCARD VEG_INLINE auto as_bytes() const - VEG_NOEXCEPT->Slice + VEG_NODISCARD VEG_INLINE auto as_bytes() const VEG_NOEXCEPT + -> Slice { return { unsafe, @@ -145,12 +145,12 @@ struct SliceMut : private Slice VEG_NODISCARD VEG_INLINE VEG_CPP14(constexpr) - auto get_mut_unchecked(Unsafe /*tag*/, isize idx) VEG_NOEXCEPT->RefMut + auto get_mut_unchecked(Unsafe /*tag*/, isize idx) VEG_NOEXCEPT -> RefMut { return mut(const_cast(*(this->data + idx))); } VEG_NODISCARD VEG_INLINE auto as_mut_bytes() - VEG_NOEXCEPT->SliceMut + VEG_NOEXCEPT -> SliceMut { return { unsafe, diff --git a/include/proxsuite/linalg/veg/tuple.hpp b/include/proxsuite/linalg/veg/tuple.hpp index 2187d28b9..8fe3ca1a9 100644 --- a/include/proxsuite/linalg/veg/tuple.hpp +++ b/include/proxsuite/linalg/veg/tuple.hpp @@ -150,7 +150,7 @@ struct TupleLeafImpl : T { } TupleLeafImpl() = default; - VEG_INLINE constexpr auto leaf_get() const VEG_NOEXCEPT->T& + VEG_INLINE constexpr auto leaf_get() const VEG_NOEXCEPT -> T& { return const_cast(static_cast(*this)); } @@ -168,7 +168,7 @@ struct TupleLeafImpl } TupleLeafImpl() = default; - VEG_INLINE constexpr auto leaf_get() const VEG_NOEXCEPT->T& + VEG_INLINE constexpr auto leaf_get() const VEG_NOEXCEPT -> T& { return const_cast(leaf); } @@ -334,18 +334,18 @@ struct IndexedTuple, Ts...> IndexedTuple() = default; VEG_INLINE constexpr IndexedTuple(Tuplify /*tag*/, Ts... args) VEG_NOEXCEPT - : inner - { + : inner{ #if !defined(VEG_WITH_CXX17_SUPPORT) - inplace, _detail::MoveFn{ VEG_FWD(args) }..., + inplace, + _detail::MoveFn{ VEG_FWD(args) }..., #else #if VEG_HAS_NO_UNIQUE_ADDRESS - TupleLeaf{ Ts(VEG_FWD(args)) }... + TupleLeaf{ Ts(VEG_FWD(args)) }... #else - TupleLeaf{ inplace, _detail::MoveFn{ VEG_FWD(args) } }... + TupleLeaf{ inplace, _detail::MoveFn{ VEG_FWD(args) } }... #endif #endif - } + } { } @@ -357,18 +357,18 @@ struct IndexedTuple, Ts...> (... fns, Fns)) VEG_NOEXCEPT_IF(VEG_ALL_OF(VEG_CONCEPT(nothrow_fn_once))) - : inner - { + : inner{ #if !defined(VEG_WITH_CXX17_SUPPORT) - inplace, VEG_FWD(fns)... + inplace, + VEG_FWD(fns)... #else #if VEG_HAS_NO_UNIQUE_ADDRESS - TupleLeaf{ VEG_FWD(fns)() }... + TupleLeaf{ VEG_FWD(fns)() }... #else - TupleLeaf{ inplace, VEG_FWD(fns) }... + TupleLeaf{ inplace, VEG_FWD(fns) }... #endif #endif - } + } { } @@ -401,7 +401,7 @@ struct IndexedTuple, Ts...> (/*arg*/, Fix)) && VEG_NOEXCEPT_IF( VEG_CONCEPT(nothrow_movable(I), Ts...>>)) - -> ith(I), Ts...> + -> ith(I), Ts...> { return __VEG_IMPL_LEAF_ONCE( *this, static_cast(I), ith(I), Ts...>); @@ -521,21 +521,22 @@ namespace tuple { template VEG_NODISCARD VEG_INLINE constexpr auto get(tuple::IndexedTuple, - Ts...> const& tup) VEG_NOEXCEPT->ith const& + Ts...> const& tup) VEG_NOEXCEPT -> ith const& { return __VEG_IMPL_LEAF(tup, I, ith); } template VEG_NODISCARD VEG_INLINE constexpr auto get(tuple::IndexedTuple, - Ts...>& tup) VEG_NOEXCEPT->ith& + Ts...>& tup) VEG_NOEXCEPT -> ith& { return __VEG_IMPL_LEAF_MUT(tup, I, ith); } template VEG_NODISCARD VEG_INLINE constexpr auto get(tuple::IndexedTuple, - Ts...> const&& tup) VEG_NOEXCEPT->ith const&& + Ts...> const&& tup) + VEG_NOEXCEPT -> ith const&& { return static_cast const&&>( __VEG_IMPL_LEAF(tup, I, ith)); @@ -543,7 +544,7 @@ get(tuple::IndexedTuple, template VEG_NODISCARD VEG_INLINE constexpr auto get(tuple::IndexedTuple, - Ts...>&& tup) VEG_NOEXCEPT->ith&& + Ts...>&& tup) VEG_NOEXCEPT -> ith&& { return __VEG_IMPL_LEAF_ONCE(tup, I, ith); } @@ -555,7 +556,7 @@ namespace _tuple { template VEG_INLINE static constexpr auto tuple_fwd(tuple::IndexedTuple, Ts...>&& tup) - VEG_NOEXCEPT->Tuple + VEG_NOEXCEPT -> Tuple { return { ((void)(tup), tuplify), @@ -617,14 +618,14 @@ struct zip template VEG_INLINE static constexpr auto pre_apply( proxsuite::linalg::veg::meta::true_type /*unused*/, - Tuples&&... tups) VEG_NOEXCEPT->Zip + Tuples&&... tups) VEG_NOEXCEPT -> Zip { return zip::apply(VEG_FWD(tups)...); } template VEG_INLINE static constexpr auto pre_apply( proxsuite::linalg::veg::meta::false_type /*unused*/, - Tuples&&... tups) VEG_NOEXCEPT->Zip + Tuples&&... tups) VEG_NOEXCEPT -> Zip { return zip::from_ref_to_result( TagTuple<> { return {}; } + VEG_INLINE static auto apply() VEG_NOEXCEPT -> Tuple<> { return {}; } template struct Helper @@ -642,8 +643,8 @@ struct zip using Type = Tuple...>; template - VEG_INLINE constexpr auto apply(Ts&&... tups) const - VEG_NOEXCEPT->Type + VEG_INLINE constexpr auto apply(Ts&&... tups) const VEG_NOEXCEPT + -> Type { return { tuplify{}, @@ -658,9 +659,9 @@ struct zip VEG_INLINE static constexpr auto apply( IndexedTuple, Ts...> first, - Tuples... rest) VEG_NOEXCEPT->Tuple< // - typename Helper:: // - template Type...> + Tuples... rest) VEG_NOEXCEPT -> Tuple< // + typename Helper:: // + template Type...> { return { ((void)first, tuplify{}), @@ -706,7 +707,7 @@ struct zip VEG_INLINE static constexpr auto from_ref_to_result( Tag> /*tag*/, IndexedTuple, Tups...> - zipped_refs) VEG_NOEXCEPT->Tuple + zipped_refs) VEG_NOEXCEPT -> Tuple { return { ((void)zipped_refs, inplace[tuplify{}]), @@ -743,7 +744,7 @@ struct cat template VEG_INLINE static constexpr auto pre_apply( proxsuite::linalg::veg::meta::true_type /*unused*/, - Tuples&&... tups) VEG_NOEXCEPT->Concat + Tuples&&... tups) VEG_NOEXCEPT -> Concat { return cat::apply(VEG_FWD(tups)...); } @@ -751,7 +752,7 @@ struct cat template VEG_INLINE static constexpr auto pre_apply( proxsuite::linalg::veg::meta::false_type /*unused*/, - Tuples&&... tups) VEG_NOEXCEPT->Concat + Tuples&&... tups) VEG_NOEXCEPT -> Concat { return cat::template from_ref_to_result( Tag>{}, @@ -762,7 +763,7 @@ struct cat VEG_INLINE static constexpr auto from_ref_to_result( Tag> /*tag*/, IndexedTuple, Refs...> - refs) VEG_NOEXCEPT->proxsuite::linalg::veg::Tuple + refs) VEG_NOEXCEPT -> proxsuite::linalg::veg::Tuple { return { inplace[tuplify{}], @@ -770,17 +771,17 @@ struct cat }; } - VEG_INLINE static auto apply() VEG_NOEXCEPT->Tuple<> { return {}; } + VEG_INLINE static auto apply() VEG_NOEXCEPT -> Tuple<> { return {}; } template VEG_INLINE static constexpr auto apply( IndexedTuple, Ts...>&& first, Tuples&&... rest) - VEG_NOEXCEPT->proxsuite::linalg::veg::meta::type_sequence_cat< - Tuple, - Tuple, - typename _detail::meta_::IndexedToTuple::Type...> + VEG_NOEXCEPT -> proxsuite::linalg::veg::meta::type_sequence_cat< + Tuple, + Tuple, + typename _detail::meta_::IndexedToTuple::Type...> { return cat::apply2(VEG_FWD(first), cat::apply(VEG_FWD(rest)...)); } @@ -790,7 +791,7 @@ struct cat IndexedTuple, Ts...>&& first, IndexedTuple, Us...>&& - second) VEG_NOEXCEPT->Tuple + second) VEG_NOEXCEPT -> Tuple { return { tuplify{}, diff --git a/include/proxsuite/linalg/veg/type_traits/constructible.hpp b/include/proxsuite/linalg/veg/type_traits/constructible.hpp index 644b9e056..7036fd2b0 100644 --- a/include/proxsuite/linalg/veg/type_traits/constructible.hpp +++ b/include/proxsuite/linalg/veg/type_traits/constructible.hpp @@ -193,7 +193,7 @@ struct WithArg Fn&& fn; T&& arg; VEG_INLINE constexpr auto operator()() const&& -> decltype(VEG_FWD(fn)( - VEG_FWD(arg))) + VEG_FWD(arg))) { return VEG_FWD(fn)(VEG_FWD(arg)); } diff --git a/include/proxsuite/linalg/veg/util/get.hpp b/include/proxsuite/linalg/veg/util/get.hpp index 370e11190..df0f3789e 100644 --- a/include/proxsuite/linalg/veg/util/get.hpp +++ b/include/proxsuite/linalg/veg/util/get.hpp @@ -37,7 +37,7 @@ struct array_get template VEG_INLINE static constexpr auto apply(T&& arr) - VEG_NOEXCEPT->decltype(VEG_FWD(arr)[I]) + VEG_NOEXCEPT -> decltype(VEG_FWD(arr)[I]) { return VEG_FWD(arr)[I]; } diff --git a/include/proxsuite/linalg/veg/vec.hpp b/include/proxsuite/linalg/veg/vec.hpp index 6daf11bb9..eb409c3e6 100644 --- a/include/proxsuite/linalg/veg/vec.hpp +++ b/include/proxsuite/linalg/veg/vec.hpp @@ -277,9 +277,9 @@ realloc_and_append( // mem::AllocBlock out, usize out_len, T const* in, - usize in_len) VEG_NOEXCEPT_IF(VEG_CONCEPT(alloc::nothrow_grow) && - VEG_CONCEPT(alloc::nothrow_clone)) - -> mem::AllocBlock + usize in_len) + VEG_NOEXCEPT_IF(VEG_CONCEPT(alloc::nothrow_grow) && + VEG_CONCEPT(alloc::nothrow_clone)) -> mem::AllocBlock { if (in_len == 0) { @@ -950,34 +950,34 @@ struct VecImpl this->push_with_unchecked(unsafe, _detail::MoveFn{ VEG_FWD(value) }); } - VEG_NODISCARD VEG_INLINE auto as_ref() const VEG_NOEXCEPT->Slice + VEG_NODISCARD VEG_INLINE auto as_ref() const VEG_NOEXCEPT -> Slice { return { unsafe, from_raw_parts, ptr(), len() }; } - VEG_NODISCARD VEG_INLINE auto as_mut() VEG_NOEXCEPT->SliceMut + VEG_NODISCARD VEG_INLINE auto as_mut() VEG_NOEXCEPT -> SliceMut { return { unsafe, from_raw_parts, ptr_mut(), len() }; } - VEG_NODISCARD VEG_INLINE auto ptr() const VEG_NOEXCEPT->T const* + VEG_NODISCARD VEG_INLINE auto ptr() const VEG_NOEXCEPT -> T const* { return this->raw_ref().get().data; } - VEG_NODISCARD VEG_INLINE auto ptr_mut() VEG_NOEXCEPT->T* + VEG_NODISCARD VEG_INLINE auto ptr_mut() VEG_NOEXCEPT -> T* { return const_cast(this->ptr()); } - VEG_NODISCARD VEG_INLINE auto len() const VEG_NOEXCEPT->isize + VEG_NODISCARD VEG_INLINE auto len() const VEG_NOEXCEPT -> isize { auto& raw = this->raw_ref().get(); return isize(raw.end - raw.data); } - VEG_NODISCARD VEG_INLINE auto capacity() const VEG_NOEXCEPT->isize + VEG_NODISCARD VEG_INLINE auto capacity() const VEG_NOEXCEPT -> isize { auto& raw = this->raw_ref().get(); return isize(raw.end_alloc - raw.data); } - VEG_NODISCARD VEG_INLINE auto byte_capacity() const VEG_NOEXCEPT->isize + VEG_NODISCARD VEG_INLINE auto byte_capacity() const VEG_NOEXCEPT -> isize { auto& raw = this->raw_ref().get(); return meta::is_consteval() diff --git a/include/proxsuite/proxqp/dense/solver.hpp b/include/proxsuite/proxqp/dense/solver.hpp index 5710fe6db..fcd7425c0 100644 --- a/include/proxsuite/proxqp/dense/solver.hpp +++ b/include/proxsuite/proxqp/dense/solver.hpp @@ -1793,33 +1793,29 @@ qp_solve( // std::cout << "objective: " << qpresults.info.objValue << std::endl; switch (qpresults.info.status) { case QPSolverOutput::PROXQP_SOLVED: { - std::cout << "status: " - << "Solved" << std::endl; + std::cout << "status: " << "Solved" << std::endl; break; } case QPSolverOutput::PROXQP_MAX_ITER_REACHED: { - std::cout << "status: " - << "Maximum number of iterations reached" << std::endl; + std::cout << "status: " << "Maximum number of iterations reached" + << std::endl; break; } case QPSolverOutput::PROXQP_PRIMAL_INFEASIBLE: { - std::cout << "status: " - << "Primal infeasible" << std::endl; + std::cout << "status: " << "Primal infeasible" << std::endl; break; } case QPSolverOutput::PROXQP_DUAL_INFEASIBLE: { - std::cout << "status: " - << "Dual infeasible" << std::endl; + std::cout << "status: " << "Dual infeasible" << std::endl; break; } case QPSolverOutput::PROXQP_SOLVED_CLOSEST_PRIMAL_FEASIBLE: { - std::cout << "status: " - << "Solved closest primal feasible" << std::endl; + std::cout << "status: " << "Solved closest primal feasible" + << std::endl; break; } case QPSolverOutput::PROXQP_NOT_RUN: { - std::cout << "status: " - << "Solver not run" << std::endl; + std::cout << "status: " << "Solver not run" << std::endl; break; } } diff --git a/include/proxsuite/proxqp/dense/views.hpp b/include/proxsuite/proxqp/dense/views.hpp index 2056df827..c8cc22c6e 100644 --- a/include/proxsuite/proxqp/dense/views.hpp +++ b/include/proxsuite/proxqp/dense/views.hpp @@ -53,7 +53,7 @@ struct FnInfoRet_> template auto __VA_ARGS__( \ LDLT_IMPL_GET_PARAMS(NParams, __VA_ARGS__) \ typename ::proxsuite::proxqp::detail::FnInfo< \ - decltype(__VA_ARGS__)>::template Arg<(NParams)-1>) -> \ + decltype(__VA_ARGS__)>::template Arg<(NParams) - 1>) -> \ typename ::proxsuite::proxqp::detail::FnInfo::Ret #define LDLT_EXPLICIT_TPL_DECL(NParams, ...) \ extern LDLT_EXPLICIT_TPL_DEF(NParams, __VA_ARGS__) @@ -717,8 +717,8 @@ struct StridedVectorView { return *ptr(index); } - VEG_INLINE auto segment(isize i, isize size) const noexcept - -> StridedVectorView + VEG_INLINE auto segment(isize i, + isize size) const noexcept -> StridedVectorView { return { from_ptr_size_stride, @@ -784,8 +784,8 @@ struct StridedVectorViewMut { return *ptr(index); } - VEG_INLINE auto segment(isize i, isize size) const noexcept - -> StridedVectorViewMut + VEG_INLINE auto segment(isize i, + isize size) const noexcept -> StridedVectorViewMut { return { from_ptr_size_stride, @@ -884,13 +884,15 @@ struct MatrixView } public: - VEG_INLINE auto col(isize c) const noexcept -> proxsuite::linalg::veg::meta:: - if_t<(L == colmajor), VectorView, StridedVectorView> + VEG_INLINE auto col(isize c) const noexcept + -> proxsuite::linalg::veg::meta:: + if_t<(L == colmajor), VectorView, StridedVectorView> { return col_impl(proxsuite::linalg::veg::meta::constant{}, c); } - VEG_INLINE auto row(isize r) const noexcept -> proxsuite::linalg::veg::meta:: - if_t<(L == rowmajor), VectorView, StridedVectorView> + VEG_INLINE auto row(isize r) const noexcept + -> proxsuite::linalg::veg::meta:: + if_t<(L == rowmajor), VectorView, StridedVectorView> { return trans().col(r); } @@ -990,13 +992,15 @@ struct MatrixViewMut } public: - VEG_INLINE auto col(isize c) const noexcept -> proxsuite::linalg::veg::meta:: - if_t<(L == colmajor), VectorViewMut, StridedVectorViewMut> + VEG_INLINE auto col(isize c) const noexcept + -> proxsuite::linalg::veg::meta:: + if_t<(L == colmajor), VectorViewMut, StridedVectorViewMut> { return col_impl(proxsuite::linalg::veg::meta::constant{}, c); } - VEG_INLINE auto row(isize r) const noexcept -> proxsuite::linalg::veg::meta:: - if_t<(L == rowmajor), VectorViewMut, StridedVectorViewMut> + VEG_INLINE auto row(isize r) const noexcept + -> proxsuite::linalg::veg::meta:: + if_t<(L == rowmajor), VectorViewMut, StridedVectorViewMut> { return trans().col(r); } @@ -1149,8 +1153,7 @@ noalias_mul_add(MatrixViewMut dst, MapMut(dst.data, dst.rows, dst.cols, Stride(dst.outer_stride)) .noalias() - . - operator+=( + .operator+=( factor * LAZY_PRODUCT( Map(lhs.data, lhs.rows, lhs.cols, Stride(lhs.outer_stride)), diff --git a/include/proxsuite/proxqp/sparse/solver.hpp b/include/proxsuite/proxqp/sparse/solver.hpp index 609d2b84d..a6699aeb4 100644 --- a/include/proxsuite/proxqp/sparse/solver.hpp +++ b/include/proxsuite/proxqp/sparse/solver.hpp @@ -1630,33 +1630,29 @@ qp_solve(Results& results, std::cout << "objective: " << results.info.objValue << std::endl; switch (results.info.status) { case QPSolverOutput::PROXQP_SOLVED: { - std::cout << "status: " - << "Solved" << std::endl; + std::cout << "status: " << "Solved" << std::endl; break; } case QPSolverOutput::PROXQP_MAX_ITER_REACHED: { - std::cout << "status: " - << "Maximum number of iterations reached" << std::endl; + std::cout << "status: " << "Maximum number of iterations reached" + << std::endl; break; } case QPSolverOutput::PROXQP_PRIMAL_INFEASIBLE: { - std::cout << "status: " - << "Primal infeasible" << std::endl; + std::cout << "status: " << "Primal infeasible" << std::endl; break; } case QPSolverOutput::PROXQP_DUAL_INFEASIBLE: { - std::cout << "status: " - << "Dual infeasible" << std::endl; + std::cout << "status: " << "Dual infeasible" << std::endl; break; } case QPSolverOutput::PROXQP_SOLVED_CLOSEST_PRIMAL_FEASIBLE: { - std::cout << "status: " - << "Solved closest primal feasible" << std::endl; + std::cout << "status: " << "Solved closest primal feasible" + << std::endl; break; } case QPSolverOutput::PROXQP_NOT_RUN: { - std::cout << "status: " - << "Solver not run" << std::endl; + std::cout << "status: " << "Solver not run" << std::endl; break; } } diff --git a/include/proxsuite/proxqp/sparse/utils.hpp b/include/proxsuite/proxqp/sparse/utils.hpp index eeb3ec15b..c3da2b81c 100644 --- a/include/proxsuite/proxqp/sparse/utils.hpp +++ b/include/proxsuite/proxqp/sparse/utils.hpp @@ -613,28 +613,27 @@ global_dual_residual_infeasibility(VectorViewMut Adx, */ template auto -unscaled_primal_dual_residual( - Workspace& work, - Results& results, - const Settings& settings, - VecMapMut primal_residual_eq_scaled, - VecMapMut primal_residual_in_scaled_lo, - VecMapMut primal_residual_in_scaled_up, - VecMapMut dual_residual_scaled, - T& primal_feasibility_eq_rhs_0, - T& primal_feasibility_in_rhs_0, - T& dual_feasibility_rhs_0, - T& dual_feasibility_rhs_1, - T& dual_feasibility_rhs_3, - T& rhs_duality_gap, - const P& precond, - Model const& data, - const QpView qp_scaled, - VecMapMut x_e, - VecMapMut y_e, - VecMapMut z_e, - proxsuite::linalg::veg::dynstack::DynStackMut stack) - -> proxsuite::linalg::veg::Tuple +unscaled_primal_dual_residual(Workspace& work, + Results& results, + const Settings& settings, + VecMapMut primal_residual_eq_scaled, + VecMapMut primal_residual_in_scaled_lo, + VecMapMut primal_residual_in_scaled_up, + VecMapMut dual_residual_scaled, + T& primal_feasibility_eq_rhs_0, + T& primal_feasibility_in_rhs_0, + T& dual_feasibility_rhs_0, + T& dual_feasibility_rhs_1, + T& dual_feasibility_rhs_3, + T& rhs_duality_gap, + const P& precond, + Model const& data, + const QpView qp_scaled, + VecMapMut x_e, + VecMapMut y_e, + VecMapMut z_e, + proxsuite::linalg::veg::dynstack::DynStackMut + stack) -> proxsuite::linalg::veg::Tuple { isize n = x_e.rows(); diff --git a/include/proxsuite/proxqp/utils/random_qp_problems.hpp b/include/proxsuite/proxqp/utils/random_qp_problems.hpp index e08641d47..2a13423c6 100644 --- a/include/proxsuite/proxqp/utils/random_qp_problems.hpp +++ b/include/proxsuite/proxqp/utils/random_qp_problems.hpp @@ -226,8 +226,9 @@ positive_definite_rand(isize n, Scalar cond) -> Mat template auto -sparse_positive_definite_rand(isize n, Scalar cond, Scalar p) - -> SparseMat +sparse_positive_definite_rand(isize n, + Scalar cond, + Scalar p) -> SparseMat { auto H = SparseMat(n, n); @@ -276,8 +277,9 @@ sparse_positive_definite_rand(isize n, Scalar cond, Scalar p) template auto -sparse_positive_definite_rand_compressed(isize n, Scalar rho, Scalar p) - -> SparseMat +sparse_positive_definite_rand_compressed(isize n, + Scalar rho, + Scalar p) -> SparseMat { auto H = SparseMat(n, n); @@ -306,8 +308,9 @@ sparse_positive_definite_rand_compressed(isize n, Scalar rho, Scalar p) template auto -sparse_positive_definite_rand_not_compressed(isize n, Scalar rho, Scalar p) - -> Mat +sparse_positive_definite_rand_not_compressed(isize n, + Scalar rho, + Scalar p) -> Mat { auto H = Mat(n, n); H.setZero(); @@ -352,8 +355,9 @@ sparse_matrix_rand(isize nrows, isize ncols, Scalar p) -> SparseMat template auto -sparse_matrix_rand_not_compressed(isize nrows, isize ncols, Scalar p) - -> Mat +sparse_matrix_rand_not_compressed(isize nrows, + isize ncols, + Scalar p) -> Mat { auto A = Mat(nrows, ncols); A.setZero(); @@ -412,8 +416,9 @@ template auto -matmul3(MatLhs const& a, MatMid const& b, MatRhs const& c) - -> Mat +matmul3(MatLhs const& a, + MatMid const& b, + MatRhs const& c) -> Mat { return matmul(matmul(a, b), c); } diff --git a/test/doctest/doctest.hpp b/test/doctest/doctest.hpp index 032321960..3aa1418e0 100644 --- a/test/doctest/doctest.hpp +++ b/test/doctest/doctest.hpp @@ -2129,7 +2129,7 @@ class ExceptionTranslator res = m_translateFunction(ex); //! OCLINT parameter reassignment return true; } catch (...) { - } //! OCLINT - empty catch statement + } //! OCLINT - empty catch statement #endif // DOCTEST_CONFIG_NO_EXCEPTIONS static_cast(res); // to silence -Wunused-parameter return false;