-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #469 from yamacir-kit/release-candidate
Release candidate
- Loading branch information
Showing
60 changed files
with
1,957 additions
and
1,145 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
0.5.66 | ||
0.5.107 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/* | ||
Copyright 2018-2023 Tatsuya Yamasaki. | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
#ifndef INCLUDED_MEEVAX_BIT_LOG2_HPP | ||
#define INCLUDED_MEEVAX_BIT_LOG2_HPP | ||
|
||
namespace meevax | ||
{ | ||
inline namespace bit | ||
{ | ||
template <typename T> | ||
constexpr auto log2(T x) noexcept -> T | ||
{ | ||
return (x < 2) ? 1 : log2(x / 2) + 1; | ||
} | ||
|
||
static_assert(log2(0b0001) == 1); | ||
static_assert(log2(0b0010) == 2); | ||
static_assert(log2(0b0011) == 2); | ||
static_assert(log2(0b0100) == 3); | ||
static_assert(log2(0b0101) == 3); | ||
static_assert(log2(0b0110) == 3); | ||
static_assert(log2(0b0111) == 3); | ||
static_assert(log2(0b1000) == 4); | ||
} // namespace bit | ||
} // namespace meevax | ||
|
||
#endif // INCLUDED_MEEVAX_BIT_LOG2_HPP |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
/* | ||
Copyright 2018-2023 Tatsuya Yamasaki. | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
#ifndef INCLUDED_MEEVAX_BITSET_SIMPLE_BITSET_HPP | ||
#define INCLUDED_MEEVAX_BITSET_SIMPLE_BITSET_HPP | ||
|
||
#include <array> | ||
#include <bitset> | ||
|
||
namespace meevax | ||
{ | ||
inline namespace bitset | ||
{ | ||
template <auto N> | ||
struct simple_bitset : public std::array<bool, N> | ||
{ | ||
constexpr simple_bitset() | ||
: std::array<bool, N> {} | ||
{} | ||
|
||
auto reset(std::size_t i) noexcept -> void | ||
{ | ||
(*this)[i] = false; | ||
} | ||
|
||
auto set(std::size_t i) noexcept -> void | ||
{ | ||
(*this)[i] = true; | ||
} | ||
|
||
auto test(std::size_t i) const noexcept -> bool | ||
{ | ||
return (*this)[i]; | ||
} | ||
}; | ||
} // namespace bitset | ||
} // namespace meevax | ||
|
||
#endif // INCLUDED_MEEVAX_BITSET_SIMPLE_BITSET_HPP |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/* | ||
Copyright 2018-2023 Tatsuya Yamasaki. | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
#ifndef INCLUDED_MEEVAX_CHRONO_DURATION_HPP | ||
#define INCLUDED_MEEVAX_CHRONO_DURATION_HPP | ||
|
||
#include <chrono> | ||
#include <iostream> | ||
|
||
namespace meevax | ||
{ | ||
inline namespace chrono | ||
{ | ||
using days = std::chrono::duration<std::size_t, std::ratio_multiply<std::ratio<24>, std::chrono::hours::period>>; | ||
|
||
using years = std::chrono::duration<std::size_t, std::ratio_multiply<std::ratio<146097, 400>, days::period>>; | ||
|
||
using months = std::chrono::duration<std::size_t, std::ratio_divide<years::period, std::ratio<12>>>; | ||
|
||
template <typename Thunk> | ||
auto duration(Thunk thunk) | ||
{ | ||
auto begin = std::chrono::high_resolution_clock::now(); | ||
thunk(); | ||
return std::chrono::high_resolution_clock::now() - begin; | ||
} | ||
|
||
auto operator <<(std::ostream &, std::chrono::nanoseconds) -> std::ostream &; | ||
} // namespace chrono | ||
} // namespace meevax | ||
|
||
#endif // INCLUDED_MEEVAX_CHRONO_DURATION_HPP |
Oops, something went wrong.