Skip to content

Commit

Permalink
Merge pull request #51 from eseiler/infra/namespace
Browse files Browse the repository at this point in the history
[MISC] Rename hibf namespace to seqan::hibf
  • Loading branch information
eseiler authored Aug 25, 2023
2 parents 1e269ec + e78c97f commit 9ca17b7
Show file tree
Hide file tree
Showing 92 changed files with 1,032 additions and 989 deletions.
2 changes: 1 addition & 1 deletion include/hibf/all.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
*/

/*!\defgroup search_dream_index DREAM Index
* \brief Provides hibf::interleaved_bloom_filter.
* \brief Provides seqan::hibf::interleaved_bloom_filter.
* \ingroup search
* \see search
*/
Expand Down
4 changes: 2 additions & 2 deletions include/hibf/config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#include <cereal/access.hpp> // for access
#include <cereal/cereal.hpp> // for make_nvp, CEREAL_NVP

namespace hibf
namespace seqan::hibf
{

using insert_iterator = std::insert_iterator<robin_hood::unordered_flat_set<uint64_t>>;
Expand Down Expand Up @@ -111,4 +111,4 @@ struct config
}
};

} // namespace hibf
} // namespace seqan::hibf
8 changes: 4 additions & 4 deletions include/hibf/contrib/aligned_allocator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
# pragma GCC warning "Non-C++17 compliant compiler! Please open an issue with your compiler and platform!"
#endif // __cpp_aligned_new < 201606

namespace hibf::contrib
namespace seqan::hibf::contrib
{

/*!\brief Allocates uninitialized storage whose memory-alignment is specified by *alignment*.
Expand Down Expand Up @@ -151,14 +151,14 @@ class aligned_allocator
}

/*!\brief Deallocates the storage referenced by the pointer p, which must be a pointer obtained by an earlier call
* to hibf::aligned_allocator::allocate.
* to seqan::hibf::aligned_allocator::allocate.
*
* \param[in] p The pointer to the memory to be deallocated.
* \param[in] n The number of elements to be deallocated.
*
* \details
*
* The argument `n` must be equal to the first argument of the call to hibf::aligned_allocator::allocate that
* The argument `n` must be equal to the first argument of the call to seqan::hibf::aligned_allocator::allocate that
* originally produced `p`, otherwise the behavior is undefined. This function calls
* [operator delete](https://en.cppreference.com/w/cpp/memory/new/operator_delete) to deallocate the memory of
* specified size.
Expand Down Expand Up @@ -237,4 +237,4 @@ class aligned_allocator
//!\}
};

} // namespace hibf::contrib
} // namespace seqan::hibf::contrib
34 changes: 17 additions & 17 deletions include/hibf/contrib/std/all_view.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

/*!\file
* \author Enrico Seiler <enrico.seiler AT fu-berlin.de>
* \brief Provides seqan::std::views::{all, all_t}, and seqan::std::ranges::owning_view.
* \brief Provides seqan::stl::views::{all, all_t}, and seqan::stl::ranges::owning_view.
*/

// File might be included from multiple libraries.
Expand All @@ -18,33 +18,33 @@

#if __cpp_lib_ranges >= 202110L

namespace seqan::std::ranges
namespace seqan::stl::ranges
{

using ::std::ranges::owning_view;

} // namespace seqan::std::ranges
} // namespace seqan::stl::ranges

namespace seqan::std::views
namespace seqan::stl::views
{

using ::std::ranges::views::all;
using ::std::ranges::views::all_t;

} // namespace seqan::std::views
} // namespace seqan::stl::views
#else
# include "concepts.hpp"
# include "detail/adaptor_base.hpp"
# include "detail/exposition_only.hpp"

namespace seqan::std::ranges
namespace seqan::stl::ranges
{

/*!\brief A move-only view that takes unique ownership of a range.
* \sa https://en.cppreference.com/w/cpp/ranges/owning_view
*/
template <::std::ranges::range rng_t>
requires ::std::movable<rng_t> && (!seqan::std::detail::is_initializer_list<::std::remove_cvref_t<rng_t>>)
requires ::std::movable<rng_t> && (!seqan::stl::detail::is_initializer_list<::std::remove_cvref_t<rng_t>>)
class owning_view : public ::std::ranges::view_interface<owning_view<rng_t>>
{
private:
Expand Down Expand Up @@ -158,13 +158,13 @@ class owning_view : public ::std::ranges::view_interface<owning_view<rng_t>>
}
};

