Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .clang-format
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
Language: Cpp
BasedOnStyle: WebKit
Standard: Cpp11
Standard: c++20
ColumnLimit: 80
...

5 changes: 3 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
cmake_minimum_required(VERSION 3.8)
cmake_minimum_required(VERSION 3.15)
project(libparenth VERSION 0.1.0 LANGUAGES CXX)

# OPTIONS
option(BUILD_TESTS "Build unit tests" ON)

# Set the building options.
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

include_directories(
"${PROJECT_SOURCE_DIR}/include"
Expand Down
2 changes: 1 addition & 1 deletion deps/fbitset
10 changes: 6 additions & 4 deletions include/libparenth.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,12 +125,12 @@ class Parenther {
/** The total number of summation and external indices.
*/

size_t n_dims() const noexcept { return dims_.size(); }
[[nodiscard]] size_t n_dims() const noexcept { return dims_.size(); }

/** The total number of factors.
*/

size_t n_factors() const noexcept { return dims_on_.size(); }
[[nodiscard]] size_t n_factors() const noexcept { return dims_on_.size(); }

/** The two operands of a pairwise contraction.
*
Expand Down Expand Up @@ -218,7 +218,7 @@ class Parenther {
* the traversed subproblems can be found, are returned.
*/

Mem opt(Mode mode, bool if_incl)
[[nodiscard]] Mem opt(Mode mode, bool if_incl)
{
Mem mem{};

Expand Down Expand Up @@ -331,6 +331,8 @@ class Parenther {

auto has_top_idx = bsums.curr_sums.count() > 0;
auto top_idx = bsums.curr_sums.find_last();
// Note: When count() == 0, find_last() returns SIZE_MAX.
// next_idx wraps to 0 via unsigned overflow, which is well-defined.
auto next_idx = top_idx + 1;
if (next_idx < sums_.size()) {

Expand Down Expand Up @@ -839,7 +841,7 @@ class Parenther {
* zero).
*/

Dim get_tot(const Dim_subset& dims) const noexcept
[[nodiscard]] Dim get_tot(const Dim_subset& dims) const noexcept
{
Dim res{ 1l };
for (auto it = dims.begin(); it; ++it) {
Expand Down
Loading