generated from seqan/library-template
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[MISC] Compute layout also takes positions
Co-authored-by: Enrico Seiler <[email protected]>
- Loading branch information
1 parent
42e493f
commit 53c9cff
Showing
5 changed files
with
70 additions
and
12 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 |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// SPDX-FileCopyrightText: 2006-2024, Knut Reinert & Freie Universität Berlin | ||
// SPDX-FileCopyrightText: 2016-2024, Knut Reinert & MPI für molekulare Genetik | ||
// SPDX-License-Identifier: BSD-3-Clause | ||
|
||
/*!\file | ||
* \brief Provides seqan::hibf::iota_vector. | ||
* \author Enrico Seiler <enrico.seiler AT fu-berlin.de> | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include <cassert> | ||
#include <limits> | ||
#include <numeric> | ||
#include <vector> | ||
|
||
#include <hibf/platform.hpp> | ||
|
||
namespace seqan::hibf | ||
{ | ||
|
||
/*!\brief Creates a vector of size `size` with values from 0 to `size - 1`. | ||
* \tparam value_t The value type of the vector. Defaults to `size_t`. | ||
* \param[in] size The size of the vector. | ||
* \returns A vector of size `size` with values from 0 to `size - 1`. | ||
*/ | ||
template <std::unsigned_integral value_t = size_t> | ||
HIBF_CONSTEXPR_VECTOR std::vector<value_t> iota_vector(size_t const size) | ||
{ | ||
assert(size <= std::numeric_limits<value_t>::max()); | ||
std::vector<value_t> result(size); | ||
std::iota(result.begin(), result.end(), value_t{}); | ||
return result; | ||
} | ||
|
||
} // namespace seqan::hibf |
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