/*!\brief The functor for seqan::std::views::all.
/*!\brief The functor for seqan::stl::views::all.
*/
class all_fn : public seqan::std::detail::adaptor_base<all_fn>
class all_fn : public seqan::stl::detail::adaptor_base<all_fn>
{
private:
//!\brief Befriend the base class.
friend seqan::std::detail::adaptor_base<all_fn>;
friend seqan::stl::detail::adaptor_base<all_fn>;

//!\brief Checks whether a type is a view.
template <typename t>
Expand All @@ -179,7 +179,7 @@ class all_fn : public seqan::std::detail::adaptor_base<all_fn>
static constexpr bool valid_for_owning_view = requires { owning_view(::std::declval<t>()); };

public:
using seqan::std::detail::adaptor_base<all_fn>::adaptor_base;
using seqan::stl::detail::adaptor_base<all_fn>::adaptor_base;

/*!\brief Returns a view that includes all elements of the range argument.
* \sa https://en.cppreference.com/w/cpp/ranges/all_view
Expand All @@ -191,7 +191,7 @@ class all_fn : public seqan::std::detail::adaptor_base<all_fn>
* * A ::std::ranges::ref_view of `rng` if that expression is valid.
* * Otherwise, a seqan3::detail::owning_view of `rng`.
*/
template <seqan::std::ranges::viewable_range rng_t>
template <seqan::stl::ranges::viewable_range rng_t>
requires decays_to_view<rng_t> || valid_for_ref_view<rng_t> || valid_for_owning_view<rng_t>
static auto impl(rng_t && rng)
{
Expand All @@ -204,21 +204,21 @@ class all_fn : public seqan::std::detail::adaptor_base<all_fn>
}
};

} // namespace seqan::std::ranges
} // namespace seqan::stl::ranges

namespace seqan::std::views
namespace seqan::stl::views
{

/*!\copydoc all_fn::impl
*/
inline constexpr auto all = seqan::std::ranges::all_fn{};
inline constexpr auto all = seqan::stl::ranges::all_fn{};

/*!\brief Returns the type that results from appying seqan3::detail::all to a range.
*/
template <seqan::std::ranges::viewable_range rng_t>
template <seqan::stl::ranges::viewable_range rng_t>
using all_t = decltype(all(::std::declval<rng_t>()));

} // namespace seqan::std::views
} // namespace seqan::stl::views

#endif // __cpp_lib_ranges >= 202110L

Expand Down
58 changes: 29 additions & 29 deletions include/hibf/contrib/std/chunk_view.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

/*!\file
* \author Enrico Seiler <enrico.seiler AT fu-berlin.de>
* \brief Provides seqan::std::views::chunk.
* \brief Provides seqan::stl::views::chunk.
*/

// File might be included from multiple libraries.
Expand All @@ -18,12 +18,12 @@

#ifdef __cpp_lib_ranges_chunk

namespace seqan::std::views
namespace seqan::stl::views
{

using ::std::ranges::views::chunk;

} // namespace seqan::std::views
} // namespace seqan::stl::views

#else

Expand All @@ -37,7 +37,7 @@ using ::std::ranges::views::chunk;
# include "detail/exposition_only.hpp"
# include "detail/non_propagating_cache.hpp"

namespace seqan::std::detail::chunk
namespace seqan::stl::detail::chunk
{

template <class I>
Expand All @@ -55,9 +55,9 @@ constexpr auto to_unsigned_like(T v) noexcept
return static_cast<::std::make_unsigned_t<T>>(v);
}

} // namespace seqan::std::detail::chunk
} // namespace seqan::stl::detail::chunk

namespace seqan::std::ranges
namespace seqan::stl::ranges
{

template <::std::ranges::view V>
Expand All @@ -74,7 +74,7 @@ SEQAN_STD_NESTED_VISIBILITY
::std::ranges::range_difference_t<V> n_;
::std::ranges::range_difference_t<V> remainder_ = 0;

seqan::std::detail::non_propagating_cache<::std::ranges::iterator_t<V>> current_;
seqan::stl::detail::non_propagating_cache<::std::ranges::iterator_t<V>> current_;

private:
class outer_iterator;
Expand Down Expand Up @@ -115,19 +115,19 @@ SEQAN_STD_NESTED_VISIBILITY
constexpr auto size()
requires ::std::ranges::sized_range<V>
{
return seqan::std::detail::chunk::to_unsigned_like(
seqan::std::detail::chunk::div_ceil(::std::ranges::distance(base_), n_));
return seqan::stl::detail::chunk::to_unsigned_like(
seqan::stl::detail::chunk::div_ceil(::std::ranges::distance(base_), n_));
}
constexpr auto size() const
requires ::std::ranges::sized_range<V const>
{
return seqan::std::detail::chunk::to_unsigned_like(
seqan::std::detail::chunk::div_ceil(::std::ranges::distance(base_), n_));
return seqan::stl::detail::chunk::to_unsigned_like(
seqan::stl::detail::chunk::div_ceil(::std::ranges::distance(base_), n_));
}
};

template <class R>
chunk_view(R &&, ::std::ranges::range_difference_t<R>) -> chunk_view<seqan::std::views::all_t<R>>;
chunk_view(R &&, ::std::ranges::range_difference_t<R>) -> chunk_view<seqan::stl::views::all_t<R>>;

template <::std::ranges::view V>
requires ::std::ranges::input_range<V>
Expand Down Expand Up @@ -180,7 +180,7 @@ class chunk_view<V>::outer_iterator
{
return dist == 0 ? 0 : 1;
}
return seqan::std::detail::chunk::div_ceil(dist - x.parent_->remainder_, x.parent_->n_) + 1;
return seqan::stl::detail::chunk::div_ceil(dist - x.parent_->remainder_, x.parent_->n_) + 1;
}
friend constexpr difference_type operator-(outer_iterator const & x, ::std::default_sentinel_t y)
requires ::std::sized_sentinel_for<::std::ranges::sentinel_t<V>, ::std::ranges::iterator_t<V>>
Expand Down Expand Up @@ -214,7 +214,7 @@ struct chunk_view<V>::outer_iterator::value_type : ::std::ranges::view_interface
constexpr auto size() const
requires ::std::sized_sentinel_for<::std::ranges::sentinel_t<V>, ::std::ranges::iterator_t<V>>
{
return seqan::std::detail::chunk::to_unsigned_like(
return seqan::stl::detail::chunk::to_unsigned_like(
::std::ranges::min(parent_->remainder_, ::std::ranges::end(parent_->base_) - *parent_->current_));
}
};
Expand Down Expand Up @@ -326,7 +326,7 @@ class chunk_view<V> : public ::std::ranges::view_interface<chunk_view<V>>
}

constexpr auto begin()
requires (!seqan::std::detail::simple_view<V>)
requires (!seqan::stl::detail::simple_view<V>)
{
return iterator<false>{this, ::std::ranges::begin(base_)};
}
Expand All @@ -338,7 +338,7 @@ class chunk_view<V> : public ::std::ranges::view_interface<chunk_view<V>>
}

constexpr auto end()
requires (!seqan::std::detail::simple_view<V>)
requires (!seqan::stl::detail::simple_view<V>)
{
if constexpr (::std::ranges::common_range<V> && ::std::ranges::sized_range<V>)
{
Expand Down Expand Up @@ -376,14 +376,14 @@ class chunk_view<V> : public ::std::ranges::view_interface<chunk_view<V>>
constexpr auto size()
requires ::std::ranges::sized_range<V>
{
return seqan::std::detail::chunk::to_unsigned_like(
seqan::std::detail::chunk::div_ceil(::std::ranges::distance(base_), n_));
return seqan::stl::detail::chunk::to_unsigned_like(
seqan::stl::detail::chunk::div_ceil(::std::ranges::distance(base_), n_));
}
constexpr auto size() const
requires ::std::ranges::sized_range<V const>
{
return seqan::std::detail::chunk::to_unsigned_like(
seqan::std::detail::chunk::div_ceil(::std::ranges::distance(base_), n_));
return seqan::stl::detail::chunk::to_unsigned_like(
seqan::stl::detail::chunk::div_ceil(::std::ranges::distance(base_), n_));
}
};

Expand All @@ -393,8 +393,8 @@ template <bool Const>
class chunk_view<V>::iterator
{
private:
using Parent = seqan::std::detail::maybe_const<Const, chunk_view>;
using Base = seqan::std::detail::maybe_const<Const, V>;
using Parent = seqan::stl::detail::maybe_const<Const, chunk_view>;
using Base = seqan::stl::detail::maybe_const<Const, V>;

::std::ranges::iterator_t<Base> current_ = ::std::ranges::iterator_t<Base>{};
::std::ranges::sentinel_t<Base> end_ = ::std::ranges::sentinel_t<Base>{};
Expand Down Expand Up @@ -575,7 +575,7 @@ class chunk_view<V>::iterator
friend constexpr difference_type operator-(::std::default_sentinel_t y, iterator const & x)
requires ::std::sized_sentinel_for<::std::ranges::sentinel_t<Base>, ::std::ranges::iterator_t<Base>>
{
return seqan::std::detail::chunk::div_ceil(x.end_ - x.current_, x.n_);
return seqan::stl::detail::chunk::div_ceil(x.end_ - x.current_, x.n_);
}

friend constexpr difference_type operator-(iterator const & x, ::std::default_sentinel_t y)
Expand All @@ -590,24 +590,24 @@ struct chunk_fn
template <typename Difference>
constexpr auto operator()(Difference n) const
{
return seqan::std::detail::adaptor_from_functor{*this, n};
return seqan::stl::detail::adaptor_from_functor{*this, n};
}

template <seqan::std::ranges::viewable_range Range, typename Difference = ::std::ranges::range_difference_t<Range>>
template <seqan::stl::ranges::viewable_range Range, typename Difference = ::std::ranges::range_difference_t<Range>>
constexpr auto operator()(Range && range, ::std::type_identity_t<Difference> n) const
{
return chunk_view{::std::forward<Range>(range), n};
}
};

} // namespace seqan::std::ranges
} // namespace seqan::stl::ranges

namespace seqan::std::views
namespace seqan::stl::views
{

inline constexpr auto chunk = seqan::std::ranges::chunk_fn{};
inline constexpr auto chunk = seqan::stl::ranges::chunk_fn{};

} // namespace seqan::std::views
} // namespace seqan::stl::views

#endif // ifdef __cpp_lib_ranges_chunk

Expand Down
10 changes: 5 additions & 5 deletions include/hibf/contrib/std/concepts.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

/*!\file
* \author Enrico Seiler <enrico.seiler AT fu-berlin.de>
* \brief Provides seqan::std concepts.
* \brief Provides seqan::stl concepts.
*/

// File might be included from multiple libraries.
Expand All @@ -17,15 +17,15 @@
#include <ranges>

#if __cpp_lib_ranges >= 202110L
namespace seqan::std::ranges
namespace seqan::stl::ranges
{

using ::std::ranges::viewable_range;

}
#else
# include "detail/exposition_only.hpp"
namespace seqan::std::ranges
namespace seqan::stl::ranges
{

template <class T>
Expand All @@ -35,9 +35,9 @@ concept viewable_range = ::std::ranges::range<T>
|| (!::std::ranges::view<::std::remove_cvref_t<T>>
&& (::std::is_lvalue_reference_v<T>
|| (::std::movable<::std::remove_reference_t<T>>
&& !seqan::std::detail::is_initializer_list<::std::remove_cvref_t<T>>))));
&& !seqan::stl::detail::is_initializer_list<::std::remove_cvref_t<T>>))));

} // namespace seqan::std::ranges
} // namespace seqan::stl::ranges

#endif

Expand Down
Loading

1 comment on commit 9ca17b7

@vercel
Copy link

@vercel vercel bot commented on 9ca17b7 Aug 25, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

hibf – ./

hibf-seqan.vercel.app
hibf-git-main-seqan.vercel.app
hibf.vercel.app

Please sign in to comment.